Search in sources :

Example 26 with LogTailInformation

use of org.neo4j.kernel.impl.transaction.log.files.LogTailInformation in project neo4j by neo4j.

the class AbstractLogTailScannerTest method twoLogFilesStartAndCommitInDifferentFiles.

@ParameterizedTest
@MethodSource("params")
void twoLogFilesStartAndCommitInDifferentFiles(int startLogVersion, int endLogVersion) {
    // given
    long txId = 6;
    setupLogFiles(endLogVersion, logFile(start()), logFile(commit(txId)));
    // when
    LogTailInformation logTailInformation = logFiles.getTailInformation();
    // then
    assertLatestCheckPoint(false, true, 6, false, logTailInformation);
}
Also used : LogTailInformation(org.neo4j.kernel.impl.transaction.log.files.LogTailInformation) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 27 with LogTailInformation

use of org.neo4j.kernel.impl.transaction.log.files.LogTailInformation in project neo4j by neo4j.

the class AbstractLogTailScannerTest method twoLogFilesNoCheckPointsOneStartWithoutCommit.

@ParameterizedTest
@MethodSource("params")
void twoLogFilesNoCheckPointsOneStartWithoutCommit(int startLogVersion, int endLogVersion) {
    // given
    setupLogFiles(endLogVersion, logFile(), logFile(start()));
    // when
    LogTailInformation logTailInformation = logFiles.getTailInformation();
    // then
    assertLatestCheckPoint(false, true, NO_TRANSACTION_ID, false, logTailInformation);
}
Also used : LogTailInformation(org.neo4j.kernel.impl.transaction.log.files.LogTailInformation) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 28 with LogTailInformation

use of org.neo4j.kernel.impl.transaction.log.files.LogTailInformation in project neo4j by neo4j.

the class AbstractLogTailScannerTest method olderLogFileContainingACheckPointAndNewerFileContainingAStart.

@ParameterizedTest
@MethodSource("params")
void olderLogFileContainingACheckPointAndNewerFileContainingAStart(int startLogVersion, int endLogVersion) {
    // given
    long txId = 11;
    StartEntry start = start();
    setupLogFiles(endLogVersion, logFile(checkPoint()), logFile(start, commit(txId)));
    // when
    LogTailInformation logTailInformation = logFiles.getTailInformation();
    // then
    assertLatestCheckPoint(true, true, txId, false, logTailInformation);
}
Also used : LogTailInformation(org.neo4j.kernel.impl.transaction.log.files.LogTailInformation) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 29 with LogTailInformation

use of org.neo4j.kernel.impl.transaction.log.files.LogTailInformation in project neo4j by neo4j.

the class AbstractLogTailScannerTest method detectMissingLogFiles.

@Test
void detectMissingLogFiles() {
    LogTailInformation tailInformation = logFiles.getTailInformation();
    assertTrue(tailInformation.logsMissing());
    assertTrue(tailInformation.isRecoveryRequired());
}
Also used : LogTailInformation(org.neo4j.kernel.impl.transaction.log.files.LogTailInformation) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 30 with LogTailInformation

use of org.neo4j.kernel.impl.transaction.log.files.LogTailInformation in project neo4j by neo4j.

the class AbstractLogTailScannerTest method oneLogFileNoCheckPoints.

@ParameterizedTest
@MethodSource("params")
void oneLogFileNoCheckPoints(int startLogVersion, int endLogVersion) {
    // given
    setupLogFiles(endLogVersion, logFile());
    // when
    LogTailInformation logTailInformation = logFiles.getTailInformation();
    // then
    assertLatestCheckPoint(false, false, NO_TRANSACTION_ID, false, logTailInformation);
    assertFalse(logTailInformation.logsMissing());
}
Also used : LogTailInformation(org.neo4j.kernel.impl.transaction.log.files.LogTailInformation) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Aggregations

LogTailInformation (org.neo4j.kernel.impl.transaction.log.files.LogTailInformation)34 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)24 MethodSource (org.junit.jupiter.params.provider.MethodSource)23 LogPosition (org.neo4j.kernel.impl.transaction.log.LogPosition)7 Test (org.junit.jupiter.api.Test)6 Path (java.nio.file.Path)3 UnderlyingStorageException (org.neo4j.exceptions.UnderlyingStorageException)2 LogEntryStart (org.neo4j.kernel.impl.transaction.log.entry.LogEntryStart)2 LogFiles (org.neo4j.kernel.impl.transaction.log.files.LogFiles)2 CheckpointInfo (org.neo4j.kernel.impl.transaction.log.files.checkpoint.CheckpointInfo)2 ClosedByInterruptException (java.nio.channels.ClosedByInterruptException)1 DatabaseLayout (org.neo4j.io.layout.DatabaseLayout)1 LogEntryCursor (org.neo4j.kernel.impl.transaction.log.LogEntryCursor)1 LogVersionedStoreChannel (org.neo4j.kernel.impl.transaction.log.LogVersionedStoreChannel)1 ReadAheadLogChannel (org.neo4j.kernel.impl.transaction.log.ReadAheadLogChannel)1 LogEntry (org.neo4j.kernel.impl.transaction.log.entry.LogEntry)1 LogEntryCommit (org.neo4j.kernel.impl.transaction.log.entry.LogEntryCommit)1 LogEntryInlinedCheckPoint (org.neo4j.kernel.impl.transaction.log.entry.LogEntryInlinedCheckPoint)1 LogHeader (org.neo4j.kernel.impl.transaction.log.entry.LogHeader)1 LogFile (org.neo4j.kernel.impl.transaction.log.files.LogFile)1