Skip to content

Commit c5b2d9c

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 8880775 commit c5b2d9c

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

0 commit comments

Comments
 (0)