HBASE-10370 Compaction in out-of-date Store causes region split failure, fix only

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1559277 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Zhihong Yu 2014-01-17 23:12:01 +00:00
parent c27bfd6acc
commit bebb59dc10
1 changed files with 8 additions and 0 deletions

View File

@ -1345,6 +1345,14 @@ public class HRegion implements HeapSize { // , Writable{
// block waiting for the lock for compaction // block waiting for the lock for compaction
lock.readLock().lock(); lock.readLock().lock();
try { try {
byte[] cf = Bytes.toBytes(store.getColumnFamilyName());
if (stores.get(cf) != store) {
LOG.warn("Store " + store.getColumnFamilyName() + " on region " + this
+ " has been re-instantiated, cancel this compaction request. "
+ " It may be caused by the roll back of split transaction");
return false;
}
status = TaskMonitor.get().createStatus("Compacting " + store + " in " + this); status = TaskMonitor.get().createStatus("Compacting " + store + " in " + this);
if (this.closed.get()) { if (this.closed.get()) {
String msg = "Skipping compaction on " + this + " because closed"; String msg = "Skipping compaction on " + this + " because closed";