Skip to content

[YSQL] REFRESH MV [NONCONCURRENTLY] crashes during major version upgrade #26297

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

Closed
1 task done
karthik-ramanathan-3006 opened this issue Mar 6, 2025 · 0 comments
Closed
1 task done
Assignees
Labels
2024.2 Backport Required 2024.2.2.1_blocker area/ysql Yugabyte SQL (YSQL) kind/bug This issue is a bug priority/medium Medium priority issue

Comments

@karthik-ramanathan-3006
Copy link
Contributor

karthik-ramanathan-3006 commented Mar 6, 2025

Jira Link: DB-15640

Description

0ff1f71 fixed handling XIDs during REFRESH MATERIALIZED VIEW CONCURRENTLY. However, it causes REFRESH MATERIALIZED VIEW to crash in nonconcurrent mode during major version upgrades as evidenced by test:

ybd fastdebug --cxx-test integration-tests_ysql_major_upgrade_matview-test --gtest_filter YsqlMajorUpgradeMatviewTest.RollbackWithMatView --gcc11

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.
@karthik-ramanathan-3006 karthik-ramanathan-3006 added area/ysql Yugabyte SQL (YSQL) status/awaiting-triage Issue awaiting triage labels Mar 6, 2025
@yugabyte-ci yugabyte-ci added kind/bug This issue is a bug priority/medium Medium priority issue labels Mar 6, 2025
@yugabyte-ci yugabyte-ci removed the status/awaiting-triage Issue awaiting triage label Mar 6, 2025
karthik-ramanathan-3006 added a commit that referenced this issue Mar 6, 2025
…g major version upgrade

Summary:
D42159 handling the generation of PostgreSQL XIDs for `REFRESH MATERIALIZED VIEW CONCURRENTLY`.
It did not handle scenarios where a nonconcurrent refresh silently uses temp tables.
D41504 introduced one such scenario: when a major version upgrade is in progress,
a `REFRESH MATERIALIZED VIEW [NONCONCURRENTLY]` uses temporary tables to handle
new data to be inserted into the materialized view.

This revision handles the above scenario by treating it the same as a concurrent refresh with respect to
clearing the XID on transaction commit.
Jira: DB-15640

Test Plan:
Run the following test:
```
./yb_build.sh --cxx-test integration-tests_ysql_major_upgrade_matview-test --gtest_filter YsqlMajorUpgradeMatviewTest
```

Jenkins: urgent

Reviewers: fizaa, hsunder

Reviewed By: fizaa, hsunder

Subscribers: smishra, yql

Tags: #jenkins-ready

Differential Revision: https://phorge.dev.yugabyte.com/D42332
karthik-ramanathan-3006 added a commit that referenced this issue Mar 6, 2025
…NCURRENTLY] during major version upgrade

Summary:
D42159 handling the generation of PostgreSQL XIDs for `REFRESH MATERIALIZED VIEW CONCURRENTLY`.
It did not handle scenarios where a nonconcurrent refresh silently uses temp tables.
D41504 introduced one such scenario: when a major version upgrade is in progress,
a `REFRESH MATERIALIZED VIEW [NONCONCURRENTLY]` uses temporary tables to handle
new data to be inserted into the materialized view.

This revision handles the above scenario by treating it the same as a concurrent refresh with respect to
clearing the XID on transaction commit.
Jira: DB-15640

Original commit: dbeec7c / D42332

Test Plan:
Run the following test:
```
./yb_build.sh --cxx-test integration-tests_ysql_major_upgrade_matview-test --gtest_filter YsqlMajorUpgradeMatviewTest
```

Jenkins: urgent

Reviewers: fizaa, hsunder

Reviewed By: fizaa

Subscribers: yql, smishra

Tags: #jenkins-ready

Differential Revision: https://phorge.dev.yugabyte.com/D42355
karthik-ramanathan-3006 added a commit that referenced this issue Mar 6, 2025
…CONCURRENTLY] during major version upgrade

Summary:
D42159 handling the generation of PostgreSQL XIDs for `REFRESH MATERIALIZED VIEW CONCURRENTLY`.
It did not handle scenarios where a nonconcurrent refresh silently uses temp tables.
D41504 introduced one such scenario: when a major version upgrade is in progress,
a `REFRESH MATERIALIZED VIEW [NONCONCURRENTLY]` uses temporary tables to handle
new data to be inserted into the materialized view.

This revision handles the above scenario by treating it the same as a concurrent refresh with respect to
clearing the XID on transaction commit.
Jira: DB-15640

Original commit: dbeec7c / D42332

Test Plan:
Run the following test:
```
./yb_build.sh --cxx-test integration-tests_ysql_major_upgrade_matview-test --gtest_filter YsqlMajorUpgradeMatviewTest
```

Jenkins: urgent

Reviewers: fizaa, hsunder

Reviewed By: fizaa

Subscribers: smishra, yql

Tags: #jenkins-ready

Differential Revision: https://phorge.dev.yugabyte.com/D42356
utkarsh-um pushed a commit to utkarsh-um/yugabyte-db that referenced this issue Mar 17, 2025
…Y] during major version upgrade

Summary:
D42159 handling the generation of PostgreSQL XIDs for `REFRESH MATERIALIZED VIEW CONCURRENTLY`.
It did not handle scenarios where a nonconcurrent refresh silently uses temp tables.
D41504 introduced one such scenario: when a major version upgrade is in progress,
a `REFRESH MATERIALIZED VIEW [NONCONCURRENTLY]` uses temporary tables to handle
new data to be inserted into the materialized view.

This revision handles the above scenario by treating it the same as a concurrent refresh with respect to
clearing the XID on transaction commit.
Jira: DB-15640

Test Plan:
Run the following test:
```
./yb_build.sh --cxx-test integration-tests_ysql_major_upgrade_matview-test --gtest_filter YsqlMajorUpgradeMatviewTest
```

Jenkins: urgent

Reviewers: fizaa, hsunder

Reviewed By: fizaa, hsunder

Subscribers: smishra, yql

Tags: #jenkins-ready

Differential Revision: https://phorge.dev.yugabyte.com/D42332
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2024.2 Backport Required 2024.2.2.1_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