Neilk1021 opened a new pull request, #7391:
URL: https://github.com/apache/texera/pull/7391

   ### What changes were proposed in this PR?
   Closes #7031 by keeping the coordinator from sending `queryStatistics` to 
workers of a region whose teardown it has already started.                      
           
                                                                                
                                                                      
     - `RegionExecutionManager` sets an `endWorkerSentRef` flag as the first 
statement of `terminateWorkers` and exposes it as `isTerminating`, plus a 
`containsPhysicalOp` membership test. The flag is deliberately *not* derived 
from the existing `terminationFutureRef`. That reference is compared and 
swapped only after `terminateWorkersWithRetry` has been constructed, and 
constructing it already runs `terminateWorkers`.                                
                                                       
     - `WorkflowExecutionManager.isRegionTerminating(opId)` resolves an 
operator to a terminating region. Documented as must-be-called at the point of 
use rather than cached: a caller spanning several coordinator rounds would 
otherwise act on an answer from before a region started tearing down, which is 
exactly the window being   
     closed.                                                                    
                                                                                
          
     - `QueryWorkerStatisticsHandler` consults it alongside the existing 
filters and skips those operators.       
   
   ### Any related issues, documentation, discussions?
    Closes #7031.                                                               
                                                                                
         
                                                                                
                                                                                
          
    Part of #6891. This is the request-side half. #6960 fixed the reply-side 
half; the two are independent and this PR does not change anything #6960 
introduced.       
                                                                                
                                                                                
       
   
   ### How was this PR tested?
     Three unit tests added to the existing harnesses, no new harness:          
                                                                                
          
                                                                                
                                                                                
          
     - `WorkflowExecutionManagerSpec`: drives a real two-region schedule to the 
state where region 1's `EndWorker` is on the wire and unanswered, then asserts 
`isRegionTerminating` is true for that region's operator, false for the 
not-yet-started region, and still true after termination completes. It also 
asserts the  operator aggregates as `RUNNING` at that moment, which is what 
pins the point of the fix: the window is real, and the pre-existing `COMPLETED` 
skip could not have covered it.                                                 
                                                                                
                         
     - `RegionExecutionManagerSpec`: `isTerminating` is false while the region 
is merely running and observably true by the time `EndWorker` is emitted 
(checked from inside the RPC probe's callback, not merely afterwards); and a 
region recognises only its own operators.                                       
                      
                                                                                
                                                                                
          
     ```                                                                        
                                                                                
          
     sbt "WorkflowExecutionService/testOnly *RegionExecutionManagerSpec 
*WorkflowExecutionManagerSpec *PortCompletedHandlerSpec *EndHandlerSpec"        
                  
     ```                                                                        
                                                                                
          
               
   ### Was this PR authored or co-authored using generative AI tooling?
   
    Generated-by: Claude Code (Opus 5)   
   


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

Reply via email to