GeorryHuang commented on code in PR #5455:
URL: https://github.com/apache/hbase/pull/5455#discussion_r1357860729


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/wal/AbstractWALProvider.java:
##########
@@ -150,11 +161,26 @@ private WAL getRemoteWAL(RegionInfo region, String 
peerId, String remoteWALDir)
       WAL wal = createRemoteWAL(region, 
ReplicationUtils.getRemoteWALFileSystem(conf, remoteWALDir),
         ReplicationUtils.getPeerRemoteWALDir(remoteWALDir, peerId), 
getRemoteWALPrefix(peerId),
         ReplicationUtils.SYNC_WAL_SUFFIX);
+      numRemoteWALUnderCreationLock.lock();
+      try {
+        numRemoteWALUnderCreation++;
+      } finally {
+        numRemoteWALUnderCreationLock.unlock();
+      }
       initWAL(wal);
       peerId2WAL.put(peerId, Optional.of(wal));

Review Comment:
   These code modifications look good to me, but I am not familiar with 
`AbstractWALProvider`. I have a question: What happens if a 'remoteWAL' is 
being constructed, but `getWALs()` doesn't return it? (The 'remoteWAL' being 
constructed has not been put into `peerId2WAL` yet.)



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