anoopsjohn commented on a change in pull request #1825:
URL: https://github.com/apache/hbase/pull/1825#discussion_r434081399



##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALSplitter.java
##########
@@ -285,23 +286,35 @@ boolean splitLogFile(FileStatus logfile, 
CancelableProgressable reporter) throws
         String encodedRegionNameAsStr = Bytes.toString(region);
         lastFlushedSequenceId = 
lastFlushedSequenceIds.get(encodedRegionNameAsStr);
         if (lastFlushedSequenceId == null) {
-          if (sequenceIdChecker != null) {
-            RegionStoreSequenceIds ids = 
sequenceIdChecker.getLastSequenceId(region);
-            Map<byte[], Long> maxSeqIdInStores = new 
TreeMap<>(Bytes.BYTES_COMPARATOR);
-            for (StoreSequenceId storeSeqId : ids.getStoreSequenceIdList()) {
-              maxSeqIdInStores.put(storeSeqId.getFamilyName().toByteArray(),
-                storeSeqId.getSequenceId());
+          if (!(isRegionDirPresentUnderRoot(entry.getKey().getTableName(), 
encodedRegionNameAsStr))) {

Review comment:
       Actually thought abt that and even I suggested as an option. Thought 
that will be bit more risky. Specially in case when the split/merge like ops 
happening. I feel race chances are more there. At FS level, when the region is 
created, we will have the region dir in place.
   
   On asking, HM my idea was to use a special return value when we ask HM abt 
the max flushed seqId of the region. Now we return -1 when HM dont know this 
value for this region. so if we return -2 or so, we can treat it as invalid 
region.
   
   But I felt that is more risky! 




----------------------------------------------------------------
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:
[email protected]


Reply via email to