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


##########
be/src/storage/rowset/beta_rowset_writer.cpp:
##########
@@ -339,6 +339,10 @@ BetaRowsetWriter::BetaRowsetWriter(StorageEngine& engine)
 RowBinlogRowsetWriter::RowBinlogRowsetWriter(StorageEngine& engine) : 
BetaRowsetWriter(engine) {}
 
 BaseBetaRowsetWriter::~BaseBetaRowsetWriter() {
+    // Finish callbacks before removing files they can still read on 
cancellation.
+    if (_calc_delete_bitmap_token) {

Review Comment:
   [P1] Drain the local writer before derived teardown
   
   This base-destructor drain is too late for the direct local 
`LoadStreamWriter` owner. `TabletStream`'s outer flush task finishes as soon as 
`LoadStreamWriter::add_segment()` enqueues `_generate_delete_bitmap()` on this 
writer's separate token; idle/error `IndexStream` destruction joins only that 
outer token. The inner callback can therefore still capture raw `this` and call 
`_build_tmp()` -> virtual `_build_rowset_meta()` -> virtual 
`BetaRowsetWriter::_num_seg()` while `BetaRowsetWriter`'s derived state is 
being torn down, before this base destructor runs. `BaseDeltaWriter` owners now 
pre-drain and `CloudRowsetWriter` drains in its derived destructor, but 
`LoadStreamWriter` does neither. Please cancel/wait at the start of 
`BetaRowsetWriter::~BetaRowsetWriter()` (or earlier in the load-stream owner) 
and add a test that destroys a real local load-stream writer while its bitmap 
callback is blocked.



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