Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 8c7be86

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 5b0e7fe commit 8c7be86

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

contrib/postgres_fdw/connection.c

+10-5
Original file line numberDiff line numberDiff line change
@@ -1137,6 +1137,11 @@ pgfdw_reject_incomplete_xact_state_change(ConnCacheEntry *entry)
11371137
* and ignore the result. Returns true if we successfully cancel the query
11381138
* and discard any pending result, and false if not.
11391139
*
1140+
* It's not a huge problem if we throw an ERROR here, but if we get into error
1141+
* recursion trouble, we'll end up slamming the connection shut, which will
1142+
* necessitate failing the entire toplevel transaction even if subtransactions
1143+
* were used. Try to use WARNING where we can.
1144+
*
11401145
* XXX: if the query was one sent by fetch_more_data_begin(), we could get the
11411146
* query text from the pendingAreq saved in the per-connection state, then
11421147
* report the query using it.
@@ -1187,6 +1192,11 @@ pgfdw_cancel_query(PGconn *conn)
11871192
* If the query is executed successfully but returns an error, the return
11881193
* value is true if and only if ignore_errors is set. If the query can't be
11891194
* sent or times out, the return value is false.
1195+
*
1196+
* It's not a huge problem if we throw an ERROR here, but if we get into error
1197+
* recursion trouble, we'll end up slamming the connection shut, which will
1198+
* necessitate failing the entire toplevel transaction even if subtransactions
1199+
* were used. Try to use WARNING where we can.
11901200
*/
11911201
static bool
11921202
pgfdw_exec_cleanup_query(PGconn *conn, const char *query, bool ignore_errors)
@@ -1233,11 +1243,6 @@ pgfdw_exec_cleanup_query(PGconn *conn, const char *query, bool ignore_errors)
12331243
* be a query that was initiated as part of transaction abort to get the remote
12341244
* side back to the appropriate state.
12351245
*
1236-
* It's not a huge problem if we throw an ERROR here, but if we get into error
1237-
* recursion trouble, we'll end up slamming the connection shut, which will
1238-
* necessitate failing the entire toplevel transaction even if subtransactions
1239-
* were used. Try to use WARNING where we can.
1240-
*
12411246
* endtime is the time at which we should give up and assume the remote
12421247
* side is dead. Returns true if the timeout expired, otherwise false.
12431248
* Sets *result except in case of a timeout.

0 commit comments

Comments
 (0)