Make backend query execution interruptible. #454
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 prevents v15+ DROP DATABASE hanging when a pglogical process waits inside
one of these calls. (See #418
for fixes of that symptom under different conditions.) In all versions, it
brings responsiveness of these calls to query cancel, backend termination, and
fast shutdown.
Future work should include adopting libpqsrv_connect_params(). I didn't bundle
that in this pull request, because that function doesn't support all the
connection parameters that PQconnectdbParams() supports. Specifically, since
libpqsrv_connect_params() wraps PQconnectStartParams(), it has the limitations
discussed in
https://postgr.es/m/flat/CA%2Bmi_8YyGKA9dWELu63e%3DKL2oN-%2BFe4uca4EtFfb6uQD4Up8pw%40mail.gmail.com.
Future work should also bring interruptibility to calls of
PQgetCopyData(async=false), PQputCopyData(), and PQputCopyEnd().
No new test failures in:
When v17 support appears, compat17/pglogical_compat.h can just #include
"libpq/libpq-be-fe-helpers.h" rather than use the local copy.