Apache9 commented on code in PR #5455:
URL: https://github.com/apache/hbase/pull/5455#discussion_r1357907959
##########
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:
You can see the analysis in this PR.
https://github.com/apache/hbase/pull/5443#issuecomment-1751996650
It will cause problem for replication. We rely on whether a WAL file is
beingWritten to determine whether we can move on to the next file. If we miss a
WAL here but the WAL file has been put into the replication queue, we could get
beingWritten == false but actually the file is beingWritten, which causes
unexpected behavior...
--
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]