[STORE] increment store in NoneIndexShardGateway and either check if dir is null or different but not both

This commit is contained in:
Simon Willnauer 2014-11-06 23:18:33 +01:00
parent 17fdee9441
commit 0ac9912b89
2 changed files with 4 additions and 2 deletions

View File

@ -63,11 +63,14 @@ public class NoneIndexShardGateway extends AbstractIndexShardComponent implement
recoveryState.getIndex().startTime(System.currentTimeMillis()); recoveryState.getIndex().startTime(System.currentTimeMillis());
// in the none case, we simply start the shard // in the none case, we simply start the shard
// clean the store, there should be nothing there... // clean the store, there should be nothing there...
indexShard.store().incRef();
try { try {
logger.debug("cleaning shard content before creation"); logger.debug("cleaning shard content before creation");
indexShard.store().deleteContent(); indexShard.store().deleteContent();
} catch (IOException e) { } catch (IOException e) {
logger.warn("failed to clean store before starting shard", e); logger.warn("failed to clean store before starting shard", e);
} finally {
indexShard.store().decRef();
} }
indexShard.postRecovery("post recovery from gateway"); indexShard.postRecovery("post recovery from gateway");
recoveryState.getIndex().time(System.currentTimeMillis() - recoveryState.getIndex().startTime()); recoveryState.getIndex().time(System.currentTimeMillis() - recoveryState.getIndex().startTime());

View File

@ -203,8 +203,7 @@ public final class DistributorDirectory extends BaseDirectory {
builder.append("File ").append(file) builder.append("File ").append(file)
.append(" was not mapped to a directory but exists in one of the distributors directories") .append(" was not mapped to a directory but exists in one of the distributors directories")
.append(System.lineSeparator()); .append(System.lineSeparator());
} } else if (directory != d) {
if (directory != d) {
consistent = false; consistent = false;
builder.append("File ").append(file).append(" was mapped to a directory ").append(directory) builder.append("File ").append(file).append(" was mapped to a directory ").append(directory)
.append(" but exists in another distributor directory").append(d) .append(" but exists in another distributor directory").append(d)