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: Add test for need to increase table version on restore #8543

Closed
bmatican opened this issue May 20, 2021 · 0 comments
Closed

[docdb] PITR: Add test for need to increase table version on restore #8543

bmatican opened this issue May 20, 2021 · 0 comments
Assignees
Labels
area/docdb YugabyteDB core features kind/failing-test Tests and testing infra

Comments

@bmatican
Copy link
Contributor

eg from ent/src/yb/master/restore_sys_catalog_state.cc

    // Force schema update after restoration.
    id_and_pb.second.set_version(it->second->LockForRead()->pb.version() + 1);
@bmatican bmatican added kind/failing-test Tests and testing infra area/docdb YugabyteDB core features labels May 20, 2021
@bmatican bmatican added this to Backlog in YBase features via automation May 20, 2021
@bmatican bmatican added this to To do in PITR via automation May 20, 2021
spolitov added a commit that referenced this issue May 24, 2021
Summary:
This diff adds that fails if we don't patch schema version on restore.
Consider the following scenario, w/o patching:
1) Create table. Schema version - 0.
2) Add text column to table. Schema version - 1.
3) Insert values into table. Each CQL proxy suppose schema version 1 for this table.
4) Restore to time between (1) and (2). Schema version - 0.
5) Add int column to table. Schema version - 1.
6) Try insert values with wrong type into table.

So table has schema version 1, but new column is INT.
CQL proxy suppose schema version is also 1, but the last column is TEXT.

If we patch schema version on restore and set it to last version + 1, then each CQL proxy will have to reload schema for this table.

Test Plan: ybd --gtest_filter YbAdminSnapshotScheduleTest.AlterTable

Reviewers: bogdan

Reviewed By: bogdan

Subscribers: ybase

Differential Revision: https://phabricator.dev.yugabyte.com/D11693
YBase features automation moved this from Backlog to Done May 25, 2021
PITR automation moved this from To do to Done May 25, 2021
YintongMa pushed a commit to YintongMa/yugabyte-db that referenced this issue May 26, 2021
…restore

Summary:
This diff adds that fails if we don't patch schema version on restore.
Consider the following scenario, w/o patching:
1) Create table. Schema version - 0.
2) Add text column to table. Schema version - 1.
3) Insert values into table. Each CQL proxy suppose schema version 1 for this table.
4) Restore to time between (1) and (2). Schema version - 0.
5) Add int column to table. Schema version - 1.
6) Try insert values with wrong type into table.

So table has schema version 1, but new column is INT.
CQL proxy suppose schema version is also 1, but the last column is TEXT.

If we patch schema version on restore and set it to last version + 1, then each CQL proxy will have to reload schema for this table.

Test Plan: ybd --gtest_filter YbAdminSnapshotScheduleTest.AlterTable

Reviewers: bogdan

Reviewed By: bogdan

Subscribers: ybase

Differential Revision: https://phabricator.dev.yugabyte.com/D11693
spolitov added a commit that referenced this issue Jun 15, 2021
…ersion on restore

Summary:
This diff adds that fails if we don't patch schema version on restore.
Consider the following scenario, w/o patching:
1) Create table. Schema version - 0.
2) Add text column to table. Schema version - 1.
3) Insert values into table. Each CQL proxy suppose schema version 1 for this table.
4) Restore to time between (1) and (2). Schema version - 0.
5) Add int column to table. Schema version - 1.
6) Try insert values with wrong type into table.

So table has schema version 1, but new column is INT.
CQL proxy suppose schema version is also 1, but the last column is TEXT.

If we patch schema version on restore and set it to last version + 1, then each CQL proxy will have to reload schema for this table.

Original diff: D11693/f2a2d0be68eb2f445d73fa8d94afc2bafe4642f7

Test Plan:
ybd --gtest_filter YbAdminSnapshotScheduleTest.AlterTable
Jenkins: rebase: 2.6

Reviewers: bogdan

Reviewed By: bogdan

Subscribers: ybase

Differential Revision: https://phabricator.dev.yugabyte.com/D11897
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/failing-test Tests and testing infra
Projects
PITR
Done
Development

No branches or pull requests

2 participants