wchevreuil commented on a change in pull request #2191:
URL: https://github.com/apache/hbase/pull/2191#discussion_r469382747



##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceWALReader.java
##########
@@ -309,6 +310,16 @@ public WALEntryBatch poll(long timeout) throws 
InterruptedException {
     return entryBatchQueue.poll(timeout, TimeUnit.MILLISECONDS);
   }
 
+  public void clearWALEntryBatch() {

Review comment:
       We are only calling it from `ReplicationSource.terminate` (see line 
#606), after we certify that neither the shipper, nor the reader threads are 
alive anymore, so I don't think it would be an issue. Of course, there's the 
risk someone inadvertently call this method somewhere else, so maybe we should 
put a warning comment? I don't think there's any gain of synchronising accesses 
to totalBufferUsed variable here, concurrent threads could still succeed on the 
double decrement, if we call clearWALEntryBatch while shipper thread is still 
running.




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to