Skip to content

Commit

Permalink
fix: add wait compaction timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
py023 committed Dec 24, 2024
1 parent 217bcde commit 84022f3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions regression-test/plugins/plugin_curl_requester.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ Suite.metaClass.check_nested_index_file = { ip, port, tablet_id, expected_rowset

logger.info("Added 'check_nested_index_file' function to Suite")

Suite.metaClass.trigger_and_wait_compaction = { String table_name, String compaction_type ->
Suite.metaClass.trigger_and_wait_compaction = { String table_name, String compaction_type, int timeout_seconds=300 ->
if (!(compaction_type in ["cumulative", "base", "full"])) {
throw new IllegalArgumentException("invalid compaction type: ${compaction_type}, supported types: cumulative, base, full")
}
Expand Down Expand Up @@ -358,7 +358,8 @@ Suite.metaClass.trigger_and_wait_compaction = { String table_name, String compac

// 3. wait all compaction finished
def running = triggered_tablets.size() > 0
while (running) {
def deadline = System.currentTimeMillis() + timeout_seconds * 1000
while (running && System.currentTimeMillis() < deadline) {
Thread.sleep(500)
for (tablet in triggered_tablets) {
def be_host = backendId_to_backendIP["${tablet.BackendId}"]
Expand All @@ -382,4 +383,6 @@ Suite.metaClass.trigger_and_wait_compaction = { String table_name, String compac
}
}
}

assert !running: "wait compaction timeout, be host: ${be_host}"
}

0 comments on commit 84022f3

Please sign in to comment.