final long tc = ti.commitStatus(versionHandle, UNCOMMITTED, 0);
if (tc >= 0) {
if (tc == UNCOMMITTED) {
final long ts = vh2ts(versionHandle);
if (uncommittedTransactionTs != 0 && uncommittedTransactionTs != ts) {
throw new CorruptValueException("Multiple uncommitted versions");
}
uncommittedTransactionTs = ts;
mark(bytes, from);
marked++;
/*
* Mark the last committed version too because the
* transaction for the current version may abort
*/
if (lastVersionIndex != -1) {
mark(bytes, lastVersionIndex);
marked++;
lastVersionIndex = -1;
}
primordial = false;
} else {
if (lastVersionIndex != -1 && ti.hasConcurrentTransaction(lastVersionTc, tc)) {
mark(bytes, lastVersionIndex);
marked++;
primordial = false;
}
// Note: versions and tcs can be the same when there are
// multiple steps
assert versionHandle >= lastVersionHandle || vh2ts(versionHandle) == vh2ts(lastVersionHandle);
assert tc >= lastVersionTc || lastVersionTc == UNCOMMITTED;
lastVersionIndex = from;
lastVersionHandle = versionHandle;
lastVersionTc = tc;
}
}
from += vlength + LENGTH_PER_VERSION;
if (from > offset + length) {
throw new CorruptValueException("MVV Value is corrupt at index: " + from);
}
}
if (lastVersionIndex != -1) {
mark(bytes, lastVersionIndex);
marked++;