don't schedule a flush if there are no operations in the translog
this can happen with the 30m time base setting expires
This commit is contained in:
parent
2cb40fcb17
commit
abf68c472e
|
@ -145,8 +145,13 @@ public class TranslogService extends AbstractIndexShardComponent {
|
|||
return;
|
||||
}
|
||||
|
||||
int currentNumberOfOperations = translog.estimatedNumberOfOperations();
|
||||
if (currentNumberOfOperations == 0) {
|
||||
reschedule();
|
||||
return;
|
||||
}
|
||||
|
||||
if (flushThresholdOperations > 0) {
|
||||
int currentNumberOfOperations = translog.estimatedNumberOfOperations();
|
||||
if (currentNumberOfOperations > flushThresholdOperations) {
|
||||
logger.trace("flushing translog, operations [{}], breached [{}]", currentNumberOfOperations, flushThresholdOperations);
|
||||
asyncFlushAndReschedule();
|
||||
|
|
Loading…
Reference in New Issue