DatabaseId dbIdToReset = null;
long fileNumToReset = -1;
/* Process LN types. */
if (fromLogType.isLNType()) {
LNLogEntry lnEntry = (LNLogEntry) targetLogEntry;
if (fromLogType.equals(LogEntryType.LOG_MAPLN) ||
fromLogType.equals(LogEntryType.LOG_MAPLN_TRANSACTIONAL)) {
MapLN mapLN = (MapLN) lnEntry.getMainItem();
DatabaseId dbId = mapLN.getDatabase().getId();
/* Track latest DB ID. */
long 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());
}
/* Track latest txn ID. */
if (fromLogType.isTransactional()) {
long txnId = lnEntry.getTxnId().longValue();
maxTxnId = (txnId > maxTxnId) ? txnId : maxTxnId;
minReplicatedTxnId = (txnId < minReplicatedTxnId) ?
txnId : minReplicatedTxnId;
}
/*
* When a FileSummaryLN is encountered, reset the tracked summary
* for that file. This clears what we accummulated previously for
* the file during this recovery pass.
*/
if (LogEntryType.LOG_FILESUMMARYLN.equals(fromLogType)) {
lnEntry.postFetchInit(false /*isDupDb*/);
byte[] keyBytes = lnEntry.getKey();
FileSummaryLN fsln = (FileSummaryLN) lnEntry.getMainItem();
long fileNum = fsln.getFileNumber(keyBytes);
fileNumToReset = fileNum;
/* Save the LSN of the FileSummaryLN for use by undo/redo. */
tracker.saveLastLoggedFileSummaryLN(fileNum, getLastLsn());