comnetwork edited a comment on pull request #3899:
URL: https://github.com/apache/hbase/pull/3899#issuecomment-986219358


   @apache9,thank you very much for review. In my opinion:
   1. It seems a reference count problem , the SnapshotSegmentScanner  seems 
independent of whether snapshot segment itself is closed or not, even if 
snapshot segment is closed, if there is SnapshotSegmentScanner is using,we 
could not release the MemStoreLAB of the snapshot segment.
   2. and I think that introducing another DelegateKeyValueScanner for wrapping 
SnapshotSegmentScanner is somewhat complex, because SnapshotSegmentScanner is 
only used for MemStoreSnapshot here, so seems that we create another additional 
wrapper for this snapshotSegmentScanner is somewhat complex and unnecessary 
because the lazy close logic overlaying reference count logic is much complex 
and error-prone,  just use snapshotSegmentScanner for reference logic is clear 
and simple.
   3. I find that MemStoreSnapshot.close is not always invoked under every 
situation, eg.when flushing success or failed, so I think we could remove the 
MemStoreSnapshot.close in the future to simplify the logic.
   4. The overhead of create a new SnapshotSegmentScanner every time when 
MemStoreSnapshot.getScanners is called is low.


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