-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Checks if custom IO configurations conflict with other options.
Custom IO configurations are now supported in single instance mode. Store copy operations are not supported, and that therefore excludes using custom IO configurations in HA, online backup, and store migration. Determining if you violate these restrictions is most easily done by inspecting config options. This restriction is expected to be short lived and can be removed once store copy is supported with custom IO configurations.
- Loading branch information
Max Sumrall
committed
Apr 12, 2016
1 parent
a8f3d37
commit eb83262
Showing
4 changed files
with
209 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
community/neo4j/src/test/java/upgrade/PlatformConstraintStoreUpgradeTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Copyright (c) 2002-2016 "Neo Technology," | ||
* Network Engine for Objects in Lund AB [http://neotechnology.com] | ||
* | ||
* This file is part of Neo4j. | ||
* | ||
* Neo4j is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package upgrade; | ||
|
||
import org.junit.Rule; | ||
import org.junit.Test; | ||
|
||
import org.neo4j.graphdb.factory.GraphDatabaseBuilder; | ||
import org.neo4j.graphdb.factory.GraphDatabaseFactory; | ||
import org.neo4j.graphdb.factory.GraphDatabaseSettings; | ||
import org.neo4j.kernel.configuration.Settings; | ||
import org.neo4j.test.TargetDirectory; | ||
import org.neo4j.test.TestGraphDatabaseFactory; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
import static org.junit.Assert.fail; | ||
|
||
public class PlatformConstraintStoreUpgradeTest | ||
{ | ||
@Rule | ||
public TargetDirectory.TestDirectory storeDir = TargetDirectory.testDirForTest( getClass() ); | ||
|
||
@Test | ||
public void shouldFailToStartIfConfiguredForCAPIDeviceTest() | ||
{ | ||
GraphDatabaseBuilder gdBuilder = | ||
new TestGraphDatabaseFactory().newEmbeddedDatabaseBuilder( storeDir.graphDbDir() ); | ||
gdBuilder.setConfig( GraphDatabaseSettings.allow_store_upgrade, Settings.TRUE ) | ||
.setConfig( GraphDatabaseSettings.pagecache_swapper, "custom" ); | ||
try | ||
{ | ||
gdBuilder.newGraphDatabase(); | ||
fail( "Should not have created database with custom IO configuration and Store Upgrade." ); | ||
} | ||
catch ( RuntimeException ex ) | ||
{ | ||
// good | ||
assertEquals( "Store upgrade not allowed with custom IO integrations", ex.getMessage() ); | ||
} | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
enterprise/backup/src/test/java/org/neo4j/backup/PlatformConstraintBackupTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Copyright (c) 2002-2016 "Neo Technology," | ||
* Network Engine for Objects in Lund AB [http://neotechnology.com] | ||
* | ||
* This file is part of Neo4j. | ||
* | ||
* Neo4j is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as | ||
* published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package org.neo4j.backup; | ||
|
||
import org.junit.Rule; | ||
import org.junit.Test; | ||
|
||
import org.neo4j.cluster.ClusterSettings; | ||
import org.neo4j.graphdb.factory.GraphDatabaseBuilder; | ||
import org.neo4j.graphdb.factory.GraphDatabaseFactory; | ||
import org.neo4j.graphdb.factory.GraphDatabaseSettings; | ||
import org.neo4j.kernel.configuration.Settings; | ||
import org.neo4j.test.TargetDirectory; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
import static org.junit.Assert.fail; | ||
|
||
public class PlatformConstraintBackupTest | ||
{ | ||
@Rule | ||
public TargetDirectory.TestDirectory storeDir = TargetDirectory.testDirForTest( getClass() ); | ||
|
||
@Test | ||
public void shouldFailToStartIfConfiguredForCAPIDeviceTest() | ||
{ | ||
GraphDatabaseFactory graphDatabaseFactory = new GraphDatabaseFactory(); | ||
GraphDatabaseBuilder gdBuilder = graphDatabaseFactory.newEmbeddedDatabaseBuilder( storeDir.graphDbDir() ); | ||
gdBuilder.setConfig( OnlineBackupSettings.online_backup_enabled, Settings.TRUE ) | ||
.setConfig( GraphDatabaseSettings.pagecache_swapper, "custom" ); | ||
try | ||
{ | ||
gdBuilder.newGraphDatabase(); | ||
fail( "Should not have created database with custom IO configuration and Online Backup." ); | ||
} | ||
catch ( RuntimeException ex ) | ||
{ | ||
// good | ||
assertEquals( "Online Backup not allowed with custom IO integration", ex.getMessage() ); | ||
} | ||
} | ||
} |
62 changes: 62 additions & 0 deletions
62
...a/src/test/java/org/neo4j/graphdb/factory/PlatformConstraintGraphDatabaseFactoryTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* Copyright (c) 2002-2016 "Neo Technology," | ||
* Network Engine for Objects in Lund AB [http://neotechnology.com] | ||
* | ||
* This file is part of Neo4j. | ||
* | ||
* Neo4j is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as | ||
* published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package org.neo4j.graphdb.factory; | ||
|
||
import org.junit.Rule; | ||
import org.junit.Test; | ||
|
||
import java.io.File; | ||
|
||
import org.neo4j.cluster.ClusterSettings; | ||
import org.neo4j.graphdb.GraphDatabaseService; | ||
import org.neo4j.kernel.api.index.PreexistingIndexEntryConflictException; | ||
import org.neo4j.kernel.configuration.Config; | ||
import org.neo4j.kernel.ha.HaSettings; | ||
import org.neo4j.kernel.ha.HighlyAvailableGraphDatabase; | ||
import org.neo4j.test.TargetDirectory; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
import static org.junit.Assert.fail; | ||
|
||
public class PlatformConstraintGraphDatabaseFactoryTest | ||
{ | ||
@Rule | ||
public TargetDirectory.TestDirectory storeDir = TargetDirectory.testDirForTest( getClass() ); | ||
|
||
@Test | ||
public void shouldFailToStartIfConfiguredForCAPIDeviceTest() | ||
{ | ||
GraphDatabaseBuilder graphDatabaseBuilder = new HighlyAvailableGraphDatabaseFactory(). | ||
newEmbeddedDatabaseBuilder( storeDir.graphDbDir() ) | ||
.setConfig( GraphDatabaseSettings.pagecache_swapper, "custom" ) | ||
.setConfig( ClusterSettings.initial_hosts, "127.0.0.1:5001" ) | ||
.setConfig( ClusterSettings.server_id, "1" ); | ||
try | ||
{ | ||
graphDatabaseBuilder.newGraphDatabase(); | ||
fail( "Should not have created database with custom IO configuration and HA mode." ); | ||
} | ||
catch ( RuntimeException ex ) | ||
{ | ||
// good | ||
assertEquals( "HA mode not allowed with custom IO integrations", ex.getMessage() ); | ||
} | ||
} | ||
} |