Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Flush pending writes on connection close #1617

Merged
merged 1 commit into from
Jun 16, 2021

Conversation

mbutrovich
Copy link
Contributor

@mbutrovich mbutrovich commented Jun 15, 2021

In theory this should just be error messages and not partial query data, but I don't completely understand the network state machine. This is mostly to make sure we flush error messages on connection startup. See PostgresProtocolInterpreter::ProcessStartup's error states.

This came from @lmwnshn seeing behavior where clients couldn't connect while a simultaneous transaction was running that made DDL changes. We now get the verbose error (that was always written to the packet, just never flushed) returned to the client.

Client 1:

$ psql -h localhost -p 15721 -d noisepage
psql (12.7 (Ubuntu 12.7-0ubuntu0.20.04.1), server 9.5devel)
Type "help" for help.

noisepage=# begin;
BEGIN
Time: 1.427 ms
noisepage=# create table foo (id int);
CREATE TABLE
Time: 7.825 ms
noisepage=# 

Client 2:

$ psql -h localhost -p 15721 -d noisepage
psql: error: FATAL:  Failed to create a temporary namespace for this connection. There may be a concurrent DDL change. Please retry.

…be error messages and not partial query data, but I don't completely understand the network state machine. This is mostly to make sure we flush error messages on connection startup. See `PostgresProtocolInterpreter::ProcessStartup`'s error states.
@mbutrovich mbutrovich added ready-for-review This PR passes all checks and is ready to be reviewed. Mark PRs with this. ready-for-ci Indicate that this build should be run through CI. labels Jun 15, 2021
@mbutrovich mbutrovich self-assigned this Jun 15, 2021
@mbutrovich mbutrovich added ready-to-merge This PR is ready to be merged. Mark PRs with this. and removed ready-for-ci Indicate that this build should be run through CI. ready-for-review This PR passes all checks and is ready to be reviewed. Mark PRs with this. labels Jun 16, 2021
@mbutrovich mbutrovich merged commit 1ea203c into cmu-db:master Jun 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ready-to-merge This PR is ready to be merged. Mark PRs with this.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant