use of org.neo4j.index.internal.gbptree.LayoutBootstrapper in project neo4j by neo4j.
the class ConsistencyCheckWithCorruptGBPTreeIT method corruptionInCountsStore.
@Test
void corruptionInCountsStore() throws Exception {
MutableObject<Long> rootNode = new MutableObject<>();
Path countsStoreFile = countsStoreFile();
final LayoutBootstrapper countsLayoutBootstrapper = (indexFile, pageCache, meta) -> new CountsLayout();
corruptIndexes(fs, readOnly(), (tree, inspection) -> {
rootNode.setValue(inspection.getRootNode());
tree.unsafe(pageSpecificCorruption(rootNode.getValue(), GBPTreeCorruption.broken(GBPTreePointerType.leftSibling())), CursorContext.NULL);
}, countsLayoutBootstrapper, countsStoreFile);
ConsistencyFlags flags = new ConsistencyFlags(false, false, true);
ConsistencyCheckService.Result result = runConsistencyCheck(NullLogProvider.getInstance(), flags);
assertFalse(result.isSuccessful());
assertResultContainsMessage(result, "Index inconsistency: Broken pointer found in tree node " + rootNode.getValue() + ", pointerType='left sibling'");
assertResultContainsMessage(result, "Number of inconsistent COUNTS records: 1");
}
use of org.neo4j.index.internal.gbptree.LayoutBootstrapper in project neo4j by neo4j.
the class ConsistencyCheckWithCorruptGBPTreeIT method corruptionInIdGenerator.
@Test
void corruptionInIdGenerator() throws Exception {
MutableObject<Long> rootNode = new MutableObject<>();
Path[] idStoreFiles = idStoreFiles();
final LayoutBootstrapper countsLayoutBootstrapper = (indexFile, pageCache, meta) -> new CountsLayout();
corruptIndexes(fs, readOnly(), (tree, inspection) -> {
rootNode.setValue(inspection.getRootNode());
tree.unsafe(pageSpecificCorruption(rootNode.getValue(), GBPTreeCorruption.broken(GBPTreePointerType.leftSibling())), CursorContext.NULL);
}, idStoreFiles);
ConsistencyFlags flags = new ConsistencyFlags(false, false, true);
ConsistencyCheckService.Result result = runConsistencyCheck(NullLogProvider.getInstance(), flags);
assertFalse(result.isSuccessful());
assertResultContainsMessage(result, "Index inconsistency: Broken pointer found in tree node " + rootNode.getValue() + ", pointerType='left sibling'");
assertResultContainsMessage(result, "Number of inconsistent ID_STORE records: " + idStoreFiles.length);
}
Aggregations