HBASE-4997 SplitLogManager can have a race on batch.installed
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1213479 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
fba66ac5f2
commit
4b8eb16ea9
|
@ -351,9 +351,7 @@ public class SplitLogManager extends ZooKeeperListener {
|
|||
} else {
|
||||
task.batch.error++;
|
||||
}
|
||||
if ((task.batch.done + task.batch.error) == task.batch.installed) {
|
||||
task.batch.notify();
|
||||
}
|
||||
task.batch.notify();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -607,9 +605,9 @@ public class SplitLogManager extends ZooKeeperListener {
|
|||
// a single thread touches batch.installed.
|
||||
oldtask = tasks.putIfAbsent(path, new Task(batch));
|
||||
if (oldtask != null) {
|
||||
// new task was not used.
|
||||
batch.installed--;
|
||||
synchronized (oldtask) {
|
||||
// new task was not used.
|
||||
batch.installed--;
|
||||
if (oldtask.isOrphan()) {
|
||||
if (oldtask.deleted) {
|
||||
// The task is already done. Do not install the batch for this
|
||||
|
@ -618,12 +616,12 @@ public class SplitLogManager extends ZooKeeperListener {
|
|||
// this task to complete.
|
||||
return (null);
|
||||
}
|
||||
LOG.info("Previously orphan task " + path +
|
||||
" is now being waited upon");
|
||||
oldtask.setBatch(batch);
|
||||
return (null);
|
||||
}
|
||||
}
|
||||
LOG.info("Previously orphan task " + path +
|
||||
" is now being waited upon");
|
||||
return (null);
|
||||
}
|
||||
return oldtask;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue