Copilot commented on code in PR #67425:
URL: https://github.com/apache/doris/pull/67425#discussion_r3910553442


##########
cloud/src/meta-service/meta_service_job.cpp:
##########
@@ -807,20 +807,96 @@ static void 
remove_delete_bitmap_update_lock(std::unique_ptr<Transaction>& txn,
     }
 }
 
+static bool should_accept_cumulative_point(const std::string& instance_id, 
int64_t tablet_id,
+                                           const TabletCompactionJobPB& 
compaction,
+                                           const TabletCompactionJobPB& 
recorded_compaction,
+                                           const TabletStatsPB& stats) {
+    if (compaction.type() != TabletCompactionJobPB::CUMULATIVE &&
+        compaction.type() != TabletCompactionJobPB::EMPTY_CUMULATIVE) {
+        return true;
+    }
+    // Safe because tablet stats keep max(current, proposal).

Review Comment:
   The comment above the `output_cumulative_point <= stats.cumulative_point()` 
fast-path is misleading: the updated logic no longer always keeps `max(current, 
proposal)` (it only does when `accept_cumulative_point_proposal` is true). This 
check is safe because it guarantees the proposal would not decrease 
`cumulative_point`, not because stats always take the max.



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