@@ -1811,12 +1811,12 @@ public void run() {
18111811
18121812 public void testVersioningCreateExistsException () throws IOException {
18131813 ParsedDocument doc = testParsedDocument ("1" , null , testDocument (), B_1 , null );
1814- Engine .Index create = new Engine .Index (newUid (doc ), doc , UNASSIGNED_SEQ_NO , 0 ,
1814+ Engine .Index create = new Engine .Index (newUid (doc ), doc , UNASSIGNED_SEQ_NO , 1 ,
18151815 Versions .MATCH_DELETED , VersionType .INTERNAL , PRIMARY , 0 , -1 , false , UNASSIGNED_SEQ_NO , 0 );
18161816 Engine .IndexResult indexResult = engine .index (create );
18171817 assertThat (indexResult .getVersion (), equalTo (1L ));
18181818
1819- create = new Engine .Index (newUid (doc ), doc , UNASSIGNED_SEQ_NO , 0 , Versions .MATCH_DELETED ,
1819+ create = new Engine .Index (newUid (doc ), doc , UNASSIGNED_SEQ_NO , 1 , Versions .MATCH_DELETED ,
18201820 VersionType .INTERNAL , PRIMARY , 0 , -1 , false , UNASSIGNED_SEQ_NO , 0 );
18211821 indexResult = engine .index (create );
18221822 assertThat (indexResult .getResultType (), equalTo (Engine .Result .Type .FAILURE ));
@@ -3063,7 +3063,7 @@ public void testTranslogReplay() throws IOException {
30633063 final int numDocs = randomIntBetween (1 , 10 );
30643064 for (int i = 0 ; i < numDocs ; i ++) {
30653065 ParsedDocument doc = testParsedDocument (Integer .toString (i ), null , testDocument (), new BytesArray ("{}" ), null );
3066- Engine .Index firstIndexRequest = new Engine .Index (newUid (doc ), doc , UNASSIGNED_SEQ_NO , 0 ,
3066+ Engine .Index firstIndexRequest = new Engine .Index (newUid (doc ), doc , UNASSIGNED_SEQ_NO , 1 ,
30673067 Versions .MATCH_DELETED , VersionType .INTERNAL , PRIMARY , System .nanoTime (), -1 , false , UNASSIGNED_SEQ_NO , 0 );
30683068 Engine .IndexResult indexResult = engine .index (firstIndexRequest );
30693069 assertThat (indexResult .getVersion (), equalTo (1L ));
@@ -3097,7 +3097,7 @@ public void testTranslogReplay() throws IOException {
30973097 final boolean flush = randomBoolean ();
30983098 int randomId = randomIntBetween (numDocs + 1 , numDocs + 10 );
30993099 ParsedDocument doc = testParsedDocument (Integer .toString (randomId ), null , testDocument (), new BytesArray ("{}" ), null );
3100- Engine .Index firstIndexRequest = new Engine .Index (newUid (doc ), doc , UNASSIGNED_SEQ_NO , 0 , 1 ,
3100+ Engine .Index firstIndexRequest = new Engine .Index (newUid (doc ), doc , UNASSIGNED_SEQ_NO , 1 , 1 ,
31013101 VersionType .EXTERNAL , PRIMARY , System .nanoTime (), -1 , false , UNASSIGNED_SEQ_NO , 0 );
31023102 Engine .IndexResult indexResult = engine .index (firstIndexRequest );
31033103 assertThat (indexResult .getVersion (), equalTo (1L ));
@@ -3107,7 +3107,7 @@ public void testTranslogReplay() throws IOException {
31073107 }
31083108
31093109 doc = testParsedDocument (Integer .toString (randomId ), null , testDocument (), new BytesArray ("{}" ), null );
3110- Engine .Index idxRequest = new Engine .Index (newUid (doc ), doc , UNASSIGNED_SEQ_NO , 0 , 2 ,
3110+ Engine .Index idxRequest = new Engine .Index (newUid (doc ), doc , UNASSIGNED_SEQ_NO , 1 , 2 ,
31113111 VersionType .EXTERNAL , PRIMARY , System .nanoTime (), -1 , false , UNASSIGNED_SEQ_NO , 0 );
31123112 Engine .IndexResult result = engine .index (idxRequest );
31133113 engine .refresh ("test" );
@@ -3143,7 +3143,7 @@ public void testRecoverFromForeignTranslog() throws IOException {
31433143 final int numDocs = randomIntBetween (1 , 10 );
31443144 for (int i = 0 ; i < numDocs ; i ++) {
31453145 ParsedDocument doc = testParsedDocument (Integer .toString (i ), null , testDocument (), new BytesArray ("{}" ), null );
3146- Engine .Index firstIndexRequest = new Engine .Index (newUid (doc ), doc , UNASSIGNED_SEQ_NO , 0 ,
3146+ Engine .Index firstIndexRequest = new Engine .Index (newUid (doc ), doc , UNASSIGNED_SEQ_NO , 1 ,
31473147 Versions .MATCH_DELETED , VersionType .INTERNAL , PRIMARY , System .nanoTime (), -1 , false , UNASSIGNED_SEQ_NO , 0 );
31483148 Engine .IndexResult index = engine .index (firstIndexRequest );
31493149 assertThat (index .getVersion (), equalTo (1L ));
@@ -3677,7 +3677,7 @@ public void testRetryWithAutogeneratedIdWorksAndNoDuplicateDocs() throws IOExcep
36773677 boolean isRetry = false ;
36783678 long autoGeneratedIdTimestamp = 0 ;
36793679
3680- Engine .Index index = new Engine .Index (newUid (doc ), doc , UNASSIGNED_SEQ_NO , 0 ,
3680+ Engine .Index index = new Engine .Index (newUid (doc ), doc , UNASSIGNED_SEQ_NO , 1 ,
36813681 randomBoolean () ? Versions .MATCH_DELETED : Versions .MATCH_ANY , VersionType .INTERNAL , PRIMARY , System .nanoTime (),
36823682 autoGeneratedIdTimestamp , isRetry , UNASSIGNED_SEQ_NO , 0 );
36833683 Engine .IndexResult indexResult = engine .index (index );
@@ -3689,7 +3689,7 @@ public void testRetryWithAutogeneratedIdWorksAndNoDuplicateDocs() throws IOExcep
36893689 assertThat (indexResult .getVersion (), equalTo (1L ));
36903690
36913691 isRetry = true ;
3692- index = new Engine .Index (newUid (doc ), doc , UNASSIGNED_SEQ_NO , 0 , Versions .MATCH_ANY , VersionType .INTERNAL ,
3692+ index = new Engine .Index (newUid (doc ), doc , UNASSIGNED_SEQ_NO , 1 , Versions .MATCH_ANY , VersionType .INTERNAL ,
36933693 PRIMARY , System .nanoTime (), autoGeneratedIdTimestamp , isRetry , UNASSIGNED_SEQ_NO , 0 );
36943694 indexResult = engine .index (index );
36953695 assertThat (indexResult .getVersion (), equalTo (1L ));
@@ -3718,7 +3718,7 @@ public void testRetryWithAutogeneratedIdsAndWrongOrderWorksAndNoDuplicateDocs()
37183718 boolean isRetry = true ;
37193719 long autoGeneratedIdTimestamp = 0 ;
37203720
3721- Engine .Index firstIndexRequest = new Engine .Index (newUid (doc ), doc , UNASSIGNED_SEQ_NO , 0 ,
3721+ Engine .Index firstIndexRequest = new Engine .Index (newUid (doc ), doc , UNASSIGNED_SEQ_NO , 1 ,
37223722 randomBoolean () ? Versions .MATCH_DELETED : Versions .MATCH_ANY , VersionType .INTERNAL , PRIMARY , System .nanoTime (),
37233723 autoGeneratedIdTimestamp , isRetry , UNASSIGNED_SEQ_NO , 0 );
37243724 Engine .IndexResult result = engine .index (firstIndexRequest );
@@ -3730,7 +3730,7 @@ public void testRetryWithAutogeneratedIdsAndWrongOrderWorksAndNoDuplicateDocs()
37303730 assertThat (indexReplicaResult .getVersion (), equalTo (1L ));
37313731
37323732 isRetry = false ;
3733- Engine .Index secondIndexRequest = new Engine .Index (newUid (doc ), doc , UNASSIGNED_SEQ_NO , 0 ,
3733+ Engine .Index secondIndexRequest = new Engine .Index (newUid (doc ), doc , UNASSIGNED_SEQ_NO , 1 ,
37343734 Versions .MATCH_DELETED , VersionType .INTERNAL , PRIMARY , System .nanoTime (), autoGeneratedIdTimestamp , isRetry , UNASSIGNED_SEQ_NO ,
37353735 0 );
37363736 Engine .IndexResult indexResult = engine .index (secondIndexRequest );
@@ -3760,7 +3760,7 @@ public Engine.Index randomAppendOnly(ParsedDocument doc, boolean retry, final lo
37603760 }
37613761
37623762 public Engine .Index appendOnlyPrimary (ParsedDocument doc , boolean retry , final long autoGeneratedIdTimestamp , boolean create ) {
3763- return new Engine .Index (newUid (doc ), doc , UNASSIGNED_SEQ_NO , 0 , create ? Versions .MATCH_DELETED : Versions .MATCH_ANY ,
3763+ return new Engine .Index (newUid (doc ), doc , UNASSIGNED_SEQ_NO , 1 , create ? Versions .MATCH_DELETED : Versions .MATCH_ANY ,
37643764 VersionType .INTERNAL , Engine .Operation .Origin .PRIMARY , System .nanoTime (), autoGeneratedIdTimestamp , retry ,
37653765 UNASSIGNED_SEQ_NO , 0 );
37663766 }
0 commit comments