github-actions[bot] commented on code in PR #66880:
URL: https://github.com/apache/doris/pull/66880#discussion_r3840598084


##########
be/src/storage/index/snii/writer/snii_compound_writer.cpp:
##########
@@ -134,6 +134,29 @@ Status SniiCompoundWriter::inherit(const 
reader::SniiRewriteSnapshot& snapshot,
 }
 
 Status SniiCompoundWriter::add_logical_index(const SniiIndexInput& in) {
+    std::vector<uint32_t> null_docids(in.null_docids);

Review Comment:
   **[P2] Precharge this copy before allocating it**
   
   `null_docids` is fully allocated before `set_bytes()` asks a `kHardLimit` 
reporter for permission. For a populated input whose copy is larger than the 
remaining cap, this makes the extra vector resident first and only then returns 
`MEM_LIMIT_EXCEEDED`, defeating the reporter's pre-allocation guarantee. Please 
acquire the prospective copy charge before constructing/reserving the 
destination (as the other reservation-backed growth helpers do), then transfer 
that reservation with the vector.



##########
be/test/storage/index/snii/compaction/snii_streamed_session_test.cpp:
##########
@@ -693,6 +693,43 @@ TEST(SniiStreamedWriterSessionTest, 
NullDocidsStorageIsTransferredIntoStreamedWr
     assert_ok(compound.finish());
 }
 
+TEST(SniiStreamedWriterSessionTest, 
OrdinaryLargeNullHandoffTracksRetainedCapacity) {

Review Comment:
   **[P2] Drive the production handoff in this regression**
   
   This test manually creates the reservation and enters at 
`SniiCompoundWriter`, after the seams that caused the bug and that this PR 
changes. It will still pass if initialized NULL growth stops precharging, 
`SniiIndexColumnWriter::finish()` releases early, `IndexFileWriter` copies, or 
reporter retention regresses. Please add coverage that initializes a real 
`SniiIndexColumnWriter`, grows NULLs (including the array path), finishes 
through `IndexFileWriter`, and checks current/peak plus terminal-zero 
accounting, including a downstream failure path.



-- 
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