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

[docdb] PITR-YSQL support for Sequences #10249

Closed
kripasreenivasan opened this issue Oct 11, 2021 · 2 comments
Closed

[docdb] PITR-YSQL support for Sequences #10249

kripasreenivasan opened this issue Oct 11, 2021 · 2 comments
Labels
area/docdb YugabyteDB core features kind/bug This issue is a bug priority/medium Medium priority issue

Comments

@kripasreenivasan
Copy link
Contributor

kripasreenivasan commented Oct 11, 2021

Jira Link: DB-635
As of today, Sequences don't work with PITR - If we drop a sequence on a column and then restore to a time before the drop, the sequence isn't restored properly.

@kripasreenivasan kripasreenivasan changed the title PITR support for YSQL features PITR support for Triggers, Sequences, Row Level Security Oct 11, 2021
@kripasreenivasan kripasreenivasan changed the title PITR support for Triggers, Sequences, Row Level Security PITR support for Triggers, Sequences, Row Level Security, Tablespaces Oct 12, 2021
@bmatican bmatican added the area/docdb YugabyteDB core features label Oct 16, 2021
@sanketkedia sanketkedia changed the title PITR support for Triggers, Sequences, Row Level Security, Tablespaces [docdb] PITR-YSQL support for Sequences Oct 19, 2021
@sanketkedia
Copy link
Contributor

sanketkedia commented Dec 8, 2021

Did some testing on where we stand currently wrt Sequences:

  • If you restore to a state before the sequence table was created/dropped then it doesn't work. PG Catalog metadata changes seem to be in order so I am guessing that it is because of the extra things that we do for supporting sequences (that Postgres doesn't).
  • If you just restore rows of a table containing SERIAL columns and/or other columns linked to a sequence then it works.

sanketkedia added a commit that referenced this issue May 18, 2022
Summary:
Currently, restoring DDLs on sequences is not supported. For e.g., if we drop a sequence and then
try to undo it via a restore then it doesn't work. It is because apart from restoring the system
catalog entries, we also need to restore the `sequences_data` table whose tablets reside on tservers
in a separate `system_postgres` database.

This diff enables PITR support for sequences. We should now be able to undo DDLs on sequences.

Test Plan:
ybd --cxx_test yb-admin-snapshot-schedule-test --gtest-filter YbAdminSnapshotScheduleTest.PgsqlSequenceVerifyPartialRestore
ybd --cxx_test yb-admin-snapshot-schedule-test --gtest-filter YbAdminSnapshotScheduleTest.PgsqlSequenceUndoDropSequence
ybd --cxx_test yb-admin-snapshot-schedule-test --gtest-filter YbAdminSnapshotScheduleTest.PgsqlSequenceUndoCreateSequence

Reviewers: bogdan, slingam, sergei

Reviewed By: sergei

Subscribers: ybase

Differential Revision: https://phabricator.dev.yugabyte.com/D16385
@kripasreenivasan
Copy link
Contributor Author

This has been fixed now.

@yugabyte-ci yugabyte-ci added kind/bug This issue is a bug priority/medium Medium priority issue labels Jun 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docdb YugabyteDB core features kind/bug This issue is a bug priority/medium Medium priority issue
Projects
None yet
Development

No branches or pull requests

4 participants