Skip to content

Commit 7b8237b

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 36c9f7d commit 7b8237b

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
@@ -1048,6 +1048,11 @@ pgfdw_reject_incomplete_xact_state_change(ConnCacheEntry *entry)
10481048
* Cancel the currently-in-progress query (whose query text we do not have)
10491049
* and ignore the result. Returns true if we successfully cancel the query
10501050
* and discard any pending result, and false if not.
1051+
*
1052+
* It's not a huge problem if we throw an ERROR here, but if we get into error
1053+
* recursion trouble, we'll end up slamming the connection shut, which will
1054+
* necessitate failing the entire toplevel transaction even if subtransactions
1055+
* were used. Try to use WARNING where we can.
10511056
*/
10521057
static bool
10531058
pgfdw_cancel_query(PGconn *conn)
@@ -1095,6 +1100,11 @@ pgfdw_cancel_query(PGconn *conn)
10951100
* If the query is executed successfully but returns an error, the return
10961101
* value is true if and only if ignore_errors is set. If the query can't be
10971102
* sent or times out, the return value is false.
1103+
*
1104+
* It's not a huge problem if we throw an ERROR here, but if we get into error
1105+
* recursion trouble, we'll end up slamming the connection shut, which will
1106+
* necessitate failing the entire toplevel transaction even if subtransactions
1107+
* were used. Try to use WARNING where we can.
10981108
*/
10991109
static bool
11001110
pgfdw_exec_cleanup_query(PGconn *conn, const char *query, bool ignore_errors)
@@ -1141,11 +1151,6 @@ pgfdw_exec_cleanup_query(PGconn *conn, const char *query, bool ignore_errors)
11411151
* be a query that was initiated as part of transaction abort to get the remote
11421152
* side back to the appropriate state.
11431153
*
1144-
* It's not a huge problem if we throw an ERROR here, but if we get into error
1145-
* recursion trouble, we'll end up slamming the connection shut, which will
1146-
* necessitate failing the entire toplevel transaction even if subtransactions
1147-
* were used. Try to use WARNING where we can.
1148-
*
11491154
* endtime is the time at which we should give up and assume the remote
11501155
* side is dead. Returns true if the timeout expired, otherwise false.
11511156
* Sets *result except in case of a timeout.

0 commit comments

Comments
 (0)