airborne12 opened a new pull request, #66855:
URL: https://github.com/apache/doris/pull/66855

   ### What problem does this PR solve?
   
   Issue Number: N/A
   
   Related PR: #66052
   
   Problem Summary:
   
   SNII adopted a `LogicalIndexWriter` into `SniiCompoundWriter::indexes_` 
before appending its norms, null bitmap, and block-split bloom-filter sections. 
An injected append failure at those three boundaries reproduced retained 
`MemoryReporter` charges of 96, 86, and 60 bytes respectively after 
`add_logical_index()` returned. The ordinary build caller transfers reporter 
ownership only after that call succeeds, so failure teardown could leave the 
compound writer holding reservations that refer to an already-destroyed 
reporter.
   
   This change keeps the logical writer and its placement local while writing 
all auxiliary sections, then adopts both into the compound writer only after 
every append succeeds. The same ownership rule is applied to the streamed path. 
Poisoning behavior and the successful append order, offsets, file layout, and 
bytes are unchanged, so this does not change the SNII storage format and does 
not require rebuilding existing indexes.
   
   ### Release note
   
   Fix SNII index-build failure cleanup so auxiliary-section write errors 
release build-memory reservations before returning.
   
   ### Check List (For Author)
   
   - Test
       - [ ] Regression test
       - [x] Unit Test
           - ASAN: `./run-be-ut.sh -j 192 --run 
--filter="SniiCompoundWriter.*AppendFailureReleasesReservationsBeforeReturn"`
           - ASAN: `./run-be-ut.sh -j 192 --run 
--filter="SniiCompoundWriter.*"` (21 tests)
       - [x] Manual test (add detailed scripts or steps below)
           - ASAN BE build: `./build.sh --be --clean -j 192`
           - Final incremental ASAN BE build after rebasing latest master: 
`./build.sh --be -j 192`
           - BE format check: `build-support/check-format.sh`
           - Changed-line clang-tidy: no diagnostics in this PR diff; the 
repository script also reports pre-existing baseline diagnostics outside 
changed lines.
       - [ ] No need to test or manual test. Explain why:
           - [ ] This is a refactor/code format and no logic has been changed.
           - [ ] Previous test can cover this change.
           - [ ] No code files have been changed.
           - [ ] Other reason
   
   - Behavior changed:
       - [ ] No.
       - [x] Yes. Failed SNII auxiliary writes release the logical writer 
before returning; successful writes are unchanged.
   
   - Does this need documentation?
       - [x] No.
       - [ ] Yes.
   
   ### Check List (For Reviewer who merge this PR)
   
   - [ ] Confirm the release note
   - [ ] Confirm test cases
   - [ ] Confirm document
   - [ ] Add branch pick label


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to