From b864cf16466eaad16f3d909a6772d404f2ab6ab8 Mon Sep 17 00:00:00 2001 From: William Wen <44139337+wenym1@users.noreply.github.com> Date: Thu, 12 Dec 2024 14:22:02 +0800 Subject: [PATCH] fix(snapshot-backfill): fix incorrect recv barrier and add test for recover (#19756) --- ci/scripts/run-backfill-tests.sh | 16 ++++++++++++++++ e2e_test/backfill/snapshot_backfill/drop_mv.slt | 10 ++++++++++ .../backfill/snapshot_backfill/run_test.slt.part | 8 -------- .../src/executor/backfill/snapshot_backfill.rs | 1 - 4 files changed, 26 insertions(+), 9 deletions(-) create mode 100644 e2e_test/backfill/snapshot_backfill/drop_mv.slt diff --git a/ci/scripts/run-backfill-tests.sh b/ci/scripts/run-backfill-tests.sh index 917c67b6958a8..69c93cd34a17b 100755 --- a/ci/scripts/run-backfill-tests.sh +++ b/ci/scripts/run-backfill-tests.sh @@ -288,11 +288,27 @@ test_snapshot_backfill() { sqllogictest -p 4566 -d dev 'e2e_test/backfill/snapshot_backfill/create_nexmark_table.slt' + psql -h localhost -p 4566 -d dev -U root -c 'ALTER SYSTEM SET max_concurrent_creating_streaming_jobs TO 4;' + TEST_NAME=nexmark_q3 sqllogictest -p 4566 -d dev 'e2e_test/backfill/snapshot_backfill/nexmark/nexmark_q3.slt' & TEST_NAME=nexmark_q7 sqllogictest -p 4566 -d dev 'e2e_test/backfill/snapshot_backfill/nexmark/nexmark_q7.slt' & wait + psql -h localhost -p 4566 -d dev -U root -c 'RECOVER' + + sleep 3 + + TEST_NAME=nexmark_q3 sqllogictest -p 4566 -d dev 'e2e_test/backfill/snapshot_backfill/check_data_equal.slt.part' & + TEST_NAME=nexmark_q7 sqllogictest -p 4566 -d dev 'e2e_test/backfill/snapshot_backfill/check_data_equal.slt.part' & + + wait + + TEST_NAME=nexmark_q3 sqllogictest -p 4566 -d dev 'e2e_test/backfill/snapshot_backfill/drop_mv.slt' & + TEST_NAME=nexmark_q7 sqllogictest -p 4566 -d dev 'e2e_test/backfill/snapshot_backfill/drop_mv.slt' & + + wait + sqllogictest -p 4566 -d dev 'e2e_test/backfill/snapshot_backfill/drop_nexmark_table.slt' kill_cluster diff --git a/e2e_test/backfill/snapshot_backfill/drop_mv.slt b/e2e_test/backfill/snapshot_backfill/drop_mv.slt new file mode 100644 index 0000000000000..91e2e980983f6 --- /dev/null +++ b/e2e_test/backfill/snapshot_backfill/drop_mv.slt @@ -0,0 +1,10 @@ +control substitution on + +statement ok +drop materialized view ${TEST_NAME}_extended_mv; + +statement ok +drop materialized view ${TEST_NAME}_mv; + +statement ok +drop view ${TEST_NAME}_v; \ No newline at end of file diff --git a/e2e_test/backfill/snapshot_backfill/run_test.slt.part b/e2e_test/backfill/snapshot_backfill/run_test.slt.part index 339996f7668f5..07e1db39b4510 100644 --- a/e2e_test/backfill/snapshot_backfill/run_test.slt.part +++ b/e2e_test/backfill/snapshot_backfill/run_test.slt.part @@ -18,11 +18,3 @@ sleep 3s include ./check_data_equal.slt.part -statement ok -drop materialized view ${TEST_NAME}_extended_mv; - -statement ok -drop materialized view ${TEST_NAME}_mv; - -statement ok -drop view ${TEST_NAME}_v; \ No newline at end of file diff --git a/src/stream/src/executor/backfill/snapshot_backfill.rs b/src/stream/src/executor/backfill/snapshot_backfill.rs index 35adc33b81c4f..10e6c7756398c 100644 --- a/src/stream/src/executor/backfill/snapshot_backfill.rs +++ b/src/stream/src/executor/backfill/snapshot_backfill.rs @@ -252,7 +252,6 @@ impl SnapshotBackfillExecutor { table_id = self.upstream_table.table_id().table_id, "skip backfill" ); - let first_recv_barrier = receive_next_barrier(&mut self.barrier_rx).await?; assert_eq!(first_barrier.epoch, first_recv_barrier.epoch); yield Message::Barrier(first_barrier); }