github-actions[bot] commented on code in PR #68658:
URL: https://github.com/apache/doris/pull/68658#discussion_r4177011258


##########
fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java:
##########
@@ -1141,10 +1166,19 @@ private void parseByNereids() {
     }
 
     public void finalizeQuery() {
-        // The final profile report occurs after be returns the query data, 
and the profile cannot be
-        // received after unregisterQuery(), causing the instance profile to 
be lost, so we should wait
-        // for the profile before unregisterQuery().
-        updateProfile(true);
+        finalizeQuery(false);
+    }
+
+    void finalizeQuery(boolean willRetry) {
+        if (willRetry) {
+            // Keep the statement open and its cumulative elapsed time, but 
discard the abandoned
+            // attempt so query retention and merged profiles only use the 
final execution profile.
+            profile.clearExecutionProfiles();

Review Comment:
   [P2] Clear derived row counts when discarding an inner retry attempt. A live 
profile read after the first dispatch can populate `rowsProducedMap` and write 
`actualRows` into this same planner's physical plan. If a later `getNext()` RPC 
error triggers an inner retry, this call removes the failed execution but 
leaves those derived values. The next attempt reuses the plan, and merged 
rendering only `putAll`s new counters, so nodes without a new report still show 
the failed attempt's rows. Reset both the cached rows and the reused plan's 
actual-row statistics, and cover a retry after rendering the first attempt.



-- 
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