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


##########
regression-test/plugins/plugin_compaction.groovy:
##########
@@ -177,21 +201,56 @@ Suite.metaClass.trigger_and_wait_compaction = { String 
table_name, String compac
                 }
                 def success_time_unchanged = (oldStatus["last 
${compaction_type} success time"] == tabletStatus["last ${compaction_type} 
success time"])
                 def failure_time_unchanged = (oldStatus["last 
${compaction_type} failure time"] == tabletStatus["last ${compaction_type} 
failure time"])
-                def currentCompactionTimestampChanged = 
!success_time_unchanged || !failure_time_unchanged
+                def status_unchanged = (oldStatus["last ${compaction_type} 
status"] == tabletStatus["last ${compaction_type} status"])
+                def compactionFailureNonFatal = !failure_time_unchanged &&
+                        ((!status_unchanged &&
+                                isNoopCompactionStatus(compaction_type, 
tabletStatus["last ${compaction_type} status"])) ||
+                                isIgnoredCompactionStatus(tabletStatus["last 
${compaction_type} status"]))
+                def baseFailureTimeChanged = 
handedOffToBaseCompactionAfterDeleteVersion &&
+                        oldStatus["last base failure time"] != 
tabletStatus["last base failure time"]
+                def baseFailureIgnored = baseFailureTimeChanged && 
isIgnoredCompactionStatus(tabletStatus["last base status"])
+                if (!running && !handedOffToBaseCompactionAfterDeleteVersion &&
+                        !completedByBaseCompactionAfterDeleteVersion &&
+                        success_time_unchanged && !failure_time_unchanged && 
!compactionFailureNonFatal) {
+                    throw new Exception("compaction failed, be host: 
${be_host}, tablet id: ${tablet.TabletId}, " +
+                            "run status: ${compactionStatus.run_status}, old 
status: ${oldStatus}, new status: ${tabletStatus}")
+                }
+                if (!running && handedOffToBaseCompactionAfterDeleteVersion &&
+                        !completedByBaseCompactionAfterDeleteVersion &&
+                        baseFailureTimeChanged && !baseFailureIgnored) {
+                    throw new Exception("base compaction failed after 
cumulative E-2010 handoff, be host: ${be_host}, " +
+                            "tablet id: ${tablet.TabletId}, run status: 
${compactionStatus.run_status}, " +
+                            "old status: ${oldStatus}, new status: 
${tabletStatus}")
+                }
                 def compactionFinished = 
completedByBaseCompactionAfterDeleteVersion ||
-                        (!handedOffToBaseCompactionAfterDeleteVersion && 
currentCompactionTimestampChanged)
+                        compactionFailureNonFatal || baseFailureIgnored ||
+                        (!handedOffToBaseCompactionAfterDeleteVersion && 
!success_time_unchanged)
                 running = running || !compactionFinished
                 if (running) {
                     logger.info("compaction is still running, be host: 
${be_host}, tablet id: ${tablet.TabletId}, run status: 
${compactionStatus.run_status}, old status: ${oldStatus}, new status: 
${tabletStatus}")
                     return false
                 }
             } else {
                 // time series compaction sometimes doesn't update compaction 
success time
-                // so we solely check run_status for it
+                // so we use run_status as the success signal, but still 
surface recorded failures.

Review Comment:
   This still leaves the existing `run_status` race as the success condition 
for time-series compaction. For shared-nothing BEs, the manual cumulative 
endpoint launches `_execute_compaction_callback` on a detached thread and 
returns success if it is not done after two seconds, while 
`/api/compaction/run_status` only checks whether the compaction lock is 
currently held. If the helper polls before that detached task acquires the 
cumulative lock, `run_status` is false, the fresh failure timestamp/status are 
unchanged, and this branch now returns success even though the requested 
compaction has not started. `test_time_series_compaction_policy.groovy` already 
avoids this exact race in its rowset-count helper comment, but the same suite 
still calls `trigger_and_wait_compaction(tableName, "cumulative")` for a 
time-series table. Please require an actual terminal signal for the requested 
time-series compaction, or keep polling while both success and failure evidence 
remain unchanged, instead 
 of accepting the first not-running status.



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