Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitae9bfc5

Browse files
committed
postgres_fdw: Allow cancellation of transaction control commands.
Commitf039eaa, later back-patchedwith commit1b812af, allowed many ofthe queries issued by postgres_fdw to fetch remote data to respond tocancel interrupts in a timely fashion. However, it didn't do anythingabout the transaction control commands, which remainednoninterruptible.Improve the situation by changing do_sql_command() to retrieve queryresults using pgfdw_get_result(), which uses the asynchronousinterface to libpq so that it can check for interrupts every timelibpq returns control. Since this might result in a situationwhere we can no longer be sure that the remote transaction statematches the local transaction state, add a facility to force alllevels of the local transaction to abort if we've lost track ofthe remote state; without this, an apparently-successful commit ofthe local transaction might fail to commit changes made on theremote side. Also, add a 60-second timeout for queries issue duringtransaction abort; if that expires, give up and mark the state ofthe connection as unknown. Drop all such connections when we exitthe local transaction. Together, these changes mean that if we'reaborting the local toplevel transaction anyway, we can just drop theremote connection in lieu of waiting (possibly for a very long time)for it to complete an abort.This still leaves quite a bit of room for improvement. PQcancel()has no asynchronous interface, so if we get stuck sending the cancelrequest we'll still hang. Also, PQsetnonblocking() is not used, whichmeans we could block uninterruptibly when sending a query. Theremight be some other optimizations possible as well. Nonetheless,this allows us to escape a wait for an unresponsive remote serverquickly in many more cases than previously.Report by Suraj Kharage. Patch by me and Rafia Sabih. Reviewand testing by Amit Kapila and Tushar Ahuja.Discussion:http://postgr.es/m/CAF1DzPU8Kx+fMXEbFoP289xtm3bz3t+ZfxhmKavr98Bh-C0TqQ@mail.gmail.com
1 parent644ea35 commitae9bfc5

File tree

1 file changed

+308
-53
lines changed

1 file changed

+308
-53
lines changed

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp