aboutsummaryrefslogtreecommitdiff
path: root/contrib/postgres_fdw/connection.c
diff options
context:
space:
mode:
authorEtsuro Fujita <efujita@postgresql.org>2021-10-13 19:00:06 +0900
committerEtsuro Fujita <efujita@postgresql.org>2021-10-13 19:00:06 +0900
commitc5b2d9c2a4d893a1a4488e9263bf70a444ba5847 (patch)
treefded6e3f2e1aecd385ee9cb3e2ef6bb2d96b7525 /contrib/postgres_fdw/connection.c
parent88807757d7409fa655458679a78a52b4406cf601 (diff)
downloadpostgresql-c5b2d9c2a4d893a1a4488e9263bf70a444ba5847.tar.gz
postgresql-c5b2d9c2a4d893a1a4488e9263bf70a444ba5847.zip
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
Diffstat (limited to 'contrib/postgres_fdw/connection.c')
-rw-r--r--contrib/postgres_fdw/connection.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/contrib/postgres_fdw/connection.c b/contrib/postgres_fdw/connection.c
index 336faea31ff..53de2468f23 100644
--- a/contrib/postgres_fdw/connection.c
+++ b/contrib/postgres_fdw/connection.c
@@ -1039,6 +1039,11 @@ pgfdw_reject_incomplete_xact_state_change(ConnCacheEntry *entry)
* Cancel the currently-in-progress query (whose query text we do not have)
* and ignore the result. Returns true if we successfully cancel the query
* and discard any pending result, and false if not.
+ *
+ * It's not a huge problem if we throw an ERROR here, but if we get into error
+ * recursion trouble, we'll end up slamming the connection shut, which will
+ * necessitate failing the entire toplevel transaction even if subtransactions
+ * were used. Try to use WARNING where we can.
*/
static bool
pgfdw_cancel_query(PGconn *conn)
@@ -1086,6 +1091,11 @@ pgfdw_cancel_query(PGconn *conn)
* If the query is executed successfully but returns an error, the return
* value is true if and only if ignore_errors is set. If the query can't be
* sent or times out, the return value is false.
+ *
+ * It's not a huge problem if we throw an ERROR here, but if we get into error
+ * recursion trouble, we'll end up slamming the connection shut, which will
+ * necessitate failing the entire toplevel transaction even if subtransactions
+ * were used. Try to use WARNING where we can.
*/
static bool
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)
* be a query that was initiated as part of transaction abort to get the remote
* side back to the appropriate state.
*
- * It's not a huge problem if we throw an ERROR here, but if we get into error
- * recursion trouble, we'll end up slamming the connection shut, which will
- * necessitate failing the entire toplevel transaction even if subtransactions
- * were used. Try to use WARNING where we can.
- *
* endtime is the time at which we should give up and assume the remote
* side is dead. Returns true if the timeout expired, otherwise false.
* Sets *result except in case of a timeout.