From 88a62680f41378906bd0ae360271d88fb483e01e Mon Sep 17 00:00:00 2001 From: walter Date: Mon, 11 Nov 2024 22:54:50 +0800 Subject: [PATCH] [fix](case) Fix test_backup_restore_atomic_with_alter with SYNC (#43601) ### What problem does this PR solve? Execute SYNC command before executing any SELECT/SHOW commands, to avoid staled read --- .../test_backup_restore_atomic_with_alter.groovy | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/regression-test/suites/backup_restore/test_backup_restore_atomic_with_alter.groovy b/regression-test/suites/backup_restore/test_backup_restore_atomic_with_alter.groovy index b66ff391f1501f..8974b87c09a82b 100644 --- a/regression-test/suites/backup_restore/test_backup_restore_atomic_with_alter.groovy +++ b/regression-test/suites/backup_restore/test_backup_restore_atomic_with_alter.groovy @@ -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++) { @@ -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}") @@ -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 """