You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[BACKPORT 2024.2][#25929] Docdb: Disable catalog version check when reading sequences as of time
Summary:
Original commit: 7fc910d / D41911
Currently, clone is failing when the database has a sequence, and the time we are cloning to is a time before a DDL that increments the last_breaking_version of the source database. Clone is failing in ysql_dump phase when executing the following query to get the sequence data: `SELECT last_value, is_called FROM public.seq_name`. The error is:
`ERROR: The catalog snapshot used for this transaction has been invalidated: expected: 2, got: 1: MISMATCHED_SCHEMA`.
Generally, ysql_dump sets the GUC `yb_disable_catalog_version_check` to true, which should not set the catalog version in all the read requests that ysql_dump is issuing, and thus no catalog version check is performed.
However, as sequences have their own read path, the GUC `yb_disable_catalog_version_check` is not taking effect, and the catalog version check is returning a catalog version mismatch.
Fixed by extending the role of `yb_disable_catalog_version_check` to cover the sequences' read path. When set to true, we don't send the catalog version with the read request to the tserver and thus disable the catalog version check for such a sequence read query. This allows ysql_dump to read the sequence as of a time regardless of the catalog version at that time and thus, being able to clone sequences to a time before a DDL happened.
Jira: DB-15245
Test Plan: ./yb_build.sh --cxx-test integration-tests_minicluster-snapshot-test --gtest_filter Colocation/PgCloneTestWithColocatedDBParam.CloneWithSequencesAndDdl/0
Reviewers: asrivastava
Reviewed By: asrivastava
Subscribers: slingam, yql, ybase
Differential Revision: https://phorge.dev.yugabyte.com/D42696
0 commit comments