shahrs87 commented on a change in pull request #3636:
URL: https://github.com/apache/hbase/pull/3636#discussion_r698581631



##########
File path: 
hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestWALRecordReader.java
##########
@@ -335,13 +342,16 @@ private void testSplitWithMovingWAL(InputSplit split, 
byte[] col1, byte[] col2)
     // Move log file to archive directory
     // While WAL record reader is open
     WALInputFormat.WALSplit split_ = (WALInputFormat.WALSplit) split;
-
     Path logFile = new Path(split_.getLogFileName());
-    Path archivedLog = AbstractFSWALProvider.getArchivedLogPath(logFile, conf);
-    boolean result = fs.rename(logFile, archivedLog);
-    assertTrue(result);
-    result = fs.exists(archivedLog);
-    assertTrue(result);
+    Path archivedLogDir = getWALArchiveDir(conf);
+    Path archivedLogLocation = new Path(archivedLogDir, logFile.getName());
+    assertNotEquals(split_.getLogFileName(), archivedLogLocation.toString());
+
+    assertTrue(fs.rename(logFile, archivedLogLocation));
+    assertTrue(fs.exists(archivedLogDir));
+    assertFalse(fs.exists(logFile));
+    // TODO: This is not behaving as expected. 
WALInputFormat#WALKeyRecordReader doesn't open

Review comment:
       This test is not testing what it is intending to.
   Before this patch, it was using` 
AbstractFSWALProvider.getArchivedLogPath(logFile, conf);` to get 
`archivedLogLocation`. But `AbstractFSWALProvider#getArchivedLogPath` was 
returning the same path as `logFile`  from 
[here](https://github.com/apache/hbase/blob/master/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/AbstractFSWALProvider.java#L498)
   
   After this patch, we are able to successfully rename the file to oldWALs 
directory but somehow it is not triggering the condition within [nextKeyValue 
method](https://github.com/apache/hbase/blob/d56db9d1b240626ecbfea7ba98658befcc162afe/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/WALInputFormat.java#L223)
 to look into archiveDir.




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