-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BACKPORT 2024.1][#22935] YSQL: Use db oid in the tserver's sequence …
…cache entry key Summary: Original commit: 214d44a / D36182 Since the tserver's sequence cache was introduced, the entry key was the sequence's oid. However, it is not unique, each database has its own oid generator, and each new database starts its oids from 16384, hence high probability of collision in the sequence cache, which is one instance per node and shared between all the databases. Solution is to use both database oid and sequence oid as the entry key. Database oid is unique between all databases within the cluster, and the oids of the sequences are unique within the database. Initially the bug was discovered when a database was dropped and recreated, because the cache entries are not invalidated when sequence is dropped. We may want to add invalidation logic, however, the problem isn't critical with composite key: oids of dropped databases and other objects are not recycled. Jira: DB-11851 Test Plan: ./yb_build.sh --java-test org.yb.pgsql.TestPgSequences#testMultiDbIsolation ./yb_build.sh --java-test org.yb.pgsql.TestPgSequencesWithServerCache#testMultiDbIsolation Reviewers: jason Reviewed By: jason Subscribers: yql, ybase Tags: #jenkins-ready Differential Revision: https://phorge.dev.yugabyte.com/D36214
- Loading branch information
1 parent
860283d
commit 8f4d569
Showing
4 changed files
with
78 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters