提交 01977633 authored 作者: Andrei Tokar's avatar Andrei Tokar

RollbackDecisionMakers adustments for the corner case of leftover map entry

上级 dea4df8f
......@@ -30,9 +30,11 @@ final class RollbackDecisionMaker extends MVMap.DecisionMaker<Object[]> {
@Override
public MVMap.Decision decide(Object[] existingValue, Object[] providedValue) {
assert decision == null;
if (existingValue == null) {
// normally existingValue will always be there except of db initialization
// where some undo log entry was captured on disk but actual map entry was not
if (existingValue != null ) {
decision = MVMap.Decision.ABORT;
} else {
VersionedValue valueToRestore = (VersionedValue) existingValue[2];
long operationId;
if (valueToRestore == null ||
......@@ -47,8 +49,8 @@ final class RollbackDecisionMaker extends MVMap.DecisionMaker<Object[]> {
listener.onRollback(map, key, previousValue, valueToRestore);
}
}
}
decision = MVMap.Decision.REMOVE;
}
return decision;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论