Apache9 commented on code in PR #8611:
URL: https://github.com/apache/hbase/pull/8611#discussion_r4027513699


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java:
##########
@@ -794,8 +794,11 @@ private SyncFuture publishSyncOnRingBuffer(boolean 
forceSync) {
 
   protected SyncFuture publishSyncOnRingBuffer(long sequence, boolean 
forceSync) {
     // here we use ring buffer sequence as transaction id
-    SyncFuture syncFuture = getSyncFuture(sequence, forceSync);
+    // getSyncFuture must stay inside the try: the sequence is already 
claimed, so we must publish
+    // it even if this throws, else the consumer wedges.
+    SyncFuture syncFuture = null;
     try {
+      syncFuture = getSyncFuture(sequence, forceSync);

Review Comment:
   What exception will getSyncFuture throw? Seems the method only has memory 
operations...



##########
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/SyncFutureCache.java:
##########
@@ -57,9 +61,15 @@ public SyncFutureCache(final Configuration conf) {
   }
 
   public SyncFuture getIfPresentOrNew() {
-    // Invalidate the entry if a mapping exists. We do not want it to be 
reused at the same time.
-    SyncFuture future = syncFutureCache.asMap().remove(Thread.currentThread());
-    return (future == null) ? new SyncFuture() : future;
+    // The cache is only an allocation optimisation; never let it fail a write.
+    try {
+      // Invalidate the entry if a mapping exists. We do not want it to be 
reused at the same time.
+      SyncFuture future = 
syncFutureCache.asMap().remove(Thread.currentThread());
+      return (future == null) ? new SyncFuture() : future;
+    } catch (RuntimeException e) {

Review Comment:
   Where does the RuntimeException come from?



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