Skip to content

branch-4.1: [fix](audit) serialize audit loader batch assembly #65107#65132

Merged
yiguolei merged 1 commit into
branch-4.1from
auto-pick-65107-branch-4.1
Jul 2, 2026
Merged

branch-4.1: [fix](audit) serialize audit loader batch assembly #65107#65132
yiguolei merged 1 commit into
branch-4.1from
auto-pick-65107-branch-4.1

Conversation

@github-actions

@github-actions github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Cherry-picked from #65107

### 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.
@github-actions github-actions Bot requested a review from yiguolei as a code owner July 2, 2026 02:20
@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@hello-stephen

Copy link
Copy Markdown
Contributor

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 100% (0/0) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 100% (0/0) 🎉
Increment coverage report
Complete coverage report

@yiguolei

yiguolei commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

skip buildall

@github-actions github-actions Bot added the approved Indicates a PR has been approved by one committer. label Jul 2, 2026
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

PR approved by at least one committer and no changes requested.

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

PR approved by anyone and no changes requested.

@yiguolei yiguolei merged commit f7ff783 into branch-4.1 Jul 2, 2026
32 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants