* non-transactional LN, redo it.
*/
boolean processThisLN = false;
boolean lnIsCommitted = false;
boolean lnIsPrepared = false;
Txn preparedTxn = null;
if (txnId == null) {
processThisLN = true;
} else {
lnIsCommitted = committedTxnIds.contains(txnId);
if (!lnIsCommitted) {
preparedTxn = (Txn) preparedTxns.get(txnId);
lnIsPrepared = preparedTxn != null;
}
if (lnIsCommitted || lnIsPrepared) {
processThisLN = true;
}
}
if (processThisLN) {
/* Invoke the evictor to reduce memory consumption. */
env.invokeEvictor();
LN ln = reader.getLN();
DatabaseId dbId = reader.getDatabaseId();
DatabaseImpl db = dbMapTree.getDb(dbId);
long logLsn = reader.getLastLsn();
long treeLsn = DbLsn.NULL_LSN;
/* Database may be null if it's been deleted. */
if (db != null) {
ln.postFetchInit(db, logLsn);
if (preparedTxn != null) {
preparedTxn.addLogInfo(logLsn);
/*
* We're reconstructing a prepared, but not
* finished, transaction. We know that there
* was a write lock on this LN since it exists
* in the log under this txnId.
*/
preparedTxn.lock
(ln.getNodeId(), LockType.WRITE,
false /*noWait*/, db);
preparedTxn.setPrepared(true);
}
treeLsn = redo(db,
location,
ln,