/*
* Process db and txn id tracking entries. Note that these entries do
* not overlap with targetLogEntry.
*/
LNLogEntry lnEntry = null;
if (dbIdTrackingEntry != null) {
/* This entry has a db id */
lnEntry = dbIdTrackingEntry;
/*
* Do a full load to get DB ID from DatabaseImpl. Note that while a
* partial read gets the database id for the database that owns
* this LN, it doesn't get the database id for the database
* contained by a MapLN. That's what we're trying to track.
*/
lnEntry.readEntry(currentEntryHeader,
entryBuffer,
true); // readFullItem
entryLoaded = true;
MapLN mapLN = (MapLN) lnEntry.getMainItem();
DatabaseId dbId = mapLN.getDatabase().getId();
int dbIdVal = dbId.getId();
maxDbId = (dbIdVal > maxDbId) ? dbIdVal : maxDbId;
minReplicatedDbId = (dbIdVal < minReplicatedDbId) ?
dbIdVal : minReplicatedDbId;
/*
* When a MapLN is encountered, reset the tracked information for
* that database. This clears what we accummulated previously for
* the database during this recovery pass.
*/
dbIdToReset = dbId;
/* Save the LSN of the MapLN for use by undo/redo. */
tracker.saveLastLoggedMapLN(dbId, getLastLsn());
}
if (txnIdTrackingEntry != null) {
/* This entry has a txn id */
if (lnEntry == null) {
/* Do a partial load since we only need the txn ID. */
lnEntry = txnIdTrackingEntry;
lnEntry.readEntry(currentEntryHeader,
entryBuffer,
false); // readFullItem
entryLoaded = true;
}
long txnId = lnEntry.getTxnId().longValue();
maxTxnId = (txnId > maxTxnId) ? txnId : maxTxnId;
minReplicatedTxnId = (txnId < minReplicatedTxnId) ?
txnId : minReplicatedTxnId;
}