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()) {
|
if (storeClosing && !file.isCompactedAway()) {
|
||||||
String msg =
|
String msg =
|
||||||
"Region closing but StoreFile is in compacted list but not compacted away: " +
|
"Region closing but StoreFile is in compacted list but not compacted away: " +
|
||||||
file.getPath().getName();
|
file.getPath();
|
||||||
throw new IllegalStateException(msg);
|
throw new IllegalStateException(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2593,8 +2593,8 @@ public class HStore implements Store, HeapSize, StoreConfigInformation, Propagat
|
||||||
//and remove compacted storefiles from the region directory
|
//and remove compacted storefiles from the region directory
|
||||||
if (file.isCompactedAway() && (!file.isReferencedInReads() || storeClosing)) {
|
if (file.isCompactedAway() && (!file.isReferencedInReads() || storeClosing)) {
|
||||||
if (storeClosing && file.isReferencedInReads()) {
|
if (storeClosing && file.isReferencedInReads()) {
|
||||||
LOG.debug("Region closing but StoreFile still has references: {}",
|
LOG.warn("Region closing but StoreFile still has references: file={}, refCount={}",
|
||||||
file.getPath().getName());
|
file.getPath(), r.getRefCount());
|
||||||
}
|
}
|
||||||
// Even if deleting fails we need not bother as any new scanners won't be
|
// 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
|
// 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);
|
filesToRemove.add(file);
|
||||||
} else {
|
} else {
|
||||||
LOG.info("Can't archive compacted file " + file.getPath()
|
LOG.info("Can't archive compacted file " + file.getPath()
|
||||||
+ " because of either isCompactedAway = " + file.isCompactedAway()
|
+ " because of either isCompactedAway=" + file.isCompactedAway()
|
||||||
+ " or file has reference, isReferencedInReads = " + file.isReferencedInReads()
|
+ " or file has reference, isReferencedInReads=" + file.isReferencedInReads()
|
||||||
+ ", skipping for now.");
|
+ ", refCount=" + r.getRefCount() + ", skipping for now.");
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
String msg = "Exception while trying to close the compacted store file " +
|
String msg = "Exception while trying to close the compacted store file " +
|
||||||
file.getPath().getName();
|
file.getPath();
|
||||||
if (storeClosing) {
|
if (storeClosing) {
|
||||||
msg = "Store is closing. " + msg;
|
msg = "Store is closing. " + msg;
|
||||||
}
|
}
|
||||||
|
|
|
@ -156,6 +156,14 @@ public class StoreFileReader {
|
||||||
!isCompaction, reader.hasMVCCInfo(), readPt, scannerOrder, canOptimizeForNonNullColumn);
|
!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
|
* 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
|
* count so reader is not close until some object is holding the lock
|
||||||
|
|
Loading…
Reference in New Issue