Skip to content

Commit

Permalink
Merge pull request #79 from ept/patch-1
Browse files Browse the repository at this point in the history
NullPointerException while swapping to new version of read-only store
  • Loading branch information
icefury71 committed Jun 6, 2012
2 parents cccb8c3 + 1d2bca8 commit e7c7b79
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/java/voldemort/store/readonly/ReadOnlyStorageEngine.java
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit e7c7b79

Please sign in to comment.