Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split UnexpectedVersion exception in two
This exception was previously thrown in two cases: 1. When a store could not be opened because it had a version different from the one neo4j was expecting (tools like ConsistencyChecker would run into this) 2. Trying to upgrade a store with an unknown version (in many cases, when users are unwittingly trying to downgrade a store) This split those two separate use-cases in two, and throws distinct exceptions in each case. Before, this was printed ``` /home/jonas/workspace/neo4j/community/kernel/target/test-data/org.neo4j.kernel.impl.storemigration.UpgradableDatabaseTest$UnsupportedVersions/E1F262ADB34943A5536165FFEF6AEC90/graph-db/neostore' has a store version 'v0.A.8' that we cannot upgrade from ``` After, this is printed instead ``` Not possible to upgrade a store with version 'v0.A.8' to current store version `v.0.A.7` (Neo4j 3.0.7). ``` This message is thrown when the version is unknown, e.g. it is jibberish (not sure if that would ever happen), or more likely, it's a version that is part of a later version of Neo4j which this version has no knowledge of. Printing the current version (as well as Neo4j version) makes it as clear as is possible, that he has screwed up his database versions.
- Loading branch information
1 parent
2551dc9
commit cf006dd
Showing
12 changed files
with
65 additions
and
25 deletions.
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
30 changes: 30 additions & 0 deletions
30
...ity/kernel/src/main/java/org/neo4j/kernel/impl/store/UnexpectedStoreVersionException.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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,30 @@ | |||
/* | |||
* 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 org.neo4j.kernel.impl.store; | |||
|
|||
public class UnexpectedStoreVersionException extends StoreFailureException | |||
{ | |||
private static final String MESSAGE = "Unable to open store with version '%s', expected store version '%s'."; | |||
|
|||
public UnexpectedStoreVersionException( String actualStoreVersion, String expectedStoreVersion ) | |||
{ | |||
super( String.format( MESSAGE, actualStoreVersion, expectedStoreVersion ) ); | |||
} | |||
} |
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
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
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
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
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
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
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
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
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
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