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

[YSQL] Major version upgrade causes duplicate index build #24727

Open
1 task done
fizaaluthra opened this issue Oct 30, 2024 · 0 comments
Open
1 task done

[YSQL] Major version upgrade causes duplicate index build #24727

fizaaluthra opened this issue Oct 30, 2024 · 0 comments
Assignees
Labels
area/ysql Yugabyte SQL (YSQL) kind/bug This issue is a bug priority/medium Medium priority issue

Comments

@fizaaluthra
Copy link
Member

fizaaluthra commented Oct 30, 2024

Jira Link: DB-13806

Description

Example:

CREATE TABLE x (t int) SPLIT INTO 1 TABLETS;
INSERT INTO x VALUES (1), (2), (3), (4);
CREATE INDEX ON x(t) SPLIT INTO 1 TABLETS;

After performing major version upgrade, the SST dump for the index shows duplicate entries:

Sst file format: block-based
SubDocKey(DocKey(0x1210, [1], [EncodedSubDocKey(DocKey(0xd73c, ["\x99\x88\xf1\xd2\xbfRB\x96\xb8\xaej\x90A\xd7\xcc\xe6"], []), [])]), [HT{ physical: 1730298676532160 w: 3 }]) -> { }
SubDocKey(DocKey(0x1210, [1], [EncodedSubDocKey(DocKey(0xd73c, ["\x99\x88\xf1\xd2\xbfRB\x96\xb8\xaej\x90A\xd7\xcc\xe6"], []), [])]), [HT{ physical: 1730298626644159 w: 3 }]) -> { }
SubDocKey(DocKey(0x9eaf, [4], [EncodedSubDocKey(DocKey(0xd15c, ["\x9c\xb7\xcbi\xd1@G\xb0\xb9\xe0\xc6S\x1eQe\xaf"], []), [])]), [HT{ physical: 1730298676532160 w: 2 }]) -> { }
SubDocKey(DocKey(0x9eaf, [4], [EncodedSubDocKey(DocKey(0xd15c, ["\x9c\xb7\xcbi\xd1@G\xb0\xb9\xe0\xc6S\x1eQe\xaf"], []), [])]), [HT{ physical: 1730298626644159 w: 2 }]) -> { }
SubDocKey(DocKey(0xc0c4, [2], [EncodedSubDocKey(DocKey(0x4698, ["\x9a\xe0\x19\x12@\xad@\xb8\x80\xc2\xc6\xa6j\xae\xeeK"], []), [])]), [HT{ physical: 1730298676532160 w: 1 }]) -> { }
SubDocKey(DocKey(0xc0c4, [2], [EncodedSubDocKey(DocKey(0x4698, ["\x9a\xe0\x19\x12@\xad@\xb8\x80\xc2\xc6\xa6j\xae\xeeK"], []), [])]), [HT{ physical: 1730298626644159 w: 1 }]) -> { }
SubDocKey(DocKey(0xfca0, [3], [EncodedSubDocKey(DocKey(0x1551, ["\xb8!aC\x15\xccL\x93\xb2.\x03\xd5\x1b\x01xk"], []), [])]), [HT{ physical: 1730298676532160 }]) -> { }
SubDocKey(DocKey(0xfca0, [3], [EncodedSubDocKey(DocKey(0x1551, ["\xb8!aC\x15\xccL\x93\xb2.\x03\xd5\x1b\x01xk"], []), [])]), [HT{ physical: 1730298626644159 }]) -> { }

Major version upgrade also fails for unique indexes (with data) due to the duplicate build:
i.e., if you have

CREATE TABLE x (t int) SPLIT INTO 1 TABLETS;
INSERT INTO x VALUES (1), (2), (3), (4);
CREATE UNIQUE INDEX ON x(t) SPLIT INTO 1 TABLETS;

upgrade fails with:

pg_restore: from TOC entry 2799; 1259 16387 INDEX x_t_idx yugabyte
pg_restore: error: could not execute query: ERROR:  duplicate key value violates unique constraint "x_t_idx"

Issue Type

kind/bug

Warning: Please confirm that this issue does not contain any sensitive information

  • I confirm this issue does not contain any sensitive information.
@fizaaluthra fizaaluthra added area/ysql Yugabyte SQL (YSQL) status/awaiting-triage Issue awaiting triage labels Oct 30, 2024
@fizaaluthra fizaaluthra self-assigned this Oct 30, 2024
@yugabyte-ci yugabyte-ci added kind/bug This issue is a bug priority/medium Medium priority issue labels Oct 30, 2024
@sushantrmishra sushantrmishra removed the status/awaiting-triage Issue awaiting triage label Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ysql Yugabyte SQL (YSQL) kind/bug This issue is a bug priority/medium Medium priority issue
Projects
None yet
Development

No branches or pull requests

3 participants