Re: statement_timeout is not working as expected with postgres_fdw
Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
From: Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
To: tgl@sss.pgh.pa.us
Cc: robertmhaas@gmail.com, amit.kapila16@gmail.com,
ashutosh.bapat@enterprisedb.com, suraj.kharage@enterprisedb.com,
pgsql-hackers@postgresql.org
Date: 2017-05-17T01:54:28Z
Lists: pgsql-hackers
Hello, At Tue, 16 May 2017 12:45:39 -0400, Tom Lane <tgl@sss.pgh.pa.us> wrote in <22556.1494953139@sss.pgh.pa.us> > Robert Haas <robertmhaas@gmail.com> writes: > > Concretely, I think we should replace the abort_cleanup_incomplete > > flag from my previous patch with a changing_xact_state flag and set > > that flag around all transaction state changes, clearing it when such > > changes have succeeded. On error, the flag remains set, so we know > > that the state of that connection is unknown and that we must close it > > (killing outer transaction levels as needed). > > > Thoughts? > > Sounds plausible. I think that the current issue is the usability of the current connection. Even if any other command should fail, we can continue using the connection if ABORT TRANSACTION succeeds. Failure of ABORT immediately means that the connection is no longer available. If this discuttion is reasonable, changing_xact_state might be too-much. By the way if an fdw connection is stalled amid do_sql_command waiting a result, a cancel request doesn't work (in other words pgsql_xact_callback is not called) since EINTR is just ignored in libpq. Maybe we should teach libpq to error out with EINTR with some additional reasons. PQsetEINTRcallback() or something? regards, -- Kyotaro Horiguchi NTT Open Source Software Center
Commits
-
postgres_fdw: Allow cancellation of transaction control commands.
- fc267a0c3c65 9.3.18 landed
- c02c450cfc0f 9.4.13 landed
- b7665f079092 9.5.8 landed
- fd849956cc71 9.6.4 landed
- ae9bfc5d6512 10.0 landed
-
Allow queries submitted by postgres_fdw to be canceled.
- cdf5a004bb7c 9.5.7 landed
- f14bf0a8fdd5 9.4.12 landed
- 3aa16b117a28 9.3.17 landed
- f039eaac7131 9.6.0 cited
-
Fix multiple problems in postgres_fdw query cancellation logic.
- 1b812afb0eaf 9.6.0 cited