Hastyshell commented on code in PR #61380:
URL: https://github.com/apache/doris/pull/61380#discussion_r2944190264


##########
cloud/src/meta-service/meta_service_job.cpp:
##########
@@ -163,8 +163,9 @@ void start_compaction_job(MetaServiceCode& code, 
std::string& msg, std::stringst
         }
     }
 
-    if (compaction.base_compaction_cnt() < stats.base_compaction_cnt() ||
-        compaction.cumulative_compaction_cnt() < 
stats.cumulative_compaction_cnt()) {
+    if (compaction.type() != TabletCompactionJobPB::STOP_TOKEN &&

Review Comment:
   1. At most one non-expired STOP_TOKEN can exist per tablet at any time, 
guaranteed by two layers:
   
   Same BE: _active_compaction_stop_tokens map guarded by _compaction_mtx 
prevents duplicate registration — a second attempt returns AlreadyExist.
   Cross-BE: The MS-side conflict check at line 222 (any_of(STOP_TOKEN)) 
returns JOB_TABLET_BUSY if a STOP_TOKEN already exists for the tablet.
   
   2. Additionally, the compaction_cnt values stored in a STOP_TOKEN job entry 
are never read back — not during abort, lease renewal, or schema change 
commit/cleanup. 
   
   They exist only to pass the stale cache gate, which has no semantic meaning 
for STOP_TOKEN (a non-compaction lock marker). Skipping the stale cache check 
for STOP_TOKEN is therefore safe regardless of how many writers attempt it.



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