private void readINsAndTrackIds(long rollForwardLsn,
LevelRecorder recorder,
StartupTracker.Counter counter)
throws DatabaseException {
INFileReader reader =
new INFileReader(envImpl,
readBufferSize,
rollForwardLsn, // start lsn
info.nextAvailableLsn, // end lsn
true, // track node and db ids
false, // map db only
info.partialCheckpointStartLsn,
info.checkpointEndLsn,
tracker,
logVersion8UpgradeDbs);
reader.addTargetType(LogEntryType.LOG_IN);
reader.addTargetType(LogEntryType.LOG_BIN);
reader.addTargetType(LogEntryType.LOG_BIN_DELTA);
/* Validate all entries in at least one full recovery pass. */
reader.setAlwaysValidateChecksum(true);
try {
DbTree dbMapTree = envImpl.getDbTree();
/* Process every IN and BIN in the mapping tree. */
while (reader.readNextEntry()) {
counter.incNumRead();
DatabaseId dbId = reader.getDatabaseId();
if (dbId.equals(DbTree.ID_DB_ID)) {
DatabaseImpl db = dbMapTree.getDb(dbId);
try {
replayOneIN(reader, db, false, recorder);
counter.incNumProcessed();
} finally {
dbMapTree.releaseDb(db);
}
}
}
counter.setRepeatIteratorReads(reader.getNRepeatIteratorReads());
/*
* Update node ID, database ID, and txn ID sequences. Use either
* the maximum of the IDs seen by the reader vs. the IDs stored in
* the checkpoint.
*/
info.useMinReplicatedNodeId = reader.getMinReplicatedNodeId();
info.useMaxNodeId = reader.getMaxNodeId();
info.useMinReplicatedDbId = reader.getMinReplicatedDbId();
info.useMaxDbId = reader.getMaxDbId();
info.useMinReplicatedTxnId = reader.getMinReplicatedTxnId();
info.useMaxTxnId = reader.getMaxTxnId();
if (info.checkpointEnd != null) {
CheckpointEnd ckptEnd = info.checkpointEnd;
if (info.useMinReplicatedNodeId >
ckptEnd.getLastReplicatedNodeId()) {
info.useMinReplicatedNodeId =
ckptEnd.getLastReplicatedNodeId();
}
if (info.useMaxNodeId < ckptEnd.getLastLocalNodeId()) {
info.useMaxNodeId = ckptEnd.getLastLocalNodeId();
}
if (info.useMinReplicatedDbId >
ckptEnd.getLastReplicatedDbId()) {
info.useMinReplicatedDbId =
ckptEnd.getLastReplicatedDbId();
}
if (info.useMaxDbId < ckptEnd.getLastLocalDbId()) {
info.useMaxDbId = ckptEnd.getLastLocalDbId();
}
if (info.useMinReplicatedTxnId >
ckptEnd.getLastReplicatedTxnId()) {
info.useMinReplicatedTxnId =
ckptEnd.getLastReplicatedTxnId();
}
if (info.useMaxTxnId < ckptEnd.getLastLocalTxnId()) {
info.useMaxTxnId = ckptEnd.getLastLocalTxnId();
}
}
envImpl.getNodeSequence().
setLastNodeId(info.useMinReplicatedNodeId, info.useMaxNodeId);
envImpl.getDbTree().setLastDbId(info.useMinReplicatedDbId,
info.useMaxDbId);
envImpl.getTxnManager().setLastTxnId(info.useMinReplicatedTxnId,
info.useMaxTxnId);
info.vlsnProxy = reader.getVLSNProxy();
} catch (Exception e) {
traceAndThrowException(reader.getLastLsn(), "readMapIns", e);
}
}