add yet another test
This commit is contained in:
parent
5204440471
commit
050afe9171
|
@ -556,7 +556,7 @@ public class IndexShard extends AbstractIndexShardComponent {
|
|||
/** Writes all indexing changes to disk and opens a new searcher reflecting all changes. This can throw {@link EngineClosedException}. */
|
||||
public void refresh(String source) {
|
||||
verifyNotClosed();
|
||||
// if (getEngine().refreshNeeded()) {
|
||||
if (getEngine().refreshNeeded()) {
|
||||
if (canIndex()) {
|
||||
long bytes = getEngine().getIndexBufferRAMBytesUsed();
|
||||
writingBytes.addAndGet(bytes);
|
||||
|
@ -575,7 +575,7 @@ public class IndexShard extends AbstractIndexShardComponent {
|
|||
getEngine().refresh(source);
|
||||
refreshMetric.inc(System.nanoTime() - time);
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
/** Returns how many bytes we are currently moving from heap to disk */
|
||||
|
|
|
@ -322,6 +322,13 @@ public class IndexServiceTests extends ESSingleNodeTestCase {
|
|||
assertBusy(() -> {
|
||||
assertFalse(shard.getTranslog().syncNeeded());
|
||||
});
|
||||
}
|
||||
|
||||
public void testNoFsyncTaskIfDisabled() {
|
||||
Settings settings = Settings.builder()
|
||||
.put(IndexSettings.INDEX_TRANSLOG_SYNC_INTERVAL, "0ms") // disable
|
||||
.build();
|
||||
IndexService indexService = createIndex("test", settings);
|
||||
assertNull(indexService.getFsyncTask());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue