Add support for bbolt-based storage in Filebeat#48879
Conversation
🤖 GitHub commentsJust comment with:
|
d36e0e3 to
3acb505
Compare
3acb505 to
8a2ebb6
Compare
b703ae1 to
c922e3b
Compare
Vale Linting ResultsSummary: 1 warning, 5 suggestions found
|
| File | Line | Rule | Message |
|---|---|---|---|
| docs/reference/filebeat/configuration-general-options.md | 114 | Elastic.Latinisms | Latin terms and abbreviations are a common source of confusion. Use 'and so on' instead of 'etc'. |
💡 Suggestions (5)
| File | Line | Rule | Message |
|---|---|---|---|
| docs/reference/filebeat/configuration-general-options.md | 114 | Elastic.WordChoice | Consider using 'can, might' instead of 'may', unless the term is in the UI. |
| docs/reference/filebeat/configuration-general-options.md | 154 | Elastic.WordChoice | Consider using 'deactivates, deselects, hides, turns off, makes unavailable' instead of 'disables', unless the term is in the UI. |
| docs/reference/filebeat/configuration-general-options.md | 154 | Elastic.WordChoice | Consider using 'deactivated, deselected, hidden, turned off, unavailable' instead of 'disabled', unless the term is in the UI. |
| docs/reference/filebeat/configuration-general-options.md | 163 | Elastic.WordChoice | Consider using 'deactivates, deselects, hides, turns off, makes unavailable' instead of 'disables', unless the term is in the UI. |
| docs/reference/filebeat/configuration-general-options.md | 163 | Elastic.WordChoice | Consider using 'deactivated, deselected, hidden, turned off, unavailable' instead of 'disabled', unless the term is in the UI. |
The Vale linter checks documentation changes against the Elastic Docs style guide.
To use Vale locally or report issues, refer to Elastic style guide for Vale.
🔍 Preview links for changed docs |
c922e3b to
538a845
Compare
rdner
left a comment
There was a problem hiding this comment.
Added some clarifications on choice of constants.
As an option, now Filebeat can be configured to store file offset tracking in a bbolt storage instead of the WAL memlog implementation. Also, improved the integration testing framework to accommodate required checks for these changes. Assisted by Cursor.
538a845 to
34786d8
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds support for a new bbolt-backed registry backend for Filebeat selectable via ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@libbeat/statestore/backend/bbolt/compaction.go`:
- Line 35: The cleanup routine currently deletes every file matching the glob
tempDbPrefix + "*" (tempdb*), which can remove valid store DBs whose names begin
with "tempdb"; update the deletion logic in
libbeat/statestore/backend/bbolt/compaction.go to only remove true temporary DB
files by matching the exact naming convention used when creating temps (use a
stricter pattern such as tempDbPrefix followed by a fixed separator or
extension, e.g. tempdb_ or tempdb.<unique>.tmp, rather than tempdb*), and change
the code in the cleanup function (the block around where tempDbPrefix is used
for removal) to check for that exact separator/extension before unlinking files
so real store files like "<store>.db" are never deleted.
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (14)
changelog/fragments/1771601358-add-bbolt-registry-backend.yamldocs/reference/filebeat/configuration-general-options.mddocs/reference/filebeat/filebeat-reference-yml.mdfilebeat/_meta/config/filebeat.global.reference.yml.tmplfilebeat/beater/store.gofilebeat/config/config.gofilebeat/filebeat.reference.ymlfilebeat/testing/integration/filestream_bbolt_test.golibbeat/statestore/backend/bbolt/bbolt.golibbeat/statestore/backend/bbolt/bbolt_test.golibbeat/statestore/backend/bbolt/compaction.golibbeat/statestore/backend/bbolt/config.golibbeat/statestore/backend/bbolt/store.gox-pack/filebeat/filebeat.reference.yml
|
@orestisfl @belimawr @VihasMakwana @AndersonQ please focus on critical issues in your final review. Just a reminder that this is an experimental feature which is built mainly for assessment and testing on our side. Any minor issues, refactoring, etc. can be contributed in later follow ups. |
orestisfl
left a comment
There was a problem hiding this comment.
Just a reminder that this is an experimental feature which is built mainly for assessment and testing on our side. Any minor issues, refactoring, etc. can be contributed in later follow ups.
Fair. Code LGTM. Haven't focused much on config so an extra approval would be good here.
AndersonQ
left a comment
There was a problem hiding this comment.
I have a question about the RW mutex. I added the comments there
orestisfl
left a comment
There was a problem hiding this comment.
Quick note, should we feature-guard it with an environmental variable?
|
@orestisfl I think the configuration flag we introduced here is sufficient. |
AndersonQ
left a comment
There was a problem hiding this comment.
It looks good. I left a comment, I think we need a default TTL, but it does not need to be addressed now.
Did you test it "under agent"? Is the bbolt db being copied to the agent diagnostics?
No, I have not. The bbolt storage is not included into the diagnostics yet and I don't think it should be in the scope of this PR. Only when we're committed to this feature at least at the technical preview level we can change this: beats/filebeat/beater/diagnostics.go Lines 41 to 47 in c6f22b0 |
|
Before we fully integrate this into Elastic Agent we need to validate the effect it has. I am particularly interested in if our current schema and access patterns will work well with bbolt or if we have to change them - filelog does not use bbolt the same way we do. So I am in agreement that we should get this merge and start the evaluation, if I have any comment before merge it's that we probably don't need to formally document it until we have learned how to use (yes it's experimental but we really don't intend for anyone to use it so why tell them about it now). That is not blocking though. I don't think we need to be perfect in this PR, in fact widely using bbolt is impossible anyway until we have a way to migrate from registry to bbolt without breaking anything for users and can articulate the benefits of the change. |
The docs are already there (removing them is work, additional CI time) and they're to tell us developers about the currently available options. Judging by the amount of questions I got here about the available parameters, I'd rather keep it. |
I think for testing and experimenting it is valuable to have the bbolt store in the diagnostics from the beginning, so if things go wrong and we collect a diagnostics, we have the bbolt db there. However, I don't mind merging this PR without it. |
Proposed commit message
To see the registry content (debugging):
Checklist
stresstest.shscript to run them under stress conditions and race detector to verify their stability../changelog/fragmentsusing the changelog tool.Based on #48948 which needs to be merged first.