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.
backupccl: issue protected timestamps on restore spans
Fixes cockroachdb#91148 Release note: None
- Loading branch information
Showing
11 changed files
with
240 additions
and
17 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
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
64 changes: 64 additions & 0 deletions
64
pkg/ccl/backupccl/testdata/backup-restore/restore-protect-spans
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,64 @@ | ||
|
||
# tickle the unprotected timestamp bug | ||
new-server name=s1 disable-tenant | ||
---- | ||
|
||
exec-sql | ||
CREATE DATABASE d; | ||
USE d; | ||
CREATE TABLE foo (i INT PRIMARY KEY, s STRING); | ||
INSERT INTO foo VALUES (1, 'x'),(2,'y'); | ||
---- | ||
|
||
exec-sql | ||
BACKUP INTO 'nodelocal://1/full_cluster_backup/'; | ||
---- | ||
|
||
|
||
exec-sql | ||
SET CLUSTER SETTING bulkio.ingest.flush_delay='20s'; | ||
---- | ||
|
||
exec-sql | ||
SET CLUSTER SETTING spanconfig.reconciliation_job.check_interval='1s'; | ||
---- | ||
|
||
exec-sql | ||
SET CLUSTER SETTING kv.closed_timestamp.target_duration = '100ms'; | ||
---- | ||
|
||
exec-sql | ||
ALTER DATABASE defaultdb CONFIGURE ZONE USING gc.ttlseconds = 1; | ||
---- | ||
|
||
# ensure the gc threshold forwards quickly | ||
exec-sql | ||
SET CLUSTER SETTING kv.protectedts.poll_interval = '1s' | ||
---- | ||
|
||
exec-sql | ||
SET CLUSTER SETTING jobs.debug.pausepoints = 'restore.before_flow'; | ||
---- | ||
|
||
|
||
restore expect-pausepoint tag=a | ||
RESTORE TABLE foo FROM LATEST IN 'nodelocal://1/full_cluster_backup/' WITH into_db='defaultdb'; | ||
---- | ||
job paused at pausepoint | ||
|
||
# ensure foo has adopted the ttl | ||
sleep ms=5000 | ||
---- | ||
|
||
exec-sql | ||
SET CLUSTER SETTING jobs.debug.pausepoints = ''; | ||
---- | ||
|
||
job resume=a | ||
---- | ||
|
||
# If this test worked, the job should fail. but currently it succeeds. | ||
job tag=a wait-for-state=failed | ||
---- | ||
|
||
|
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
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
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
Oops, something went wrong.