Skip to content

Use object-level locks for concurrent grants to improve parallelism#595

Open
benoittgt wants to merge 6 commits intocyrilgdn:mainfrom
benoittgt:lock-grants
Open

Use object-level locks for concurrent grants to improve parallelism#595
benoittgt wants to merge 6 commits intocyrilgdn:mainfrom
benoittgt:lock-grants

Conversation

@benoittgt
Copy link

@benoittgt benoittgt commented Nov 21, 2025

Replace database-wide locks with hash-based object locks. Enables parallel grant operations on different objects while preventing catalog conflicts.

Uses hashtext() for deterministic lock IDs like "grant:table:db.schema.table".

I used a small script to test conflicts: https://gist.github.com/benoittgt/8b9b9b305dc961308380be865a1ce66a

This is another extended version of #520

Kyle Johnson and others added 5 commits November 21, 2025 10:21
Replace database-wide locks with hash-based object locks. Enables parallel
grant operations on different objects while preventing catalog conflicts.

Uses hashtext() for deterministic lock IDs like "grant:table:db.schema.table".

Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
@benoittgt benoittgt marked this pull request as ready for review November 22, 2025 15:01
jBouyoud added a commit to Swile/terraform-provider-postgresql that referenced this pull request Dec 22, 2025
Integrate object-level locks for concurrent grants (PR cyrilgdn#595)
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.

2 participants