Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(snapshot-backfill): fix incorrect recv barrier and add test for recover #19756

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading