From b98eb345d57ded8cfed0557a12d4cc236261dd14 Mon Sep 17 00:00:00 2001 From: Yang Xiufeng Date: Wed, 22 May 2024 09:33:28 +0800 Subject: [PATCH] fix: TxnManager with state AutoCommit should not be saved in http manager. --- src/query/service/src/servers/http/v1/query/http_query.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/query/service/src/servers/http/v1/query/http_query.rs b/src/query/service/src/servers/http/v1/query/http_query.rs index 1783b3cac1d1..f3f298f69155 100644 --- a/src/query/service/src/servers/http/v1/query/http_query.rs +++ b/src/query/service/src/servers/http/v1/query/http_query.rs @@ -588,7 +588,8 @@ impl HttpQuery { let role = session_state.current_role.clone(); let secondary_roles = session_state.secondary_roles.clone(); let txn_state = session_state.txn_manager.lock().state(); - if !self.is_txn_mgr_saved.load(Ordering::Relaxed) + if txn_state != TxnState::AutoCommit + && !self.is_txn_mgr_saved.load(Ordering::Relaxed) && matches!(executor.state, ExecuteState::Stopped(_)) && self .is_txn_mgr_saved