-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[YSQL][Colocation] TRUNCATE TABLE breaks index consistency #10912
Projects
Comments
Closed
lnguyen-yugabyte
added a commit
that referenced
this issue
Jan 18, 2022
…with the table Summary: We fix the issue that, on a colocated table with a primary / unique index, one sends a TRUNCATE TABLE request, which deletes the table's content. However, the corresponding indexes are not truncated, resulting to subsequent inserts failing due to duplicate key. The fix is to send truncate colocated requests for the indexes associated with the table. The previous implementation has a typo which didn't truncate the indexes. Test Plan: Unit tests added for SQL test and java test. Reviewers: rskannan, smishra, jason Reviewed By: jason Subscribers: smishra, rskannan, jason, lnguyen, yql Differential Revision: https://phabricator.dev.yugabyte.com/D14761
lnguyen-yugabyte
added a commit
that referenced
this issue
Jan 20, 2022
Summary: For some reasons the previous diff (https://phabricator.dev.yugabyte.com/D14761) has a redundant line in the ysql_colocation_test. We remove that extra line in this diff. Test Plan: check jenkin builds https://detective.dev.yugabyte.com/D14896.html Reviewers: jason Reviewed By: jason Subscribers: yql Differential Revision: https://phabricator.dev.yugabyte.com/D14896
lnguyen-yugabyte
added a commit
that referenced
this issue
Jan 21, 2022
… indexes associated with the table Summary: We fix the issue that, on a colocated table with a primary / unique index, one sends a TRUNCATE TABLE request, which deletes the table's content. However, the corresponding indexes are not truncated, resulting to subsequent inserts failing due to duplicate key. The fix is to send truncate colocated requests for the indexes associated with the table. The previous implementation has a typo which didn't truncate the indexes. Original commits / diffs: ae984b6 / D14761 74158cb / D14896 Test Plan: Unit tests added for SQL test and java test. Reviewers: rskannan, smishra, jason Reviewed By: jason Subscribers: yql, lnguyen, jason, rskannan, smishra Differential Revision: https://phabricator.dev.yugabyte.com/D14900
lnguyen-yugabyte
added a commit
that referenced
this issue
Jan 21, 2022
… indexes associated with the table Summary: UPDATE for 2.6: we fix the merge conflicts. We fix the issue that, on a colocated table with a primary / unique index, one sends a TRUNCATE TABLE request, which deletes the table's content. However, the corresponding indexes are not truncated, resulting to subsequent inserts failing due to duplicate key. The fix is to send truncate colocated requests for the indexes associated with the table. The previous implementation has a typo which didn't truncate the indexes. Original commits / diffs: ae984b6 / D14761 74158cb / D14896 Test Plan: Unit tests added for SQL test and java test. Reviewers: rskannan, smishra, jason Reviewed By: jason Subscribers: yql, lnguyen, jason, rskannan, smishra Differential Revision: https://phabricator.dev.yugabyte.com/D14904
@lnguyen-yugabyte |
lnguyen-yugabyte
added a commit
that referenced
this issue
Feb 1, 2022
…xes associated with the table Summary: We fix the issue that, on a colocated table with a primary / unique index, one sends a TRUNCATE TABLE request, which deletes the table's content. However, the corresponding indexes are not truncated, resulting to subsequent inserts failing due to duplicate key. The fix is to send truncate colocated requests for the indexes associated with the table. The previous implementation has a typo which didn't truncate the indexes. Original commits / diffs: ae984b6 / D14761 74158cb / D14896 Test Plan: Unit tests added for SQL test and java test. Reviewers: rskannan, smishra, jason Reviewed By: jason Subscribers: yql, lnguyen, jason, rskannan, smishra Differential Revision: https://phabricator.dev.yugabyte.com/D15181
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
When using colocated database and tablegroup, TRUNCATE TABLE seem to only truncate the table, leaving index content intact.
Examples:
With colocated database:
With tablegroup:
The text was updated successfully, but these errors were encountered: