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] yb_get_range_split_clause failed to decode GinNull in GIN Index partition bounds #22356

Open
1 task done
yifanguan opened this issue May 10, 2024 · 0 comments
Open
1 task done
Assignees
Labels
2.20.4_blocker 2.20.4.0_blocker area/ysql Yugabyte SQL (YSQL) kind/bug This issue is a bug priority/medium Medium priority issue

Comments

@yifanguan
Copy link
Contributor

yifanguan commented May 10, 2024

Jira Link: DB-11260

Description

yb_get_range_split_clause failed to decode GinNull in GIN Index partition bounds.
It is used by ysql_dump to generate YSQL table and index SPLIT AT clause during backup.

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.
@yifanguan yifanguan added area/ysql Yugabyte SQL (YSQL) status/awaiting-triage Issue awaiting triage labels May 10, 2024
@yugabyte-ci yugabyte-ci added kind/bug This issue is a bug priority/medium Medium priority issue labels May 10, 2024
yifanguan added a commit that referenced this issue May 14, 2024
…CH block

Summary:
`yb_get_range_split_clause` is used by `ysql_dump` to generate YSQL table and index SPLIT AT VALUES clause for multi-tablet range-partitioned relation during backup.
It fails to decode `GinNull` in GIN Index partition bounds.
With the change in this diff, `yb_get_range_split_clause` checks for the existence of `GinNull` in partition bounds. If `GinNull` exists in partition bounds,
an empty string is returned by `yb_get_range_split_clause`.
Also, there might be other unknown cases where partition bounds decoding can fail, which blocks YB backup.
Thus, protect the decoding in `yb_get_range_split_clause` with PG TRY CATCH block in case of decoding failure for the sake of YB backup.
If decoding fails, a warning is thrown and an empty string is returned by `yb_get_range_split_clause`.
Each time `yb_get_range_split_clause` returns an empty string for a multi-tablet range relation, during restore, the relation is repartitioned with correct partition boundaries.
Jira: DB-11260

Test Plan: ./yb_build.sh --cxx-test yb-backup-cross-feature-test --gtest_filter YBBackupTest.TestYSQLTabletSplitGINIndexWithGinNullInPartitionBounds

Reviewers: jason, mihnea

Reviewed By: jason

Subscribers: fizaa, ybase, yql

Tags: #jenkins-ready

Differential Revision: https://phorge.dev.yugabyte.com/D34965
@yugabyte-ci yugabyte-ci removed the status/awaiting-triage Issue awaiting triage label May 14, 2024
yifanguan added a commit that referenced this issue May 14, 2024
… using PG TRY CATCH block

Summary:
`yb_get_range_split_clause` is used by `ysql_dump` to generate YSQL table and index SPLIT AT VALUES clause for multi-tablet range-partitioned relation during backup.
It fails to decode `GinNull` in GIN Index partition bounds.
With the change in this diff, `yb_get_range_split_clause` checks for the existence of `GinNull` in partition bounds. If `GinNull` exists in partition bounds,
an empty string is returned by `yb_get_range_split_clause`.
Also, there might be other unknown cases where partition bounds decoding can fail, which blocks YB backup.
Thus, protect the decoding in `yb_get_range_split_clause` with PG TRY CATCH block in case of decoding failure for the sake of YB backup.
If decoding fails, a warning is thrown and an empty string is returned by `yb_get_range_split_clause`.
Each time `yb_get_range_split_clause` returns an empty string for a multi-tablet range relation, during restore, the relation is repartitioned with correct partition boundaries.
Jira: DB-11260

Original commit: 7fbebe9 / D34965

Test Plan:
Jenkins: urgent
./yb_build.sh --cxx-test yb-backup-cross-feature-test --gtest_filter YBBackupTest.TestYSQLTabletSplitGINIndexWithGinNullInPartitionBounds

Reviewers: jason, mihnea

Reviewed By: jason

Subscribers: yql, ybase, fizaa

Tags: #jenkins-ready

Differential Revision: https://phorge.dev.yugabyte.com/D35059
yifanguan added a commit that referenced this issue May 15, 2024
…sing PG TRY CATCH block

Summary:
`yb_get_range_split_clause` is used by `ysql_dump` to generate YSQL table and index SPLIT AT VALUES clause for multi-tablet range-partitioned relation during backup.
It fails to decode `GinNull` in GIN Index partition bounds.
With the change in this diff, `yb_get_range_split_clause` checks for the existence of `GinNull` in partition bounds. If `GinNull` exists in partition bounds,
an empty string is returned by `yb_get_range_split_clause`.
Also, there might be other unknown cases where partition bounds decoding can fail, which blocks YB backup.
Thus, protect the decoding in `yb_get_range_split_clause` with PG TRY CATCH block in case of decoding failure for the sake of YB backup.
If decoding fails, a warning is thrown and an empty string is returned by `yb_get_range_split_clause`.
Each time `yb_get_range_split_clause` returns an empty string for a multi-tablet range relation, during restore, the relation is repartitioned with correct partition boundaries.
Jira: DB-11260

Original commit: 7fbebe9 / D34965

Test Plan:
Jenkins: urgent
./yb_build.sh --cxx-test yb-backup-cross-feature-test --gtest_filter YBBackupTest.TestYSQLTabletSplitGINIndexWithGinNullInPartitionBounds

Reviewers: jason, mihnea

Reviewed By: jason

Subscribers: yql, ybase, fizaa

Tags: #jenkins-ready

Differential Revision: https://phorge.dev.yugabyte.com/D35060
yifanguan added a commit that referenced this issue May 15, 2024
…sing PG TRY CATCH block

Summary:
`yb_get_range_split_clause` is used by `ysql_dump` to generate YSQL table and index SPLIT AT VALUES clause for multi-tablet range-partitioned relation during backup.
It fails to decode `GinNull` in GIN Index partition bounds.
With the change in this diff, `yb_get_range_split_clause` checks for the existence of `GinNull` in partition bounds. If `GinNull` exists in partition bounds,
an empty string is returned by `yb_get_range_split_clause`.
Also, there might be other unknown cases where partition bounds decoding can fail, which blocks YB backup.
Thus, protect the decoding in `yb_get_range_split_clause` with PG TRY CATCH block in case of decoding failure for the sake of YB backup.
If decoding fails, a warning is thrown and an empty string is returned by `yb_get_range_split_clause`.
Each time `yb_get_range_split_clause` returns an empty string for a multi-tablet range relation, during restore, the relation is repartitioned with correct partition boundaries.
Jira: DB-11260

Original commit: 7fbebe9 / D34965
- pg_yb_utils.c getRangeSplitPointsList: D23931 is not in branch 2.18, so simple change made to this function is not included in this backport.
- yb-backup-cross-feature-test.cc TestYSQLTabletSplitGINIndexWithGinNullInPartitionBounds: Since the test utility function `YBBackupTest::GetSplitPoints` is not in branch 2.18, tablet's partition key check logic in this test is slightly rewritten.
- ybc_pggate.cc GetSplitPoints: D25290 is not in branch 2.18, so `GinNull` existence check uses KeyEntryValue decoded from partition bounds instead.

Test Plan:
Jenkins: urgent
./yb_build.sh --cxx-test yb-backup-cross-feature-test --gtest_filter YBBackupTest.TestYSQLTabletSplitGINIndexWithGinNullInPartitionBounds

Reviewers: jason, mihnea

Reviewed By: jason

Subscribers: yql, ybase, fizaa

Tags: #jenkins-ready

Differential Revision: https://phorge.dev.yugabyte.com/D35064
@m-iancu m-iancu closed this as completed May 15, 2024
@yifanguan yifanguan reopened this May 22, 2024
yifanguan added a commit that referenced this issue May 22, 2024
… using PG TRY CATCH block

Summary:
`yb_get_range_split_clause` is used by `ysql_dump` to generate YSQL table and index SPLIT AT VALUES clause for multi-tablet range-partitioned relation during backup.
It fails to decode `GinNull` in GIN Index partition bounds.
With the change in this diff, `yb_get_range_split_clause` checks for the existence of `GinNull` in partition bounds. If `GinNull` exists in partition bounds,
an empty string is returned by `yb_get_range_split_clause`.
Also, there might be other unknown cases where partition bounds decoding can fail, which blocks YB backup.
Thus, protect the decoding in `yb_get_range_split_clause` with PG TRY CATCH block in case of decoding failure for the sake of YB backup.
If decoding fails, a warning is thrown and an empty string is returned by `yb_get_range_split_clause`.
Each time `yb_get_range_split_clause` returns an empty string for a multi-tablet range relation, during restore, the relation is repartitioned with correct partition boundaries.
Jira: DB-11260

Original commit: 7fbebe9 / D34965

Test Plan:
Jenkins: urgent
./yb_build.sh --cxx-test yb-backup-cross-feature-test --gtest_filter YBBackupTest.TestYSQLTabletSplitGINIndexWithGinNullInPartitionBounds

Reviewers: mihnea, jason

Reviewed By: jason

Subscribers: yql, ybase

Tags: #jenkins-ready

Differential Revision: https://phorge.dev.yugabyte.com/D35249
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.20.4_blocker 2.20.4.0_blocker 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