TEST: init unassigned gcp in testAcquireIndexCommit

The global checkpoint should be assigned to unassigned rather than 0. If
a single document is indexed and the global checkpoint is initialized
with 0, the first commit is safe which the test does not suppose.

Relates #28038
This commit is contained in:
Nhat Nguyen 2018-01-12 20:09:34 -05:00
parent 095f31b80e
commit 82722ebad3

View File

@ -4324,7 +4324,7 @@ public class InternalEngineTests extends EngineTestCase {
public void testAcquireIndexCommit() throws Exception {
IOUtils.close(engine, store);
store = createStore();
final AtomicLong globalCheckpoint = new AtomicLong();
final AtomicLong globalCheckpoint = new AtomicLong(SequenceNumbers.UNASSIGNED_SEQ_NO);
try (InternalEngine engine = createEngine(store, createTempDir(), globalCheckpoint::get)) {
int numDocs = between(1, 20);
for (int i = 0; i < numDocs; i++) {