[WIP] BBolt PoC with generative AI#48311
Closed
belimawr wants to merge 29 commits into
Closed
Conversation
Contributor
🤖 GitHub commentsJust comment with:
|
Contributor
|
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
Member
Author
|
This was a good PoC, now we have BBolt in Beats, closing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This draft PR is an experiment of using generative AI to write code in Beats. Cursor as used with a variety of models and using
AGENTS.mdas the configuration/guide for AI agents.The description of the tasks are in
ai-tasks. Using them as a staring point, gen AI was used to generate a detailed implementation plan, those plans are in.tmp-ai-io, the key files to read:model-selection-analysis.mdis the summary of choosing the best models for planning and executing the task.bbolt-implementation-plan.mdis the implementation plan forai-tasks/bbolt-registry.mdgc-performance-analysis.mdis a performance analysisphase3-update-summary.mdcontains the plan to implement an incremental GC as suggested by the performance analysisKnown issues
TestJournaldInputDoesNotDuplicateDatais failing.AI Generated PR description/summary
Summary
bboltstatestore backend underlibbeat/statestore/backend/bbolt/(registry + store + metadata + full-scan TTL GC).filebeat.registry.type(still supportsmemlog).flush: 24h).registry/filebeat/log.jsonto explicitly usememlog.Details
libbeat/statestore/backend/bbolt/registry.go: registry implementation, per-store DB files, background disk GC ticker (interval =disk_ttl).store.go:backend.Storeimplementation (CRUD +Each), JSON encoding, metadata updates on Get/Set,slices.Clonefor bbolt value copies, injectable clock (now func() time.Time).gc.go: Phase 1/2 full-scan GC based onmetadata.last_accessvsdisk_ttl, logs duration/scanned/deleted.doc.go,error.go.Registry.GetDB(...),store.DB().filebeat/config/config.gofilebeat.registry.type(defaultbbolt).filebeat.registry.bbolt.*settings (disk TTL, timeout, bbolt options, etc.).Registry.ValidateConfig()used by the beater to validatetypeand config values without triggering validation duringUnpack.filebeat.registry.debug_port(default 8000).filebeat/beater/store.gobbolt(default) andmemlog.*bbolt.RegistryonfilebeatStore+BBoltRegistry()getter.filebeat.registry.debug_portwas introduced (default8000) to enable a read-only web interface for inspecting the registry during development/troubleshooting. Intended for local/debug use only.filebeat/tests/integration/bbolt_registry_shutdown_test.goverifies bbolt DB contains filestream state after shutdown.registry/filebeat/log.jsonare pinned tomemlog:filebeat/tests/integration/*,filebeat/testing/integration/*,filebeat/tests/system/config/*.yml.j2, etc.x-pack/filebeat/tests/system/config/filebeat_modules.yml.j2,x-pack/filebeat/tests/integration/registrydiagnostics_test.go,x-pack/filebeat/fbreceiver/receiver_test.go.Test plan
go test ./libbeat/statestore/backend/...go test ./filebeat/configgo test ./filebeat/beatergo build .(fromfilebeat/)filebeat/filebeat.test):go test -c ./filebeat -o filebeat/filebeat.testgo test -tags=integration ./filebeat/tests/integration -run TestBBoltRegistrySyncedOnShutdown -count=1Proposed commit message
TBD
Checklist
stresstest.shscript to run them under stress conditions and race detector to verify their stability../changelog/fragmentsusing the changelog tool.Disruptive User Impact
Author's Checklist
How to test this PR locally
Manual test
1. Create a log file
docker run -it --rm mingrammer/flog -n 50 > /tmp/flog.log2. Create a configuration file and start Filebeat
Adjust the following configuration file to match the log file you created
filebeat.yml
3. Check the debug endpoint
In your browser open http://localhost:8000/. You will see a debug UI showing the registry entries. Wait a few seconds and you will see the cursor correctly updated.
Debug UI screenshot
## Related issues## Use cases## Screenshots## Logs