Skip to content

Commit

Permalink
fix: workaround for cloud mode missing compaction success time
Browse files Browse the repository at this point in the history
  • Loading branch information
py023 committed Dec 24, 2024
1 parent a84fecf commit 4411cf2
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions regression-test/plugins/plugin_compaction.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,14 @@ Suite.metaClass.trigger_and_wait_compaction = { String table_name, String compac
// running is true means compaction is still running
running = compactionStatus.run_status

(exit_code, stdout, stderr) = be_show_tablet_status(be_host, be_port, tablet.TabletId)
assert exit_code == 0: "get tablet status failed, exit code: ${exit_code}, stdout: ${stdout}, stderr: ${stderr}"
def tabletStatus = parseJson(stdout.trim())
def oldStatus = be_tablet_compaction_status.get("${be_host}-${tablet.TabletId}")
// last compaction success time isn't updated, indicates compaction is not started(so we treat it as running and wait)
running = running || (oldStatus["last ${compaction_type} success time"] == tabletStatus["last ${compaction_type} success time"])
if (!isCloudMode()) { // cloud mode doesn't show compaction success time in tablet status for the time being
(exit_code, stdout, stderr) = be_show_tablet_status(be_host, be_port, tablet.TabletId)
assert exit_code == 0: "get tablet status failed, exit code: ${exit_code}, stdout: ${stdout}, stderr: ${stderr}"
def tabletStatus = parseJson(stdout.trim())
def oldStatus = be_tablet_compaction_status.get("${be_host}-${tablet.TabletId}")
// last compaction success time isn't updated, indicates compaction is not started(so we treat it as running and wait)
running = running || (oldStatus["last ${compaction_type} success time"] == tabletStatus["last ${compaction_type} success time"])
}
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
Expand Down

0 comments on commit 4411cf2

Please sign in to comment.