Преглед изворни кода

Remove uncommitted ops assertion in shouldFlush

This assertion does not hold if engine is flushed between the invocation
of translog.uncommittedSizeInBytes and translog.uncommittedOperations.
These two values can be calculated from different commits.
Nhat Nguyen пре 7 година
родитељ
комит
5be478f938

+ 0 - 2
server/src/main/java/org/elasticsearch/index/engine/InternalEngine.java

@@ -1470,8 +1470,6 @@ public class InternalEngine extends Engine {
         if (uncommittedSizeOfCurrentCommit < flushThreshold) {
             return false;
         }
-        assert translog.uncommittedOperations() > 0 : "translog required to flush periodically but not contain any uncommitted operation; "
-            + "uncommitted translog size [" + uncommittedSizeOfCurrentCommit + "], flush threshold [" + flushThreshold + "]";
         /*
          * We should only flush ony if the shouldFlush condition can become false after flushing.
          * This condition will change if the `uncommittedSize` of the new commit is smaller than