-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
lease: leases are not retained after IMPORT INTO #57834
Labels
A-schema-descriptors
Relating to SQL table/db descriptor handling.
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
Comments
ajwerner
added
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
A-schema-descriptors
Relating to SQL table/db descriptor handling.
labels
Dec 11, 2020
Andrew, what is the user-visible consequence of this issue? |
Is it that all queries need to query descriptor/namespace on these tables, for every query? |
Exactly. Unless the nodes is restarted. |
postamar
pushed a commit
to postamar/cockroach
that referenced
this issue
Jan 25, 2021
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
craig bot
pushed a commit
that referenced
this issue
Jan 27, 2021
59375: lease: fix lease retention bug for tables taken offline r=postamar a=postamar 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 Co-authored-by: Marius Posta <[email protected]>
postamar
pushed a commit
to postamar/cockroach
that referenced
this issue
Feb 25, 2021
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
postamar
pushed a commit
to postamar/cockroach
that referenced
this issue
Feb 25, 2021
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-schema-descriptors
Relating to SQL table/db descriptor handling.
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
Describe the problem
IMPORT INTO takes a table offline. When the lease manager notices that a table is offline, it marks the table as dropped. When the table comes back online the table, the dropped annotation is never removed. This leads to the lease always being dropped upon dereferencing.
To Reproduce
Run
IMPORT INTO
on a table and then try to interact with it. With vmodule logging you can see that the lease will get released upon dereference.Expected behavior
Leases would be retained once the table is back online.
Additional context
Restarting the nodes after the
IMPORT INTO
will resolve the problem as the invalid state is just in memory.The text was updated successfully, but these errors were encountered: