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] Table rewrite operations are unsafe #19860

Open
1 task done
fizaaluthra opened this issue Nov 6, 2023 · 0 comments
Open
1 task done

[YSQL] Table rewrite operations are unsafe #19860

fizaaluthra opened this issue Nov 6, 2023 · 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 Nov 6, 2023

Jira Link: DB-8804

Description

Currently in YB table rewrite operations (like ALTER TYPE, ADD/DROP primary key) are unsafe, i.e., concurrent writes may not be reflected in the new table.

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 Nov 6, 2023
@yugabyte-ci yugabyte-ci added kind/bug This issue is a bug priority/medium Medium priority issue labels Nov 6, 2023
@fizaaluthra fizaaluthra self-assigned this Nov 6, 2023
@yugabyte-ci yugabyte-ci removed the status/awaiting-triage Issue awaiting triage label Nov 14, 2023
myang2021 added a commit that referenced this issue Jun 24, 2024
…t output

Summary:
The unit test org.yb.pgsql.TestPgRegressIndex.testPgRegressIndex is always
failing now because the test output needs to be updated due to a recently
introduced table rewrite NOTICE output:

```
NOTICE:  table rewrite may lead to inconsistencies
DETAIL:  Concurrent DMLs may not be reflected in the new table.
HINT:  See #19860. Set 'ysql_suppress_unsafe_alter_notice' yb-tserver gflag to true to suppress this notice.
```

In addition, the test output itself isn't reliable because of the following
error for statement `drop index idxpart0_pkey;`:

```
ERROR:  cannot drop index idxpart0_pkey because index idxpart_pkey requires it
HINT:  You can drop index idxpart_pkey instead.
```
vs
```
ERROR:  cannot drop index idxpart0_pkey because constraint idxpart0_pkey on table idxpart0 requires it
HINT:  You can drop constraint idxpart0_pkey on table idxpart0 instead.
```

Both are possible and which one gets reported depends upon the order in the
pg_depend scan output. Because pg_depend does not have a primary key, it uses
YB generated uuid and therefore the scan output order isn't fixed.

I updated the expected test output.
Jira: DB-5819

Test Plan: ./yb_build.sh release --java-test 'org.yb.pgsql.TestPgRegressIndex#testPgRegressIndex'

Reviewers: fizaa

Reviewed By: fizaa

Subscribers: yql

Differential Revision: https://phorge.dev.yugabyte.com/D36068
myang2021 added a commit that referenced this issue Jun 27, 2024
…ndex expected test output

Summary:
The unit test org.yb.pgsql.TestPgRegressIndex.testPgRegressIndex is always
failing now because the test output needs to be updated due to a recently
introduced table rewrite NOTICE output:

```
NOTICE:  table rewrite may lead to inconsistencies
DETAIL:  Concurrent DMLs may not be reflected in the new table.
HINT:  See #19860. Set 'ysql_suppress_unsafe_alter_notice' yb-tserver gflag to true to suppress this notice.
```

In addition, the test output itself isn't reliable because of the following
error for statement `drop index idxpart0_pkey;`:

```
ERROR:  cannot drop index idxpart0_pkey because index idxpart_pkey requires it
HINT:  You can drop index idxpart_pkey instead.
```
vs
```
ERROR:  cannot drop index idxpart0_pkey because constraint idxpart0_pkey on table idxpart0 requires it
HINT:  You can drop constraint idxpart0_pkey on table idxpart0 instead.
```

Both are possible and which one gets reported depends upon the order in the
pg_depend scan output. Because pg_depend does not have a primary key, it uses
YB generated uuid and therefore the scan output order isn't fixed.

I updated the expected test output.
Jira: DB-5819

Original commit: e69dc27 / D36068

Test Plan: ./yb_build.sh release --java-test 'org.yb.pgsql.TestPgRegressIndex#testPgRegressIndex'

Reviewers: fizaa

Reviewed By: fizaa

Subscribers: yql

Tags: #jenkins-ready

Differential Revision: https://phorge.dev.yugabyte.com/D36210
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

2 participants