Amend HBASE-20704 Sometimes some compacted storefiles are not archived on region close
Forward port small logging improvements from branch-1 version of this change.
This commit is contained in:
parent
a22aec1dad
commit
101205345b
|
@ -2585,7 +2585,7 @@ public class HStore implements Store, HeapSize, StoreConfigInformation, Propagat
|
|||
if (storeClosing && !file.isCompactedAway()) {
|
||||
String msg =
|
||||
"Region closing but StoreFile is in compacted list but not compacted away: " +
|
||||
file.getPath().getName();
|
||||
file.getPath();
|
||||
throw new IllegalStateException(msg);
|
||||
}
|
||||
|
||||
|
@ -2593,8 +2593,8 @@ public class HStore implements Store, HeapSize, StoreConfigInformation, Propagat
|
|||
//and remove compacted storefiles from the region directory
|
||||
if (file.isCompactedAway() && (!file.isReferencedInReads() || storeClosing)) {
|
||||
if (storeClosing && file.isReferencedInReads()) {
|
||||
LOG.debug("Region closing but StoreFile still has references: {}",
|
||||
file.getPath().getName());
|
||||
LOG.warn("Region closing but StoreFile still has references: file={}, refCount={}",
|
||||
file.getPath(), r.getRefCount());
|
||||
}
|
||||
// Even if deleting fails we need not bother as any new scanners won't be
|
||||
// able to use the compacted file as the status is already compactedAway
|
||||
|
@ -2605,13 +2605,13 @@ public class HStore implements Store, HeapSize, StoreConfigInformation, Propagat
|
|||
filesToRemove.add(file);
|
||||
} else {
|
||||
LOG.info("Can't archive compacted file " + file.getPath()
|
||||
+ " because of either isCompactedAway = " + file.isCompactedAway()
|
||||
+ " or file has reference, isReferencedInReads = " + file.isReferencedInReads()
|
||||
+ ", skipping for now.");
|
||||
+ " because of either isCompactedAway=" + file.isCompactedAway()
|
||||
+ " or file has reference, isReferencedInReads=" + file.isReferencedInReads()
|
||||
+ ", refCount=" + r.getRefCount() + ", skipping for now.");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
String msg = "Exception while trying to close the compacted store file " +
|
||||
file.getPath().getName();
|
||||
file.getPath();
|
||||
if (storeClosing) {
|
||||
msg = "Store is closing. " + msg;
|
||||
}
|
||||
|
|
|
@ -156,6 +156,14 @@ public class StoreFileReader {
|
|||
!isCompaction, reader.hasMVCCInfo(), readPt, scannerOrder, canOptimizeForNonNullColumn);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the ref count associated with the reader whenever a scanner associated with the
|
||||
* reader is opened.
|
||||
*/
|
||||
int getRefCount() {
|
||||
return refCount.get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicate that the scanner has started reading with this reader. We need to increment the ref
|
||||
* count so reader is not close until some object is holding the lock
|
||||
|
|
Loading…
Reference in New Issue