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

backupccl: add TestOnlineRestoreS3 and TestOnlineRestoreBasic tests #114279

Merged
merged 4 commits into from
Nov 13, 2023

Conversation

msbutler
Copy link
Collaborator

This patch adds TestOnlineRestoreS3 to our cloud unit test suite. To run locally, run:

./dev test pkg/ccl/backupccl -f TestOnlineRestoreS3 -- --test_env=AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID --test_env=AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY --test_env=AWS_S3_BUCKET=cockroachdb-backup-cloud-nightly --test_env=COCKROACH_UNSAFE_RESTORE=true

This patch also adds TestOnlineRestoreBasic which runs online restore through
nodelocal. To run locally, run:

./dev test pkg/ccl/backupccl -f TestOnlineRestoreBasic -- --test_env=COCKROACH_UNSAFE_RESTORE=true

Both tests will be skipped in the nightlies until we pass
COCKROACH_UNSAFE_RESTORE to their setup.

Epic: none

Release note: none

Previously, if sendAddRemoteSSTs would return an error, the online restore
would hang because the coordinator did not close the tracingAggregator channel.
This patch fixes this.

Epic: none

Release note: none
@msbutler msbutler requested review from dt and itsbilal November 10, 2023 23:40
@msbutler msbutler self-assigned this Nov 10, 2023
@msbutler msbutler requested review from a team as code owners November 10, 2023 23:40
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@msbutler

This comment was marked as outdated.

@msbutler msbutler force-pushed the butler-online-restore-unit branch from d4c36f8 to 8661371 Compare November 10, 2023 23:47
@msbutler msbutler requested a review from a team November 11, 2023 00:07
…pply

This hack allows online restore to succeed. In the long run, I guess we'll need
to know if the external sst has point or range keys in the provided span.

Epic: none

Release note: none
@msbutler msbutler force-pushed the butler-online-restore-unit branch 2 times, most recently from aae055b to ddf6c07 Compare November 11, 2023 00:56
This patch adds TestOnlineRestoreS3 to our cloud unit test suite. To run locally, run:
```
./dev test pkg/ccl/backupccl -f TestOnlineRestoreS3 -- --test_env=AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID --test_env=AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY --test_env=AWS_S3_BUCKET=cockroachdb-backup-cloud-nightly --test_env=COCKROACH_UNSAFE_RESTORE=true
```

This patch also adds TestOnlineRestoreBasic which runs online restore through
nodelocal. To run locally, run:
```
./dev test pkg/ccl/backupccl -f TestOnlineRestoreBasic -- --test_env=COCKROACH_UNSAFE_RESTORE=true
```

Both tests will be skipped in the nightlies until we pass
COCKROACH_UNSAFE_RESTORE to their setup.

Epic: none

Release note: none
This patch removes the COCKROACH_UNSAFE_RESTORE env var which gates online
restore. The gate no longer seems necesssary as all development will
occur on master for the next few months. In addition, the env var makes it
slightly annoying to test online restore.

Epic: None

Release note: None
@msbutler msbutler force-pushed the butler-online-restore-unit branch from 06ac99b to 49e8cd4 Compare November 13, 2023 00:52
@@ -655,6 +655,10 @@ func addSSTablePreApply(
Size: sst.BackingFileSize,
SmallestUserKey: start.Encode(),
LargestUserKey: end.Encode(),

// TODO(msbutler): I guess we need to figure out if the backing external
Copy link
Collaborator Author

@msbutler msbutler Nov 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@itsbilal Given the preso this morning, I guess I should reword this comment to: "we set this true even if the virtual SST's span covers no point keys in the remote sst, to avoid a pebble level panic during ingestion. At download time, if the backing file has no actual keys in the span, the virtual sst will be compacted away and no keys will download."

@msbutler
Copy link
Collaborator Author

TFTR!

bors r=dt

Copy link
Member

@itsbilal itsbilal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Storage side LGTM


// TODO(msbutler): I guess we need to figure out if the backing external
// file has point or range keys in the target span.
HasPointKey: true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not possible to have range keys in backup SSTs at the moment right? So this might be sufficient and good enough for us.

@@ -802,6 +802,7 @@ func (cfg *Config) CreateEngines(ctx context.Context) (Engines, error) {
}
addCfgOpt(storage.MaxSize(sizeInBytes))
addCfgOpt(storage.CacheSize(cfg.CacheSize))
addCfgOpt(storage.RemoteStorageFactory(cfg.ExternalStorageAccessor))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I imagine this is test-only code seeing as it's under InMem, while for regular engines we already pass this cfg down below.

@craig
Copy link
Contributor

craig bot commented Nov 13, 2023

Build succeeded:

@craig craig bot merged commit ec57ed0 into cockroachdb:master Nov 13, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants