gjacoby126 commented on pull request #860:
URL: https://github.com/apache/phoenix/pull/860#issuecomment-677833283


   @kadirozde @swaroopak - see the reference counting mechanism in 
UngroupedAggregateRegionObserver.waitForScansToFinish, which is called by 
preClose and preSplit. (Also note that it takes a lock and holds it while 
waiting for scans to finish, and that the isRegionClosingOrSplitting flag is 
always accessed using that lock, so the calls to UARO.checkForRegionClosing() 
might be waiting on it.)
   
   In the current PR, the split / close logic is divided between UARO and the 
IndexRebuild scanner, and the latter ideally shouldn't have to worry about 
that. 
   
   Wouldn't it be cleaner if, rather than passing the UARO to the IndexRebuild 
scanner, the UARO instead kept a reference to the rebuild scanner and sent it a 
kill signal in waitForScansToFinish()? Then all the places in this PR that are 
calling UARO.checkForRegionClosing() could just instead check if their kill 
flag was flipped, and shut down / send an exception as needed. We already have 
a reference counting mechanism, why not use it? 


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


Reply via email to