Thread: Rollback after "Connection timed out"?

Rollback after "Connection timed out"?

From
Ron
Date:
Pg 9.6.24

On Server_A, I ran:
psql --host=blarge mydb -c "ALTER TABLE blah ..."

After about 2 hours, it displayed this message:
Could not receive data from server: Connection timed out
Connection to server was lost

And yet the ALTER TABLE (it's heavily inheritance-partitioned) is still 
running on blarge.  Is it still working, or is it rolling back (which I'd 
expect to be fast)?

-- 
Born in Arizona, moved to Babylonia.



Re: Rollback after "Connection timed out"?

From
Tom Lane
Date:
Ron <ronljohnsonjr@gmail.com> writes:
> On Server_A, I ran:
> psql --host=blarge mydb -c "ALTER TABLE blah ..."

> After about 2 hours, it displayed this message:
> Could not receive data from server: Connection timed out
> Connection to server was lost

> And yet the ALTER TABLE (it's heavily inheritance-partitioned) is still 
> running on blarge.  Is it still working, or is it rolling back (which I'd 
> expect to be fast)?

It will probably run to completion if you leave it alone.  The
server would only notice loss of connection when it next tries to
send something to the client, which (barring error/notice
messages) would be the command completion report.

For next time, you might want to think about reducing the
TCP keepalive interval settings.

            regards, tom lane