|
30 | 30 | import org.apache.lucene.search.SearcherManager; |
31 | 31 | import org.apache.lucene.store.Directory; |
32 | 32 | import org.apache.lucene.store.Lock; |
33 | | -import org.elasticsearch.Version; |
34 | 33 | import org.elasticsearch.common.lucene.Lucene; |
35 | 34 | import org.elasticsearch.common.lucene.index.ElasticsearchDirectoryReader; |
36 | 35 | import org.elasticsearch.common.util.concurrent.ReleasableLock; |
@@ -123,19 +122,9 @@ public ReadOnlyEngine(EngineConfig config, SeqNoStats seqNoStats, TranslogStats |
123 | 122 | } |
124 | 123 |
|
125 | 124 | protected void ensureMaxSeqNoEqualsToGlobalCheckpoint(final SeqNoStats seqNoStats) { |
126 | | - // Before 8.0 the global checkpoint is not known and up to date when the engine is created after |
127 | | - // peer recovery, so we only check the max seq no / global checkpoint coherency when the global |
128 | | - // checkpoint is different from the unassigned sequence number value. |
129 | | - // In addition to that we only execute the check if the index the engine belongs to has been |
130 | | - // created after the refactoring of the Close Index API and its TransportVerifyShardBeforeCloseAction |
131 | | - // that guarantee that all operations have been flushed to Lucene. |
132 | | - final Version indexVersionCreated = engineConfig.getIndexSettings().getIndexVersionCreated(); |
133 | | - if (indexVersionCreated.onOrAfter(Version.V_7_2_0) || |
134 | | - (seqNoStats.getGlobalCheckpoint() != SequenceNumbers.UNASSIGNED_SEQ_NO && indexVersionCreated.onOrAfter(Version.V_6_7_0))) { |
135 | | - if (seqNoStats.getMaxSeqNo() != seqNoStats.getGlobalCheckpoint()) { |
136 | | - throw new IllegalStateException("Maximum sequence number [" + seqNoStats.getMaxSeqNo() |
137 | | - + "] from last commit does not match global checkpoint [" + seqNoStats.getGlobalCheckpoint() + "]"); |
138 | | - } |
| 125 | + if (seqNoStats.getMaxSeqNo() != seqNoStats.getGlobalCheckpoint()) { |
| 126 | + throw new IllegalStateException("Maximum sequence number [" + seqNoStats.getMaxSeqNo() |
| 127 | + + "] from last commit does not match global checkpoint [" + seqNoStats.getGlobalCheckpoint() + "]"); |
139 | 128 | } |
140 | 129 | assert assertMaxSeqNoEqualsToGlobalCheckpoint(seqNoStats.getMaxSeqNo(), seqNoStats.getGlobalCheckpoint()); |
141 | 130 | } |
|
0 commit comments