leanken opened a new pull request #29965:
URL: https://github.com/apache/spark/pull/29965


   ### What changes were proposed in this pull request?
   
   With following scenario when AQE is on, SQLMetrics could be incorrect.
   
   1. Stage A and B are created, and UI updated thru event 
onAdaptiveExecutionUpdate.
   2. Stage A and B are running. Subquery in stage A keep updating metrics thru 
event onAdaptiveSQLMetricUpdate.
   3. Stage B completes, while stage A's subquery is still running, updating 
metrics.
   4. Completion of stage B triggers new stage creation and UI update thru 
event onAdaptiveExecutionUpdate again (just like step 1).
   
   So decided to make a trade off of keeping more duplicate SQLMetrics without 
deleting them when AQE with newPlan updated.
   
   ### Why are the changes needed?
   
   Make SQLMetrics behavior 100% correct.
   
   
   ### Does this PR introduce any user-facing change?
   No.
   
   
   ### How was this patch tested?
   Updated SQLAppStatusListenerSuite.
   


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

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