-
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
[docdb] PITR-YSQL: More robust test-cases #9502
Labels
area/docdb
YugabyteDB core features
kind/bug
This issue is a bug
priority/medium
Medium priority issue
Comments
We should also add unit tests validating standalone features of Postgres in the context of PITR like various types of ALTERS, Sequences, Triggers, Roles and Permissions, etc. |
sanketkedia
changed the title
[docdb] Test Case for verifying that cache is refreshed after restore
[docdb] PITR-YSQL: More robust test-cases
Oct 20, 2021
kripasreenivasan
added a commit
that referenced
this issue
Jan 14, 2022
Summary: Added Unit Tests in PITR for **Alter Table Add Primary Key** Added a test which does a point in time restore to a point before the alter table add primary key was executed. Post restore validations are done to check if the primary key addition is no longer there. **Alter Table Set Default** Added a test which does a point in time restore to a point before the alter table set default clause was executed. Post restore validations are done to check if the default setting is gone post the PITR. **Alter Table Add Unique Constraint** Added a test which does a point in time restore to a point before the alter table add unique constraint clause was executed. Post restore validations are done to check if the constraint is no longer there after the PITR. **Alter Table Drop Unique Constraint** Added a test which does a point in time restore to the point before dropping the unique constraint and verifies if the unique constraint drop is successfully restored. **Alter Table Drop Constraint** Added a test which does a point in time restore to a point before the alter table drop constraint was executed. Post restore validations are done to check if the constraint is available and if the drop constraint was successfully undone. **Alter Table Drop Default** Added a test which does a point in time restore to a point before the alter table drop default was executed. Post restore validations are done to check if the drop default is undone post PITR. **Alter Table Set Not null** Added a test which does a point in time restore to a point before the alter table set not null clause was executed. Post restore validations are done to check if the not null clause is removed from the column definition. **Alter Table Drop Not null** Added a test which does a point in time restore to a point before the alter table drop not null was executed. Post restore validations are done to check if the not null clause still exists on the column and if the drop is undone successfully via PITR. **Alter Table Add Foreign Key** Added a test which does a point in time restore to a point before the alter table drop add foreign key was executed. Post restore validations are done to check if the foreign key clause still exists on the column and if creation is undone successfully via PITR. **Alter Table Set Owner** Added a test which does a point in time restore to a point before the table ownership was set to a user. Post restore validations are done to check if the table does not belong to the user it was set to. **Alter Table Check Constraint** Added a test which does a point in time restore to a point before the table was altered to include a check constraint on a column. Post restore validations are done to assert that the column does not have the check constraint associated with it. Test Plan: ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlDropCheckConstraint ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlAddUniqueConstraint ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlDropUniqueConstraint ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlAlterTableAddPK ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlDropDefault ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlSetNotNull ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlSetDefault ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlDropNotNull ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlAlterTableSetOwner ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlAlterTableAddFK ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlAddCheckConstraint {F21041} {F21042} {F21043} {F21044} {F21045} {F21046} Reviewers: nmantravadi, bogdan, mkantimath, skedia Reviewed By: mkantimath, skedia Subscribers: ybase Differential Revision: https://phabricator.dev.yugabyte.com/D14400
Arjun-yb
added a commit
that referenced
this issue
Feb 17, 2022
Summary: Added PITR- Alter table unit tests for **Delete column**: Restores to the point before delete column and validates whether restore is done properly or not by selecting/inserting some rows from/to the table. **Rename table**: Restores to the point before rename table and validates whether restore is done properly or not by selecting/inserting some rows from/to the table. **Rename column**: Restores to the point before rename column and validates whether restore is done properly or not by selecting/inserting some rows from/to the table. **Add column**: Added some more validations and logging for Add column unit test Test Plan: We can test added unit tests with below commands, **Add column**: ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlAddColumn **Delete column**: ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlDeleteColumn **Rename table**: ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlRenameTable **Rename column**: ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlRenameColumn Reviewers: bogdan, nmantravadi, ksreenivasan, skedia Reviewed By: ksreenivasan, skedia Subscribers: ybase Differential Revision: https://phabricator.dev.yugabyte.com/D14406
Arjun-yb
added a commit
that referenced
this issue
Feb 17, 2022
Summary: Added Unit tests for Sequence Delete Sequence: Restores to the point before delete a row and validates whether restore is done properly or not by selecting/inserting some rows from/to the table. Insert Sequence: Restores to the point before insert row and validates whether restore is done properly or not by selecting/inserting some rows from/to the table. Test Plan: SequenceDelete - ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlSequenceDelete SequenceInsert ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlSequenceInsert Reviewers: nmantravadi, ksreenivasan, bogdan, skedia Reviewed By: skedia Subscribers: ybase Differential Revision: https://phabricator.dev.yugabyte.com/D14638
kripasreenivasan
added a commit
that referenced
this issue
Feb 22, 2022
Summary: Enabling 11 PITR unit test cases after the flakiness was fixed. Test Plan: ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlDropCheckConstraint ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlAddUniqueConstraint ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlDropUniqueConstraint ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlAlterTableAddPK ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlDropDefault ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlSetNotNull ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlSetDefault ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlDropNotNull ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlAlterTableSetOwner ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlAlterTableAddFK ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlAddCheckConstraint # Tip: Create a dependency between revisions by writing "Depends on D123" in # your summary. Reviewers: nmantravadi, bogdan, skedia, mkantimath Reviewed By: mkantimath Subscribers: ybase Differential Revision: https://phabricator.dev.yugabyte.com/D15443
jayant07-yb
pushed a commit
to jayant07-yb/yugabyte-db
that referenced
this issue
Mar 8, 2022
Summary: Added PITR- Alter table unit tests for **Delete column**: Restores to the point before delete column and validates whether restore is done properly or not by selecting/inserting some rows from/to the table. **Rename table**: Restores to the point before rename table and validates whether restore is done properly or not by selecting/inserting some rows from/to the table. **Rename column**: Restores to the point before rename column and validates whether restore is done properly or not by selecting/inserting some rows from/to the table. **Add column**: Added some more validations and logging for Add column unit test Test Plan: We can test added unit tests with below commands, **Add column**: ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlAddColumn **Delete column**: ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlDeleteColumn **Rename table**: ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlRenameTable **Rename column**: ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlRenameColumn Reviewers: bogdan, nmantravadi, ksreenivasan, skedia Reviewed By: ksreenivasan, skedia Subscribers: ybase Differential Revision: https://phabricator.dev.yugabyte.com/D14406
jayant07-yb
pushed a commit
to jayant07-yb/yugabyte-db
that referenced
this issue
Mar 8, 2022
Summary: Added Unit tests for Sequence Delete Sequence: Restores to the point before delete a row and validates whether restore is done properly or not by selecting/inserting some rows from/to the table. Insert Sequence: Restores to the point before insert row and validates whether restore is done properly or not by selecting/inserting some rows from/to the table. Test Plan: SequenceDelete - ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlSequenceDelete SequenceInsert ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlSequenceInsert Reviewers: nmantravadi, ksreenivasan, bogdan, skedia Reviewed By: skedia Subscribers: ybase Differential Revision: https://phabricator.dev.yugabyte.com/D14638
jayant07-yb
pushed a commit
to jayant07-yb/yugabyte-db
that referenced
this issue
Mar 8, 2022
Summary: Enabling 11 PITR unit test cases after the flakiness was fixed. Test Plan: ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlDropCheckConstraint ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlAddUniqueConstraint ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlDropUniqueConstraint ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlAlterTableAddPK ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlDropDefault ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlSetNotNull ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlSetDefault ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlDropNotNull ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlAlterTableSetOwner ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlAlterTableAddFK ./yb_build.sh --cxx-test yb-admin-snapshot-schedule-test --gtest_filter YbAdminSnapshotScheduleTest.PgsqlAddCheckConstraint # Tip: Create a dependency between revisions by writing "Depends on D123" in # your summary. Reviewers: nmantravadi, bogdan, skedia, mkantimath Reviewed By: mkantimath Subscribers: ybase Differential Revision: https://phabricator.dev.yugabyte.com/D15443
yugabyte-ci
added
kind/bug
This issue is a bug
priority/medium
Medium priority issue
labels
Jun 8, 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
Jira Link: DB-1632
For PITR for YSQL, we bump up the version number in the pg_yb_catalog_version table so that after restore, the relevant caches get refreshed. This has several side effects - one of which is that the client wouldn't have to reconnect with the database after restoration in order to get the latest changes. We don't have a test case for it yet and need to add an automated test. cc @spolitov @bmatican
The text was updated successfully, but these errors were encountered: