*/
long undoLsn = lastLoggedLsn;
try {
lastValidVLSN = VLSN.NULL_VLSN;
while (undoLsn != DbLsn.NULL_LSN) {
WholeEntry wholeEntry =
logManager.getLogEntryAllowInvisible(undoLsn);
LNLogEntry undoEntry = (LNLogEntry) wholeEntry.getEntry();
DatabaseImpl dbImpl = getDatabaseImpl(undoEntry.getDbId());
undoEntry.postFetchInit(dbImpl);
try {
/*
* Add the LSN of the entry we're now perusing to the
* keyToLsns map.
*/
CompareSlot entrySlot = new CompareSlot(dbImpl, undoEntry);
LinkedList<Long> lsns = keyToLsns.get(entrySlot);
if (lsns == null) {
lsns = new LinkedList<Long>();
keyToLsns.put(entrySlot, lsns);
}
lsns.add(undoLsn);
/*
* If this is an entry that will be rolled back, save
* enough information to calculate the prev version.
*/
if (DbLsn.compareTo(undoLsn, matchpoint) > 0) {
chain.add(new VersionCalculator
(undoLsn,
undoEntry.getAbortLsn(),
undoEntry.getAbortKnownDeleted(),
lsns));
} else {
remainingLockedNodes.add(undoLsn);
if (lastValidVLSN != null &&
lastValidVLSN.isNull() &&
wholeEntry.getHeader().getVLSN() != null &&
!wholeEntry.getHeader().getVLSN().isNull()) {
lastValidVLSN = wholeEntry.getHeader().getVLSN();
}
}
/* Move on to the previous log entry for this txn. */
undoLsn = undoEntry.getUserTxn().getLastLsn();