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

importccl: remove protected timestamp from IMPORT INTO #68043

Merged
merged 2 commits into from
Jul 28, 2021

Conversation

adityamaru
Copy link
Contributor

Previously, IMPORT INTO would lay a protected timestamp
on the table span of the table being imported into.
This would prevent all keys in this span from being GC'ed
during IMPORT execution.

IMPORT INTO however does not allow ingesting keys that
shadow already existing keys. Additionally, during the
IMPORT the table is taken offline and so it does not serve
any online traffic. These two properties of IMPORT INTO
ensure that the old keys (not ingested during IMPORT) will
never become gc'eable during the IMPORT job. Thus, writing
a protected timestamp was redundant.

If the IMPORT job fails we issue a RevertRange to revert
all the newly ingested keys. This RevertRange could
attempt to revert to a time below the GC threshold but
following #61004 this is alright for the same reason
explained above.

Fixes: #67924

IMPORT INTO no longer relies on protected timestamps and
so it can be run within a tenant.

@adityamaru adityamaru requested review from a team, pbardea and dt and removed request for a team July 25, 2021 23:19
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@@ -1940,18 +1891,6 @@ func (r *importResumer) Resume(ctx context.Context, execCtx interface{}) error {
details := r.job.Details().(jobspb.ImportDetails)
files := details.URIs
format := details.Format
ptsID := details.ProtectedTimestampRecord
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to keep the cleanup around to free protections reserved by jobs on older binaries?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch, readded the release logic. The helper we use to release has a nil check for details.ProtectedTimestampRecord, so for a 21.2 node this will just be a noop.

Previously, IMPORT INTO would lay a protected timestamp
on the table span of the table being imported into.
This would prevent all keys in this span from being GC'ed
during IMPORT execution.

IMPORT INTO however does not allow ingesting keys that
shadow already existing keys. Additionally, during the
IMPORT the table is taken offline and so it does not serve
any online traffic. These two properties of IMPORT INTO
ensure that the old keys (not ingested during IMPORT) will
never become gc'eable during the IMPORT job. Thus, writing
a protected timestamp was redundant.

If the IMPORT job fails we issue a RevertRange to revert
all the newly ingested keys. This RevertRange could
attempt to revert to a time below the GC threshold but
following cockroachdb#61004 this is alright for the same reason
explained above.

Fixes: cockroachdb#67924

Release note: None
IMPORT INTO no longer relies on protected timestamps and
so it can be run within a tenant.

Release note: None
@adityamaru adityamaru force-pushed the remove-protected-ts-from-import branch from 9b68682 to 9ee5229 Compare July 26, 2021 18:52
@adityamaru adityamaru requested a review from pbardea July 26, 2021 18:54
@adityamaru
Copy link
Contributor Author

TFTR!

bors r=pbardea

@craig
Copy link
Contributor

craig bot commented Jul 28, 2021

Build succeeded:

@craig craig bot merged commit f5a630c into cockroachdb:master Jul 28, 2021
@adityamaru adityamaru deleted the remove-protected-ts-from-import branch July 28, 2021 15:00
rmloveland added a commit to cockroachdb/docs that referenced this pull request Mar 13, 2023
rmloveland added a commit to cockroachdb/docs that referenced this pull request Apr 13, 2023
mdlinville pushed a commit to cockroachdb/docs that referenced this pull request Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

import: remove timestamp protections
3 participants