Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #79 from ept/patch-1

NullPointerException while swapping to new version of read-only store
  • Loading branch information...
commit e7c7b7964322e514230a8939d0565e22fa2a0017 2 parents cccb8c3 + 1d2bca8
@icefury71 icefury71 authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/java/voldemort/store/readonly/ReadOnlyStorageEngine.java
View
4 src/java/voldemort/store/readonly/ReadOnlyStorageEngine.java
@@ -350,7 +350,7 @@ public void swapFiles(String newStoreDirectory) {
*/
private void deleteBackups() {
File[] storeDirList = ReadOnlyUtils.getVersionDirs(storeDir, 0L, currentVersionId);
- if(storeDirList.length > (numBackups + 1)) {
+ if(storeDirList != null && storeDirList.length > (numBackups + 1)) {
// delete ALL old directories asynchronously
File[] extraBackups = ReadOnlyUtils.findKthVersionedDir(storeDirList,
0,
@@ -424,7 +424,7 @@ public void rollback(File rollbackToDir) {
throw new VoldemortException("Cannot parse version id");
File[] backUpDirs = ReadOnlyUtils.getVersionDirs(storeDir, versionId, Long.MAX_VALUE);
- if(backUpDirs.length <= 1) {
+ if(backUpDirs == null || backUpDirs.length <= 1) {
logger.warn("No rollback performed since there are no back-up directories");
return;
}
Please sign in to comment.
Something went wrong with that request. Please try again.