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 2021/02/22 22:01:59 UTC

[GitHub] [hbase] sandeepvinayak commented on a change in pull request #2975: HBASE-25596: Fix NPE and avoid permanent unreplicated data due to EOF

sandeepvinayak commented on a change in pull request #2975:
URL: https://github.com/apache/hbase/pull/2975#discussion_r580623138



##########
File path: hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceWALReaderThread.java
##########
@@ -241,11 +305,22 @@ private void handleEofException(Exception e) {
           LOG.warn("Forcing removal of 0 length log in queue: " + logQueue.peek());
           lastReadPath = logQueue.remove();
           lastReadPosition = 0;
+
+          // If it was on last log in the recovered queue,
+          // the stream doesn't have more data, we should stop the reader
+          boolean hasMoreData = !logQueue.isEmpty();
+          // After we removed the WAL from the queue, we should
+          // try shipping the existing batch of entries, we do not want to reset
+          // stream since entry stream doesn't have the correct data at this point
+          isBatchQueuedToBeShipped(entryStream, batch, hasMoreData, true);

Review comment:
       This is the fix to avoid permanent data loss. 




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