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


##########
be/src/load/channel/load_channel_mgr.cpp:
##########
@@ -88,6 +88,17 @@ Status LoadChannelMgr::open(const PTabletWriterOpenRequest& 
params) {
         if (it != _load_channels.end()) {
             channel = it->second;
         } else {
+            // Reordered/retried opens must not create a new generation behind 
a
+            // live terminal record. A completed load can acknowledge a 
duplicate
+            // open without creating writers; a failed load returns its first 
error.
+            auto* handle = _load_state_channels->lookup(load_id.to_string());

Review Comment:
   [P1] Keep the draining generation fenced after cache eviction
   
   `cancel()` removes the channel and releases `_lock` before synchronously 
draining its bitmap callbacks, leaving this bounded LRU entry as the only 
generation fence. While that drain is blocked, enough same-shard terminal 
inserts can evict the unpinned entry; a retried `open()` then sees neither map 
nor cache state and creates the same load/txn generation while the old writers 
still exist. The retry can overwrite the prepared tablet transaction, and old 
`RowsetBuilder` teardown later rolls back by partition/txn/tablet without 
checking `load_id`, erasing the replacement's state. 
`CancelledChannelCannotSucceedAfterCacheEviction` evicts only after `cancel()` 
has returned and never performs a real open during the drain. Please retain a 
non-evictable draining/generation entry until cancellation completes (or add 
explicit generation identity), and cover blocked cancel -> forced same-shard 
eviction -> real open.



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