From 05d425b25276298fdc8d3c372a65e908488a013b Mon Sep 17 00:00:00 2001 From: Noel Kwan Date: Wed, 27 Sep 2023 18:02:51 +0800 Subject: [PATCH] fix and pass foreground mv cancellation tests --- ci/scripts/run-backfill-tests.sh | 6 +++--- .../background_ddl/foreground/create_mv_after_cancel.slt | 2 ++ e2e_test/background_ddl/foreground/drop.slt | 3 +++ src/meta/src/barrier/progress.rs | 2 -- 4 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 e2e_test/background_ddl/foreground/create_mv_after_cancel.slt diff --git a/ci/scripts/run-backfill-tests.sh b/ci/scripts/run-backfill-tests.sh index 1ba79d6c31aa..5f8d9ff84307 100755 --- a/ci/scripts/run-backfill-tests.sh +++ b/ci/scripts/run-backfill-tests.sh @@ -151,7 +151,7 @@ test_foreground_ddl_cancel() { cancel_stream_jobs sqllogictest -d dev -h localhost -p 4566 "$TEST_DIR/background_ddl/foreground/validate_after_cancel.slt" - run_sql "CREATE MATERIALIZED VIEW m1 as select * FROM t;" + sqllogictest -d dev -h localhost -p 4566 "$TEST_DIR/background_ddl/foreground/create_mv_after_cancel.slt" sqllogictest -d dev -h localhost -p 4566 "$TEST_DIR/background_ddl/foreground/drop.slt" cargo make kill @@ -187,9 +187,9 @@ main() { set -euo pipefail # test_snapshot_and_upstream_read # test_background_ddl_recovery - test_background_ddl_cancel + # test_background_ddl_cancel # test_foreground_ddl_no_recover - # test_foreground_ddl_cancel + test_foreground_ddl_cancel } main diff --git a/e2e_test/background_ddl/foreground/create_mv_after_cancel.slt b/e2e_test/background_ddl/foreground/create_mv_after_cancel.slt new file mode 100644 index 000000000000..de66eba5222d --- /dev/null +++ b/e2e_test/background_ddl/foreground/create_mv_after_cancel.slt @@ -0,0 +1,2 @@ +statement ok +CREATE MATERIALIZED VIEW m1 AS VALUES(1); \ No newline at end of file diff --git a/e2e_test/background_ddl/foreground/drop.slt b/e2e_test/background_ddl/foreground/drop.slt index 08b5401cd970..9ca990e33b0a 100644 --- a/e2e_test/background_ddl/foreground/drop.slt +++ b/e2e_test/background_ddl/foreground/drop.slt @@ -1,2 +1,5 @@ +statement ok +DROP MATERIALIZED VIEW m1; + statement ok DROP TABLE t; \ No newline at end of file diff --git a/src/meta/src/barrier/progress.rs b/src/meta/src/barrier/progress.rs index f641486aa3b0..6d88001da785 100644 --- a/src/meta/src/barrier/progress.rs +++ b/src/meta/src/barrier/progress.rs @@ -340,8 +340,6 @@ impl CreateMviewProgressTracker { return Some(command); } - let ddl_epoch = command.context.curr_epoch.value(); - let (creating_mv_id, upstream_mv_count, upstream_total_key_count, definition) = if let Command::CreateStreamingJob { table_fragments,