Skip to content

Initial support for advisory lock functions#1326

Merged
fulghum merged 1 commit intomainfrom
fulghum/advisory_locks
Mar 26, 2025
Merged

Initial support for advisory lock functions#1326
fulghum merged 1 commit intomainfrom
fulghum/advisory_locks

Conversation

@fulghum
Copy link
Copy Markdown
Contributor

@fulghum fulghum commented Mar 25, 2025

Adds support for three Postgres advisory lock functions:

  • pg_try_advisory_lock()
  • pg_advisory_lock()
  • pg_advisory_unlock()

A couple TODOs call out follow-ups to make LockSubsystem work better with Postgres' behavior, such as supporting reentrant locking.

Fixes: #1262

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 25, 2025

Main PR
covering_index_scan_postgres 389.98/s 386.53/s -0.9%
index_join_postgres 157.55/s 157.80/s +0.1%
index_join_scan_postgres 189.00/s 189.51/s +0.2%
index_scan_postgres 12.78/s 12.66/s -1.0%
oltp_point_select 2847.86/s 2821.41/s -1.0%
oltp_read_only 1905.64/s 1878.43/s -1.5%
select_random_points 113.07/s 111.99/s -1.0%
select_random_ranges 140.71/s 136.72/s -2.9%
table_scan_postgres 10.51/s 10.36/s -1.5%
types_table_scan_postgres 5.44/s 5.46/s +0.3%

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 25, 2025

Main PR
Total 42090 42090
Successful 15727 15727
Failures 26363 26363
Partial Successes1 5198 5198
Main PR
Successful 37.3652% 37.3652%
Failures 62.6348% 62.6348%

Footnotes

  1. These are tests that we're marking as Successful, however they do not match the expected output in some way. This is due to small differences, such as different wording on the error messages, or the column names being incorrect while the data itself is correct.

Copy link
Copy Markdown
Member

@zachmu zachmu left a comment

Choose a reason for hiding this comment

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

LGTM, good start

@fulghum fulghum force-pushed the fulghum/advisory_locks branch from 36fcd68 to 032f321 Compare March 26, 2025 16:47
@fulghum fulghum merged commit 9c23998 into main Mar 26, 2025
14 checks passed
@fulghum fulghum deleted the fulghum/advisory_locks branch March 26, 2025 17:10
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.

Standard Rails deployments require pg_try_advisory_lock() function

2 participants