Skip to content

Commit

Permalink
Fix failing ReadReplicaReplicationIT test for blockdevice
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvest committed Jan 30, 2017
1 parent c7ad670 commit 8a469fd
Showing 1 changed file with 6 additions and 9 deletions.
Expand Up @@ -227,10 +227,10 @@ public void shouldShutdownRatherThanPullUpdatesFromCoreMemberWithDifferentStoreI
ReadReplica readReplica = cluster.addReadReplicaWithId( 4 );
readReplica.start();
readReplica.database().beginTx().close();
readReplica.shutdown();

// Change the store id, so it should fail to join the cluster again
changeStoreId( readReplica.storeDir() );
changeStoreId( readReplica );
readReplica.shutdown();

try
{
Expand Down Expand Up @@ -409,14 +409,11 @@ private boolean readReplicasUpToDateAsTheLeader( CoreClusterMember leader,
.reduce( true, ( acc, txId ) -> acc && txId == leaderTxId, Boolean::logicalAnd );
}

private void changeStoreId( File storeDir ) throws IOException
private void changeStoreId( ReadReplica replica ) throws IOException
{
File neoStoreFile = new File( storeDir, MetaDataStore.DEFAULT_NAME );
try ( FileSystemAbstraction fileSystem = new DefaultFileSystemAbstraction();
PageCache pageCache = StandalonePageCacheFactory.createPageCache( fileSystem ) )
{
MetaDataStore.setRecord( pageCache, neoStoreFile, TIME, System.currentTimeMillis() );
}
File neoStoreFile = new File( replica.storeDir(), MetaDataStore.DEFAULT_NAME );
PageCache pageCache = replica.database().getDependencyResolver().resolveDependency( PageCache.class );
MetaDataStore.setRecord( pageCache, neoStoreFile, TIME, System.currentTimeMillis() );
}

private long lastClosedTransactionId( boolean fail, GraphDatabaseFacade db )
Expand Down

0 comments on commit 8a469fd

Please sign in to comment.