[TEST] Add more logging to IndexShardTests#testMaybeFlush()
This commit is contained in:
parent
0f6e40ede1
commit
1fd8c64f1f
|
@ -1504,6 +1504,7 @@ public class IndexShard extends AbstractIndexShardComponent {
|
|||
// in that situation we have an extra unexpected flush.
|
||||
asyncFlushRunning.compareAndSet(true, false);
|
||||
} else {
|
||||
logger.debug("submitting async flush request");
|
||||
final AbstractRunnable abstractRunnable = new AbstractRunnable() {
|
||||
@Override
|
||||
public void onFailure(Throwable t) {
|
||||
|
|
|
@ -713,11 +713,14 @@ public class IndexShardTests extends ESSingleNodeTestCase {
|
|||
assertEquals(0, shard.engine().getTranslog().totalOperations());
|
||||
shard.engine().getTranslog().sync();
|
||||
long size = shard.engine().getTranslog().sizeInBytes();
|
||||
logger.info("--> current translog size: [{}] num_ops [{}] generation [{}]", shard.engine().getTranslog().sizeInBytes(), shard.engine().getTranslog().totalOperations(), shard.engine().getTranslog().getGeneration());
|
||||
client().admin().indices().prepareUpdateSettings("test").setSettings(settingsBuilder().put(IndexShard.INDEX_TRANSLOG_FLUSH_THRESHOLD_OPS, 1000)
|
||||
.put(IndexShard.INDEX_TRANSLOG_FLUSH_THRESHOLD_SIZE, new ByteSizeValue(size, ByteSizeUnit.BYTES))
|
||||
.build()).get();
|
||||
client().prepareDelete("test", "test", "2").get();
|
||||
logger.info("--> translog size after delete: [{}] num_ops [{}] generation [{}]", shard.engine().getTranslog().sizeInBytes(), shard.engine().getTranslog().totalOperations(), shard.engine().getTranslog().getGeneration());
|
||||
assertBusy(() -> { // this is async
|
||||
logger.info("--> translog size on iter : [{}] num_ops [{}] generation [{}]", shard.engine().getTranslog().sizeInBytes(), shard.engine().getTranslog().totalOperations(), shard.engine().getTranslog().getGeneration());
|
||||
assertFalse(shard.shouldFlush());
|
||||
});
|
||||
assertEquals(0, shard.engine().getTranslog().totalOperations());
|
||||
|
|
Loading…
Reference in New Issue