From b109514d661aae82634d9c22f843843ae39d6634 Mon Sep 17 00:00:00 2001 From: Taiki Koshino Date: Wed, 11 Nov 2026 17:49:38 +0900 Subject: [PATCH v1] Preserve dml_adaptive_global write tracking on ROLLBACK TO SAVEPOINT Keep the tracked table OIDs on ROLLBACK TO so that a subsequent COMMIT can register writes made before the savepoint. Limitation: The retained list also includes writes undone by ROLLBACK TO. A subsequent COMMIT can therefore cause reads of those tables to be routed to the primary unnecessarily. --- src/context/pool_query_context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/context/pool_query_context.c b/src/context/pool_query_context.c index c16cef7da..7b7d8bc2f 100644 --- a/src/context/pool_query_context.c +++ b/src/context/pool_query_context.c @@ -2026,7 +2026,7 @@ dml_adaptive(Node *node, char *query) * discard it now. */ if (!(pool_config->disable_load_balance_on_write == DLBOW_DML_ADAPTIVE_GLOBAL && - is_commit_query(node))) + (is_commit_query(node) || is_rollback_to_query(node)))) { if (session_context->transaction_temp_write_oid_list != NIL) list_free(session_context->transaction_temp_write_oid_list); -- 2.52.0