You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In some cases instead of sending a query immediately, we prepend it, so we can send it with a next query. We do this for BEGIN TRANSACTION and whenever a connection is reset as it's returned to the pool. #4907 made it so we shouldn't even send a cancellation request until we've read all of the responses for the prepended query. Instead, we can make it so the prepended query runs in the same transaction as an actual query.
This is going to require:
Make prepended queries use extended query protocol
Automatically prepare all of prepended queries on opening a connection
We should restore the write buffer with prepended query whenever there is an error while executing a query
Given that we merged #4907, which is about preventing prepended queries from being cancelled in the first place, I think we can put this in the backlog until we have reason to believe that the current situation is insufficient. This could happen if it's still somehow possible for a cancellation to affect prepended queries (despite the safeguards in #4907), or if we allow users to prepend custom queries and to cancel those prepended queries.
Activity
roji commentedon Jan 30, 2023
Given that we merged #4907, which is about preventing prepended queries from being cancelled in the first place, I think we can put this in the backlog until we have reason to believe that the current situation is insufficient. This could happen if it's still somehow possible for a cancellation to affect prepended queries (despite the safeguards in #4907), or if we allow users to prepend custom queries and to cancel those prepended queries.