You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2020/08/12 16:20:25 UTC

[GitHub] [hbase] wchevreuil commented on a change in pull request #2191: HBASE-24813 ReplicationSource should clear buffer usage on Replicatio…

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