Skip to content

Commit

Permalink
fix(snapshot-backfill): fix incorrect recv barrier and add test for r…
Browse files Browse the repository at this point in the history
…ecover (#19756)
  • Loading branch information
wenym1 authored and wenym1 committed Dec 12, 2024
1 parent a310d4b commit 2d3b9ac
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 9 deletions.
16 changes: 16 additions & 0 deletions ci/scripts/run-backfill-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions e2e_test/backfill/snapshot_backfill/drop_mv.slt
Original file line number Diff line number Diff line change
@@ -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;
8 changes: 0 additions & 8 deletions e2e_test/backfill/snapshot_backfill/run_test.slt.part
Original file line number Diff line number Diff line change
Expand Up @@ -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;
1 change: 0 additions & 1 deletion src/stream/src/executor/backfill/snapshot_backfill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ impl<S: StateStore> SnapshotBackfillExecutor<S> {
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_recv_barrier);
(first_barrier.epoch, false)
Expand Down

0 comments on commit 2d3b9ac

Please sign in to comment.