Introduce the ability to kill competing transactions that hold exclusive lock during swap #23
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This introduces
wait_time_for_lock
andkill_backends
as new flags.By default
pgosc
won't kill any backends if it cannot acquire anAccessExclusiveLock
to perform the swap. It will retry upto 3 timesand for the duration specified in
wait_time_for_lock
(default:10s
).So, in total 30s. Configurable. If
kill_backends
/kill-backend
is set to true (supplied), then it will kill the backend on each try
it couldn't acquire the lock, upto 3 times before exiting. Though,
after killing the backends after 1st attempt should work.
Specs added. A bit messy for now. Refactor in the end
closes #16