forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
streamingccl: allow CUTOVER TO LATEST before initial scan finishes
This patch allows the user to execute ALTER TENANT x COMPLETE REPLICATION TO LATEST before the initial scan completes. After this cmd, the cutover time is set to the replicated start time. Fixes: cockroachdb#114734 Epic: none
- Loading branch information
Showing
3 changed files
with
35 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
pkg/ccl/streamingccl/streamingest/testdata/add_early_cutover
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# This test ensures 1) the user can set a cutover before the initial scan completes; 2) cannot set a | ||
# cutover time before the replicatedStartTime. | ||
|
||
create-replication-clusters | ||
---- | ||
|
||
exec-sql as=destination-system | ||
SET CLUSTER SETTING jobs.debug.pausepoints = 'stream_ingestion.before_ingestion'; | ||
---- | ||
|
||
let $pre as=source-system | ||
SELECT clock_timestamp()::timestamp::string | ||
---- | ||
|
||
start-replication-stream | ||
---- | ||
|
||
job as=destination-system wait-for-state=paused | ||
---- | ||
|
||
query-sql as=destination-system regex-error=(.*before earliest safe cutover.*) | ||
ALTER TENANT "destination" COMPLETE REPLICATION TO SYSTEM TIME '$pre' | ||
---- | ||
|
||
exec-sql as=destination-system | ||
ALTER TENANT "destination" COMPLETE REPLICATION TO LATEST | ||
---- | ||
|