Skip to content

Commit 48dc847

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 afa09e4 commit 48dc847

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
@@ -1040,6 +1040,11 @@ pgfdw_reject_incomplete_xact_state_change(ConnCacheEntry *entry)
10401040
* Cancel the currently-in-progress query (whose query text we do not have)
10411041
* and ignore the result. Returns true if we successfully cancel the query
10421042
* and discard any pending result, and false if not.
1043+
*
1044+
* It's not a huge problem if we throw an ERROR here, but if we get into error
1045+
* recursion trouble, we'll end up slamming the connection shut, which will
1046+
* necessitate failing the entire toplevel transaction even if subtransactions
1047+
* were used. Try to use WARNING where we can.
10431048
*/
10441049
static bool
10451050
pgfdw_cancel_query(PGconn *conn)
@@ -1087,6 +1092,11 @@ pgfdw_cancel_query(PGconn *conn)
10871092
* If the query is executed successfully but returns an error, the return
10881093
* value is true if and only if ignore_errors is set. If the query can't be
10891094
* sent or times out, the return value is false.
1095+
*
1096+
* It's not a huge problem if we throw an ERROR here, but if we get into error
1097+
* recursion trouble, we'll end up slamming the connection shut, which will
1098+
* necessitate failing the entire toplevel transaction even if subtransactions
1099+
* were used. Try to use WARNING where we can.
10901100
*/
10911101
static bool
10921102
pgfdw_exec_cleanup_query(PGconn *conn, const char *query, bool ignore_errors)
@@ -1133,11 +1143,6 @@ pgfdw_exec_cleanup_query(PGconn *conn, const char *query, bool ignore_errors)
11331143
* be a query that was initiated as part of transaction abort to get the remote
11341144
* side back to the appropriate state.
11351145
*
1136-
* It's not a huge problem if we throw an ERROR here, but if we get into error
1137-
* recursion trouble, we'll end up slamming the connection shut, which will
1138-
* necessitate failing the entire toplevel transaction even if subtransactions
1139-
* were used. Try to use WARNING where we can.
1140-
*
11411146
* endtime is the time at which we should give up and assume the remote
11421147
* side is dead. Returns true if the timeout expired, otherwise false.
11431148
* Sets *result except in case of a timeout.

0 commit comments

Comments
 (0)