[TEST] increase logging for pulling snapshot from InternalEngine

This commit is contained in:
Simon Willnauer 2015-04-09 06:41:02 +02:00
parent b343d688c5
commit b52d24a031
3 changed files with 7 additions and 3 deletions

View File

@ -770,9 +770,12 @@ public class InternalEngine extends Engine {
public SnapshotIndexCommit snapshotIndex() throws EngineException {
// we have to flush outside of the readlock otherwise we might have a problem upgrading
// the to a write lock when we fail the engine in this operation
logger.trace("start flush for snapshot");
flush(false, false, true);
logger.trace("finish flush for snapshot");
try (ReleasableLock lock = readLock.acquire()) {
ensureOpen();
logger.trace("pulling snapshot");
return deletionPolicy.snapshot();
} catch (IOException e) {
throw new SnapshotFailedEngineException(shardId, e);

View File

@ -195,7 +195,7 @@ public class OldIndexBackwardsCompatibilityTests extends ElasticsearchIntegratio
}
}
@TestLogging("indices.recovery:TRACE")
@TestLogging("test.engine:TRACE,index.engine:TRACE,test.engine.lucene:INFO,index.engine.lucene:INFO")
public void testOldIndexes() throws Exception {
setupCluster();

View File

@ -86,13 +86,14 @@ public class MockFSDirectoryService extends FsDirectoryService {
public void beforeIndexShardClosed(ShardId sid, @Nullable IndexShard indexShard,
@IndexSettings Settings indexSettings) {
if (indexShard != null && shardId.equals(sid)) {
logger.info("Shard state before potentially flushing is {}", indexShard.state());
logger.info("{} shard state before potentially flushing is {}", indexShard.shardId(), indexShard.state());
if (validCheckIndexStates.contains(indexShard.state()) && IndexMetaData.isOnSharedFilesystem(indexSettings) == false) {
// When the the internal engine closes we do a rollback, which removes uncommitted segments
// By doing a commit flush we perform a Lucene commit, but don't clear the translog,
// so that even in tests where don't flush we can check the integrity of the Lucene index
logger.info("{} flushing in order to run checkindex", indexShard.shardId());
Releasables.close(indexShard.engine().snapshotIndex()); // Keep translog for tests that rely on replaying it
logger.info("flush finished in beforeIndexShardClosed");
logger.info("{} flush finished in beforeIndexShardClosed", indexShard.shardId());
canRun = true;
}
}