Skip to content

Fix assertion if index is dropped during REFRESH CONCURRENTLY - #1632

Merged
reshke merged 1 commit into
apache:mainfrom
reshke:cp_a45c950ae35e53de40_main
Nov 14, 2026
Merged

reshke merged 1 commit into
apache:mainfrom
reshke:cp_a45c950ae35e53de40_main

Conversation

@reshke

@reshke reshke commented Mar 21, 2026

Copy link
Copy Markdown
Contributor

When assertions are disabled, the built SQL statement is invalid and you get a "syntax error". So this isn't a serious problem, but let's avoid the assertion failure.

Backpatch to all supported versions.

Reviewed-by: Noah Misch

======

In CBDB, we backport this change for future-proofing and in sight of d42418a and general backporting of all security-related changes.

@avamingli avamingli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for cherry-pick.

@reshke
reshke force-pushed the cp_a45c950ae35e53de40_main branch 2 times, most recently from fb20573 to f893f35 Compare March 23, 2026 12:03
@leborchuk

Copy link
Copy Markdown
Contributor

matview tests failed with

+ERROR:  function cannot execute on a QE slice because it issues a non-SELECT statement
+CONTEXT:  SQL statement "DROP INDEX IF EXISTS mvtest_drop_idx"
+PL/pgSQL function mvtest_drop_the_index() line 3 at EXECUTE

@my-ship-it my-ship-it left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall the code changes are solid upstream backports. LGTM!

@reshke
reshke force-pushed the cp_a45c950ae35e53de40_main branch from f893f35 to eea4f51 Compare April 24, 2026 20:59
@tuhaihe

tuhaihe commented Sep 23, 2026

Copy link
Copy Markdown
Member

Hi @reshke would you like to rebase this PR?

@reshke
reshke force-pushed the cp_a45c950ae35e53de40_main branch from eea4f51 to f48a953 Compare November 14, 2026 15:20
Run the index-dropping function as an initplan on the coordinator, so the test reaches the concurrent refresh check. Set an explicit distribution key and update the planner and ORCA expected results.
@reshke
reshke force-pushed the cp_a45c950ae35e53de40_main branch from f48a953 to 9db4f42 Compare November 14, 2026 16:46
@reshke
reshke enabled auto-merge (rebase) November 14, 2026 17:37
@reshke
reshke merged commit 6ee9e3b into apache:main Nov 14, 2026
123 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants