branch-4.0: [fix](audit) serialize audit loader batch assembly #65107#65131
Open
github-actions[bot] wants to merge 1 commit into
Open
branch-4.0: [fix](audit) serialize audit loader batch assembly #65107#65131github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
### What problem does this PR solve? `AuditLoader.loadIfNecessary()` is synchronized and resets `auditLogBuffer` after stream load, but `assembleAudit()` appended events to the same shared `StringBuilder` without holding the same monitor. When `call flush_audit_log()` forces a load while the audit loader worker is assembling a new event, the worker may append to the old buffer after the payload has already been materialized for stream load and before `resetBatch()` replaces the buffer. That event is then neither included in the current load nor retained for the next load. This can make `flush_audit_log()` miss audit events that have already reached the audit plugin pipeline, which matches the flaky `test_audit_log_queue_time` symptom. Related: DORIS-25958 ### Check List - [x] Added test - [ ] This is a behavior change and it is documented - [ ] This is a new feature and it is documented - [ ] This needs upgrade - [ ] This needs downgrade ### Release note None ### Testing - `git diff --check` - Not run: `run-fe-ut.sh --run org.apache.doris.plugin.audit.AuditLoaderTest` because local `thirdparty/installed/bin/protoc` is missing, and `fe/AGENTS.md` requires stopping FE build/test in that case.
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
|
run buildall |
Contributor
FE UT Coverage ReportIncrement line coverage |
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.
Cherry-picked from #65107