shahrs87 commented on a change in pull request #3504:
URL: https://github.com/apache/hbase/pull/3504#discussion_r673956488
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceWALReader.java
##########
@@ -274,11 +275,14 @@ private boolean handleEofException(Exception e,
WALEntryBatch batch) {
// since we don't add current log to recovered source queue so it is safe
to remove.
if ((e instanceof EOFException || e.getCause() instanceof EOFException) &&
(source.isRecovered() || queue.size() > 1) && this.eofAutoRecovery) {
- Path head = queue.peek();
+ Path path = queue.peek();
try {
- if (fs.getFileStatus(head).getLen() == 0) {
- // head of the queue is an empty log file
- LOG.warn("Forcing removal of 0 length log in queue: {}", head);
+ if (!fs.exists(path)) {
+ // There is a chance that wal has moved to oldWALs directory, so
look there also.
+ path = AbstractFSWALProvider.getArchivedLogPath(path, conf);
Review comment:
Thank you @Apache9 for the feedback. I added a new util method in
AbstractFSWALProvider to look into both the oldWALs path if it can't find the
log in WALs directory.
After the change, there are 2 methods in `AbstractFSWALProvider` now to get
archiveLog path:
1. `getArchivedLog` This is the method added by this patch.
2. `getArchivedLogPath` This was already present which looks into separate
oldLogDir path based on config.
I think we can remove `getArchivedLogPath` method and replace all callers
with getArchivedLog. WDYT ?
--
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]