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

release-20.1: lease: fix lease retention bug for tables taken offline #61144

Merged
merged 1 commit into from
Feb 26, 2021

Conversation

postamar
Copy link
Contributor

Tables can temporarily be taken offline, either permanently or
temporarily. For example, executing a DROP TABLE statement will take
a table offline permanently, and an IMPORT INTO will take a table
offline only for the duration of the import and will bring it online
again afterward.

Previously, the lease manager would not distinguish between those two
cases and would behave as if the table was gone forever. As a result any
lease acquired after the table came back online would always be dropped
upon dereferencing. Although this behavior is valid, it is inefficient,
hence this patch.

Fixes #57834.

Release note: None

Tables can temporarily be taken offline, either permanently or
temporarily. For example, executing a DROP TABLE statement will take
a table offline permanently, and an IMPORT INTO will take a table
offline only for the duration of the import and will bring it online
again afterward.

Previously, the lease manager would not distinguish between those two
cases and would behave as if the table was gone forever. As a result any
lease acquired after the table came back online would always be dropped
upon dereferencing. Although this behavior is valid, it is inefficient,
hence this patch.

Fixes cockroachdb#57834.

Release note: None
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@postamar postamar requested a review from a team February 25, 2021 19:30
@postamar
Copy link
Contributor Author

Notice that this differs from #61140 in one important respect, in that the test is not included here, because it uses constructs that weren't around yet in 20.1. My understanding is that this change is low-risk enough & well-tested in more recent releases that this isn't a huge deal.

Copy link
Contributor

@ajwerner ajwerner left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 2 of 2 files at r1.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @postamar)

@postamar postamar merged commit c7f84c9 into cockroachdb:release-20.1 Feb 26, 2021
@postamar postamar deleted the backport20.1-59375 branch February 26, 2021 21:59
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.

3 participants