HBASE-4563 When error occurs in this.parent.close(false) of split, the split region cannot write or read

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1185005 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
larsh 2011-10-17 05:08:49 +00:00
parent c89957e92a
commit ef6a0f9db3
2 changed files with 17 additions and 11 deletions

View File

@ -734,6 +734,8 @@ Release 0.90.5 - Unreleased
HBASE-4537 TestUser imports breaking build against secure Hadoop
HBASE-4501 [replication] Shutting down a stream leaves recovered
sources running
HBASE-4563 When error occurs in this.parent.close(false) of split,
the split region cannot write or read (bluedavy via Lars H)
IMPROVEMENT
HBASE-4205 Enhance HTable javadoc (Eric Charles)

View File

@ -246,18 +246,22 @@ public class SplitTransaction {
createSplitDir(this.parent.getFilesystem(), this.splitdir);
this.journal.add(JournalEntry.CREATE_SPLIT_DIR);
List<StoreFile> hstoreFilesToSplit = this.parent.close(false);
if (hstoreFilesToSplit == null) {
// The region was closed by a concurrent thread. We can't continue
// with the split, instead we must just abandon the split. If we
// reopen or split this could cause problems because the region has
// probably already been moved to a different server, or is in the
// process of moving to a different server.
throw new IOException("Failed to close region: already closed by " +
"another thread");
List<StoreFile> hstoreFilesToSplit = null;
try{
hstoreFilesToSplit = this.parent.close(false);
if (hstoreFilesToSplit == null) {
// The region was closed by a concurrent thread. We can't continue
// with the split, instead we must just abandon the split. If we
// reopen or split this could cause problems because the region has
// probably already been moved to a different server, or is in the
// process of moving to a different server.
throw new IOException("Failed to close region: already closed by " +
"another thread");
}
} finally {
this.journal.add(JournalEntry.CLOSED_PARENT_REGION);
}
this.journal.add(JournalEntry.CLOSED_PARENT_REGION);
if (!testing) {
services.removeFromOnlineRegions(this.parent.getRegionInfo().getEncodedName());