use of org.neo4j.kernel.impl.transaction.log.files.LogTailInformation in project neo4j by neo4j.
the class AbstractLogTailScannerTest method twoLogFilesNoCheckPointsTwoCommits.
@ParameterizedTest
@MethodSource("params")
void twoLogFilesNoCheckPointsTwoCommits(int startLogVersion, int endLogVersion) {
// given
long txId = 21;
setupLogFiles(endLogVersion, logFile(), logFile(start(), commit(txId), start(), commit(txId + 1)));
// when
LogTailInformation logTailInformation = logFiles.getTailInformation();
// then
assertLatestCheckPoint(false, true, txId, false, logTailInformation);
}
use of org.neo4j.kernel.impl.transaction.log.files.LogTailInformation in project neo4j by neo4j.
the class AbstractLogTailScannerTest method olderLogFileContainingAStartAndNewerFileContainingACheckPointPointingToALaterPositionThanStart.
@ParameterizedTest
@MethodSource("params")
void olderLogFileContainingAStartAndNewerFileContainingACheckPointPointingToALaterPositionThanStart(int startLogVersion, int endLogVersion) {
// given
PositionEntry position = position();
setupLogFiles(endLogVersion, logFile(start(), commit(3), position), logFile(checkPoint(position)));
// when
LogTailInformation logTailInformation = logFiles.getTailInformation();
// then
assertLatestCheckPoint(true, false, NO_TRANSACTION_ID, false, logTailInformation);
}
use of org.neo4j.kernel.impl.transaction.log.files.LogTailInformation in project neo4j by neo4j.
the class AbstractLogTailScanner method checkpointTailInformation.
LogTailInformation checkpointTailInformation(long highestLogVersion, LogEntryStart latestStartEntry, long oldestVersionFound, byte latestLogEntryVersion, CheckpointInfo latestCheckPoint, boolean corruptedTransactionLogs, StoreId storeId) throws IOException {
LogPosition checkPointLogPosition = latestCheckPoint.getTransactionLogPosition();
InlinedLogTailScanner.ExtractedTransactionRecord transactionRecord = extractFirstTxIdAfterPosition(checkPointLogPosition, highestLogVersion);
long firstTxIdAfterPosition = transactionRecord.getId();
boolean startRecordAfterCheckpoint = (firstTxIdAfterPosition != NO_TRANSACTION_ID) || ((latestStartEntry != null) && (latestStartEntry.getStartPosition().compareTo(latestCheckPoint.getTransactionLogPosition()) >= 0));
boolean corruptedLogs = transactionRecord.isFailure() || corruptedTransactionLogs;
return new LogTailInformation(latestCheckPoint, corruptedLogs || startRecordAfterCheckpoint, firstTxIdAfterPosition, oldestVersionFound == UNKNOWN, highestLogVersion, latestLogEntryVersion, storeId);
}
use of org.neo4j.kernel.impl.transaction.log.files.LogTailInformation in project neo4j by neo4j.
the class AbstractLogTailScannerTest method latestLogFileContainingMultipleCheckPointsOneStartInBetween.
@ParameterizedTest
@MethodSource("params")
void latestLogFileContainingMultipleCheckPointsOneStartInBetween(int startLogVersion, int endLogVersion) {
// given
setupLogFiles(endLogVersion, logFile(checkPoint(), start(), commit(1), checkPoint()));
// when
LogTailInformation logTailInformation = logFiles.getTailInformation();
// then
assertLatestCheckPoint(true, false, NO_TRANSACTION_ID, false, logTailInformation);
}
use of org.neo4j.kernel.impl.transaction.log.files.LogTailInformation in project neo4j by neo4j.
the class AbstractLogTailScannerTest method bigFileLatestCheckpointFindsStartAfter.
@ParameterizedTest
@MethodSource("params")
void bigFileLatestCheckpointFindsStartAfter(int startLogVersion, int endLogVersion) throws IOException {
long firstTxAfterCheckpoint = Integer.MAX_VALUE + 4L;
InlinedLogTailScanner tailScanner = new FirstTxIdConfigurableTailScanner(firstTxAfterCheckpoint, logFiles, reader, monitors);
LogEntryStart startEntry = new LogEntryStart(3L, 4L, 0, new byte[] { 5, 6 }, new LogPosition(endLogVersion, Integer.MAX_VALUE + 17L));
CheckpointInfo checkPoint = new CheckpointInfo(new LogPosition(endLogVersion, 16L), StoreId.UNKNOWN, LogPosition.UNSPECIFIED);
LogTailInformation logTailInformation = tailScanner.checkpointTailInformation(endLogVersion, startEntry, endLogVersion, (byte) -1, checkPoint, false, StoreId.UNKNOWN);
assertLatestCheckPoint(true, true, firstTxAfterCheckpoint, false, logTailInformation);
}
Aggregations