hello-stephen commented on code in PR #70976:
URL: https://github.com/apache/doris/pull/70976#discussion_r4736631063


##########
fe/fe-core/src/main/java/org/apache/doris/qe/ConnectProcessor.java:
##########
@@ -586,6 +579,18 @@ public TMasterOpResult proxyExecute(TMasterOpRequest 
request) throws TException
         ctx.setThreadLocalInfo();
         StmtExecutor executor = null;
         try {
+            // Validate forwarded values inside the error boundary, before 
creating the executor.
+            if (request.isSetSessionVariables()) {
+                try {
+                    
ctx.getSessionVariable().setForwardedSessionVariables(request.getSessionVariables());

Review Comment:
   [P2] Preserve transaction state when rejecting forwarded variables
   
   During a rolling upgrade, an older follower can accept `SET 
data_queue_max_blocks=-1`, then `BEGIN` followed by an `INSERT ... SELECT ...`. 
This new check rejects the forwarded INSERT before `request.txnLoadInfo` is 
restored at lines 630–635, so the error response omits `txnLoadInfo`. 
`FEOpExecutor.execute()` (lines 92–97) interprets that omission as transaction 
completion and clears the caller's `TransactionEntry` even for an ERR response. 
The session silently leaves transaction mode; if a populated transaction spans 
the master upgrade, subsequent COMMIT/ROLLBACK cannot reach its staged writes. 
Preserve the incoming transaction metadata on this pre-execution failure, or 
retain the caller's entry on this error, and add a rejection test that carries 
`txnLoadInfo`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to