comnetwork commented on a change in pull request #2055:
URL: https://github.com/apache/hbase/pull/2055#discussion_r454927352



##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AsyncProtobufLogWriter.java
##########
@@ -59,7 +59,7 @@
 
   private final Class<? extends Channel> channelClass;
 
-  private AsyncFSOutput output;
+  private volatile AsyncFSOutput output;

Review comment:
       Yes ,the  problem description  is :
   
https://issues.apache.org/jira/browse/HBASE-24625?focusedCommentId=17152610&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17152610
   
   In my opinion,` AsyncProtobufLogWriter.getSyncedLength` is just meaningful 
when the WAL file is current writing, once 
   `AsyncProtobufLogWriter` is closed(BTW, `AsyncProtobufLogWriter.output` is 
null),  upperlayer code seems  no need to call this method, if upperlayer code 
still call this method after closed, it may indicates some  synchronization 
error or other.
   
    If we allow to call `getSyncedLength` after closing, we should save the 
`syncedLength` when  `AsyncProtobufLogWriter.close` , or else `getSyncedLength` 
will throw `NullPointException` or just return 0, both are unexpected and may 
cause upperlayer code error. 
   




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