Skip to content

Commit

Permalink
[fix](case) Fix test_backup_restore_atomic_with_alter with SYNC (apac…
Browse files Browse the repository at this point in the history
…he#43601)

### What problem does this PR solve?

Execute SYNC command before executing any SELECT/SHOW commands, to avoid
staled read
  • Loading branch information
w41ter authored Nov 11, 2024
1 parent 345176b commit 88a6268
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ suite("test_backup_restore_atomic_with_alter", "backup_restore") {
"atomic_restore" = "true"
)
"""
sql "SYNC"

boolean restore_paused = false
for (int k = 0; k < 60; k++) {
Expand All @@ -121,6 +122,8 @@ suite("test_backup_restore_atomic_with_alter", "backup_restore") {
}
assertTrue(restore_paused)

sql "SYNC"

// 0. table_1 has in_atomic_restore property
def show_result = sql """ SHOW CREATE TABLE ${dbName}.${tableNamePrefix}_1 """
logger.info("SHOW CREATE TABLE ${tableNamePrefix}_1: ${show_result}")
Expand Down Expand Up @@ -224,6 +227,7 @@ suite("test_backup_restore_atomic_with_alter", "backup_restore") {


sql "CANCEL RESTORE FROM ${dbName}"
sql "SYNC"

// 5. The restore job is cancelled, the in_atomic_restore property has been removed.
show_result = sql """ SHOW CREATE TABLE ${dbName}.${tableNamePrefix}_1 """
Expand Down

0 comments on commit 88a6268

Please sign in to comment.