Skip to content

Conversation

@za-arthur
Copy link
Collaborator

Currently conn2 acquires ACCESS SHARE lock which allows to run concurrent DDL statements, like CREATE INDEX CONCURRENTLY.

Fix it by acquiring SHARE UPDATE EXCLUSIVE lock. This will also lock concurrent VACUUM, ANALYZE queries, locking them looks safer option anyway.

Thoughts?

Issue #420

Currently conn2 acquires ACCESS SHARE lock which allows to run
concurrent DDL statements, like CREATE INDEX CONCURRENTLY. Fix it by
acquiring SHARE UPDATE EXCLUSIVE lock. This will also lock concurrent
VACUUM, ANALYZE queries, locking them looks safer option anyway.
@andreasscherbaum
Copy link
Collaborator

Makes sense.

@za-arthur za-arthur merged commit 693bce6 into master Apr 25, 2025
22 checks passed
@za-arthur za-arthur deleted the issue_420_share_update_exclusive_lock branch April 25, 2025 21:06
farrokhi pushed a commit to farrokhi/pg_repack that referenced this pull request Nov 5, 2025
Currently conn2 acquires ACCESS SHARE lock which allows to run
concurrent DDL statements, like CREATE INDEX CONCURRENTLY. Fix it by
acquiring SHARE UPDATE EXCLUSIVE lock. This will also lock concurrent
VACUUM, ANALYZE queries, locking them looks safer option anyway.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants