New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Postgres: use pg_try_advisory_lock
instead of pg_advisory_lock
#962
base: master
Are you sure you want to change the base?
Postgres: use pg_try_advisory_lock
instead of pg_advisory_lock
#962
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left a comment in case we decide to go this route
database/postgres/postgres.go
Outdated
break | ||
} | ||
|
||
time.Sleep(100 * time.Millisecond) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the backoff library with an exponential backoff + jitter as the default. Note, this may cause other nodes/hosts to take longer to deploy due to the longer wait period so the backoff should be configurable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dhui thanks for the feedback, I've added a configurable exponential retry.
this may cause other nodes/hosts to take longer to deploy due to the longer wait period
I've added defaults and kept them quite small to address the above
unfortunately the tests keep failing because device is running out of space |
I assume the tests were temporarily broken, so this might work after a rebase? I’m interested in this fix landing 😊 |
@eelco thanks for noting, looks like #1072 fixed the tests and pipeline here in the PR is working and passing now - unfortunately this PR got stuck in sleep mode for quite a while due to the unstable pipeline, I hope we can merge this soon :) |
Issue
#960
Changes
Lock
, usepg_try_advisory_lock
instead ofpg_advisory_lock
to fix the expected behavior of waiting for acquiring lock indefinitelyx-lock-retry-max-interval
to configure the max interval to be used for exponential backoff when retryingLock