add more logging and fix pending delete removal

This commit is contained in:
Simon Willnauer 2015-02-21 09:22:09 +01:00
parent a4f7023e29
commit 16f19bf7bd
2 changed files with 5 additions and 3 deletions

View File

@ -441,7 +441,7 @@ public class IndexService extends AbstractIndexComponent implements IndexCompone
}
} catch (IOException e) {
indicesServices.addPendingDelete(index(), lock.getShardId(), indexSettings);
logger.debug("{} failed to delete shard content - scheduled a retry", e, lock.getShardId());
logger.debug("{} failed to delete shard content - scheduled a retry", e, lock.getShardId().id());
}
}
}

View File

@ -641,6 +641,7 @@ public class IndicesService extends AbstractLifecycleComponent<IndicesService> i
* @param timeout the timeout used for processing pending deletes
*/
public void processPendingDeletes(Index index, @IndexSettings Settings indexSettings, TimeValue timeout) throws IOException {
logger.debug("{} processing pending deletes", index);
final long startTime = System.currentTimeMillis();
final List<ShardLock> shardLocks = nodeEnv.lockAllForIndex(index, indexSettings, timeout.millis());
try {
@ -665,13 +666,14 @@ public class IndicesService extends AbstractLifecycleComponent<IndicesService> i
if (shardLock != null) {
try {
deleteShardStore("pending delete", shardLock, delete.settings);
iterator.remove();
} catch (IOException ex) {
logger.debug("{} retry pending delete", shardLock.getShardId(), ex);
logger.debug("{} retry pending delete", ex, shardLock.getShardId());
}
} else {
logger.warn("{} no shard lock for pending delete", delete.shardId);
iterator.remove();
}
iterator.remove();
}
if (remove.isEmpty() == false) {
logger.warn("{} still pending deletes present for shards {} - retrying", index, remove.toString());