Search in sources :

Example 6 with RecordStoreVersionCheck

use of org.neo4j.kernel.impl.storemigration.RecordStoreVersionCheck in project neo4j by neo4j.

the class StoreUpgraderInterruptionTestIT method tracePageCacheAccessOnIdStoreUpgrade.

@Test
public void tracePageCacheAccessOnIdStoreUpgrade() throws IOException, ConsistencyCheckIncompleteException {
    MigrationTestUtils.prepareSampleLegacyDatabase(version, fs, workingDatabaseLayout.databaseDirectory(), prepareDirectory);
    RecordStoreVersionCheck versionCheck = new RecordStoreVersionCheck(fs, pageCache, workingDatabaseLayout, NullLogProvider.getInstance(), Config.defaults(), NULL);
    MigrationProgressMonitor progressMonitor = MigrationProgressMonitor.SILENT;
    LogService logService = NullLogService.getInstance();
    var idMigratorTracer = new DefaultPageCacheTracer();
    var recordMigratorTracer = new DefaultPageCacheTracer();
    IdGeneratorMigrator idMigrator = new IdGeneratorMigrator(fs, pageCache, CONFIG, idMigratorTracer);
    assertTrue(checkNeoStoreHasFormatVersion(versionCheck, baselineFormat));
    var migrator = new RecordStorageMigrator(fs, pageCache, CONFIG, logService, jobScheduler, recordMigratorTracer, batchImporterFactory, INSTANCE);
    newUpgrader(versionCheck, progressMonitor, createIndexMigrator(), migrator, idMigrator).migrateIfNeeded(workingDatabaseLayout, false);
    assertTrue(checkNeoStoreHasFormatVersion(versionCheck, successorFormat));
    startStopDatabase(neo4jLayout.homeDirectory());
    assertConsistentStore(workingDatabaseLayout);
    assertEquals(43, idMigratorTracer.faults());
    assertEquals(83, idMigratorTracer.hits());
    assertEquals(126, idMigratorTracer.pins());
    assertEquals(126, idMigratorTracer.unpins());
    assertEquals(61, recordMigratorTracer.faults());
    assertEquals(228, recordMigratorTracer.hits());
    assertEquals(289, recordMigratorTracer.pins());
    assertEquals(289, recordMigratorTracer.unpins());
}
Also used : MigrationProgressMonitor(org.neo4j.storageengine.migration.MigrationProgressMonitor) RecordStoreVersionCheck(org.neo4j.kernel.impl.storemigration.RecordStoreVersionCheck) RecordStorageMigrator(org.neo4j.kernel.impl.storemigration.RecordStorageMigrator) IdGeneratorMigrator(org.neo4j.kernel.impl.storemigration.IdGeneratorMigrator) NullLogService(org.neo4j.logging.internal.NullLogService) LogService(org.neo4j.logging.internal.LogService) DefaultPageCacheTracer(org.neo4j.io.pagecache.tracing.DefaultPageCacheTracer) Test(org.junit.Test)

Aggregations

RecordStoreVersionCheck (org.neo4j.kernel.impl.storemigration.RecordStoreVersionCheck)6 Test (org.junit.Test)3 IdGeneratorMigrator (org.neo4j.kernel.impl.storemigration.IdGeneratorMigrator)3 RecordStorageMigrator (org.neo4j.kernel.impl.storemigration.RecordStorageMigrator)3 LogService (org.neo4j.logging.internal.LogService)3 NullLogService (org.neo4j.logging.internal.NullLogService)3 MigrationProgressMonitor (org.neo4j.storageengine.migration.MigrationProgressMonitor)3 Test (org.junit.jupiter.api.Test)2 DatabaseLayout (org.neo4j.io.layout.DatabaseLayout)2 GraphDatabaseAPI (org.neo4j.kernel.internal.GraphDatabaseAPI)2 Path (java.nio.file.Path)1 Before (org.junit.Before)1 ProgressReporter (org.neo4j.common.ProgressReporter)1 DatabaseManagementException (org.neo4j.dbms.api.DatabaseManagementException)1 IndexImporterFactory (org.neo4j.internal.batchimport.IndexImporterFactory)1 PageCache (org.neo4j.io.pagecache.PageCache)1 DefaultPageCacheTracer (org.neo4j.io.pagecache.tracing.DefaultPageCacheTracer)1 NamedDatabaseId (org.neo4j.kernel.database.NamedDatabaseId)1 RecordFormats (org.neo4j.kernel.impl.store.format.RecordFormats)1 SchemaIndexMigrator (org.neo4j.storageengine.migration.SchemaIndexMigrator)1