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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int currentNumberOfOperations = translog.estimatedNumberOfOperations();
|
||||||
|
if (currentNumberOfOperations == 0) {
|
||||||
|
reschedule();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (flushThresholdOperations > 0) {
|
if (flushThresholdOperations > 0) {
|
||||||
int currentNumberOfOperations = translog.estimatedNumberOfOperations();
|
|
||||||
if (currentNumberOfOperations > flushThresholdOperations) {
|
if (currentNumberOfOperations > flushThresholdOperations) {
|
||||||
logger.trace("flushing translog, operations [{}], breached [{}]", currentNumberOfOperations, flushThresholdOperations);
|
logger.trace("flushing translog, operations [{}], breached [{}]", currentNumberOfOperations, flushThresholdOperations);
|
||||||
asyncFlushAndReschedule();
|
asyncFlushAndReschedule();
|
||||||
|
|
Loading…
Reference in New Issue