Skip to content

Commit 419d27b

Browse files
author
Etsuro Fujita
committed
postgres_fdw: Move comments about elog level in (sub)abort cleanup.
The comments were misplaced when adding postgres_fdw. Fix that by moving the comments to more appropriate functions. Author: Etsuro Fujita Backpatch-through: 9.6 Discussion: https://postgr.es/m/CAPmGK164sAXQtC46mDFyu6d-T25Mzvh5qaRNkit06VMmecYnOA%40mail.gmail.com
1 parent 922e15c commit 419d27b

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

contrib/postgres_fdw/connection.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,6 +1213,11 @@ pgfdw_reject_incomplete_xact_state_change(ConnCacheEntry *entry)
12131213
* and ignore the result. Returns true if we successfully cancel the query
12141214
* and discard any pending result, and false if not.
12151215
*
1216+
* It's not a huge problem if we throw an ERROR here, but if we get into error
1217+
* recursion trouble, we'll end up slamming the connection shut, which will
1218+
* necessitate failing the entire toplevel transaction even if subtransactions
1219+
* were used. Try to use WARNING where we can.
1220+
*
12161221
* XXX: if the query was one sent by fetch_more_data_begin(), we could get the
12171222
* query text from the pendingAreq saved in the per-connection state, then
12181223
* report the query using it.
@@ -1263,6 +1268,11 @@ pgfdw_cancel_query(PGconn *conn)
12631268
* If the query is executed successfully but returns an error, the return
12641269
* value is true if and only if ignore_errors is set. If the query can't be
12651270
* sent or times out, the return value is false.
1271+
*
1272+
* It's not a huge problem if we throw an ERROR here, but if we get into error
1273+
* recursion trouble, we'll end up slamming the connection shut, which will
1274+
* necessitate failing the entire toplevel transaction even if subtransactions
1275+
* were used. Try to use WARNING where we can.
12661276
*/
12671277
static bool
12681278
pgfdw_exec_cleanup_query(PGconn *conn, const char *query, bool ignore_errors)
@@ -1309,11 +1319,6 @@ pgfdw_exec_cleanup_query(PGconn *conn, const char *query, bool ignore_errors)
13091319
* be a query that was initiated as part of transaction abort to get the remote
13101320
* side back to the appropriate state.
13111321
*
1312-
* It's not a huge problem if we throw an ERROR here, but if we get into error
1313-
* recursion trouble, we'll end up slamming the connection shut, which will
1314-
* necessitate failing the entire toplevel transaction even if subtransactions
1315-
* were used. Try to use WARNING where we can.
1316-
*
13171322
* endtime is the time at which we should give up and assume the remote
13181323
* side is dead. Returns true if the timeout expired, otherwise false.
13191324
* Sets *result except in case of a timeout.

0 commit comments

Comments
 (0)