Fix assert failure triggered by "CREATE INDEX CONCURRENTLY"#1845
Fix assert failure triggered by "CREATE INDEX CONCURRENTLY"#1845fairyfar wants to merge 1 commit into
Conversation
| * which may install xmin in the current process. Use the AUTHOID | ||
| * syscache to fetch pg_authid tuple for the given role Oid. | ||
| */ | ||
| tuple = SearchSysCache1(AUTHOID, ObjectIdGetDatum(roleid)); |
There was a problem hiding this comment.
Can you add related test create index concurrently t_idx on t(a, b); ?
There was a problem hiding this comment.
Yes, test cases have been added to resgroup_transaction.sql. However, compilation requires enabling enable-cassert.
|
I'm very sorry. The test case of ic-resgroup-v2 failed. It's related to this commit. Let me analyze the reasons. |
When resource group is enabled, StartTransaction() may acquire a catalog snapshot within GetResGroupIdForRole, resulting in a valid xmin. However, the transaction status does not meet the requirements for "CREATE INDEX CONCURRENTLY".
The previous commit modified the Therefore, I re-evaluated the revisions and implemented a minimal fix. This revision releases the CatalogSnapshot |
What does this PR do?
When resource groups are enabled, StartTransaction() may have taken a catalog snapshot
within GetResGroupIdForRole, and xmin is not InvalidTransactionId. Therefore, it does
not meet the status requirements for "CREATE INDEX CONCURRENTLY".
Reproduction method:
Type of Change
Breaking Changes
Test Plan
make installcheckmake -C src/test installcheck-cbdb-parallelImpact
Performance:
User-facing changes:
Dependencies:
Checklist
Additional Context
CI Skip Instructions