@@ -1811,12 +1811,12 @@ public void run() {
1811
1811
1812
1812
public void testVersioningCreateExistsException () throws IOException {
1813
1813
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 ,
1815
1815
Versions .MATCH_DELETED , VersionType .INTERNAL , PRIMARY , 0 , -1 , false , UNASSIGNED_SEQ_NO , 0 );
1816
1816
Engine .IndexResult indexResult = engine .index (create );
1817
1817
assertThat (indexResult .getVersion (), equalTo (1L ));
1818
1818
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 ,
1820
1820
VersionType .INTERNAL , PRIMARY , 0 , -1 , false , UNASSIGNED_SEQ_NO , 0 );
1821
1821
indexResult = engine .index (create );
1822
1822
assertThat (indexResult .getResultType (), equalTo (Engine .Result .Type .FAILURE ));
@@ -3063,7 +3063,7 @@ public void testTranslogReplay() throws IOException {
3063
3063
final int numDocs = randomIntBetween (1 , 10 );
3064
3064
for (int i = 0 ; i < numDocs ; i ++) {
3065
3065
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 ,
3067
3067
Versions .MATCH_DELETED , VersionType .INTERNAL , PRIMARY , System .nanoTime (), -1 , false , UNASSIGNED_SEQ_NO , 0 );
3068
3068
Engine .IndexResult indexResult = engine .index (firstIndexRequest );
3069
3069
assertThat (indexResult .getVersion (), equalTo (1L ));
@@ -3097,7 +3097,7 @@ public void testTranslogReplay() throws IOException {
3097
3097
final boolean flush = randomBoolean ();
3098
3098
int randomId = randomIntBetween (numDocs + 1 , numDocs + 10 );
3099
3099
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 ,
3101
3101
VersionType .EXTERNAL , PRIMARY , System .nanoTime (), -1 , false , UNASSIGNED_SEQ_NO , 0 );
3102
3102
Engine .IndexResult indexResult = engine .index (firstIndexRequest );
3103
3103
assertThat (indexResult .getVersion (), equalTo (1L ));
@@ -3107,7 +3107,7 @@ public void testTranslogReplay() throws IOException {
3107
3107
}
3108
3108
3109
3109
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 ,
3111
3111
VersionType .EXTERNAL , PRIMARY , System .nanoTime (), -1 , false , UNASSIGNED_SEQ_NO , 0 );
3112
3112
Engine .IndexResult result = engine .index (idxRequest );
3113
3113
engine .refresh ("test" );
@@ -3143,7 +3143,7 @@ public void testRecoverFromForeignTranslog() throws IOException {
3143
3143
final int numDocs = randomIntBetween (1 , 10 );
3144
3144
for (int i = 0 ; i < numDocs ; i ++) {
3145
3145
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 ,
3147
3147
Versions .MATCH_DELETED , VersionType .INTERNAL , PRIMARY , System .nanoTime (), -1 , false , UNASSIGNED_SEQ_NO , 0 );
3148
3148
Engine .IndexResult index = engine .index (firstIndexRequest );
3149
3149
assertThat (index .getVersion (), equalTo (1L ));
@@ -3677,7 +3677,7 @@ public void testRetryWithAutogeneratedIdWorksAndNoDuplicateDocs() throws IOExcep
3677
3677
boolean isRetry = false ;
3678
3678
long autoGeneratedIdTimestamp = 0 ;
3679
3679
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 ,
3681
3681
randomBoolean () ? Versions .MATCH_DELETED : Versions .MATCH_ANY , VersionType .INTERNAL , PRIMARY , System .nanoTime (),
3682
3682
autoGeneratedIdTimestamp , isRetry , UNASSIGNED_SEQ_NO , 0 );
3683
3683
Engine .IndexResult indexResult = engine .index (index );
@@ -3689,7 +3689,7 @@ public void testRetryWithAutogeneratedIdWorksAndNoDuplicateDocs() throws IOExcep
3689
3689
assertThat (indexResult .getVersion (), equalTo (1L ));
3690
3690
3691
3691
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 ,
3693
3693
PRIMARY , System .nanoTime (), autoGeneratedIdTimestamp , isRetry , UNASSIGNED_SEQ_NO , 0 );
3694
3694
indexResult = engine .index (index );
3695
3695
assertThat (indexResult .getVersion (), equalTo (1L ));
@@ -3718,7 +3718,7 @@ public void testRetryWithAutogeneratedIdsAndWrongOrderWorksAndNoDuplicateDocs()
3718
3718
boolean isRetry = true ;
3719
3719
long autoGeneratedIdTimestamp = 0 ;
3720
3720
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 ,
3722
3722
randomBoolean () ? Versions .MATCH_DELETED : Versions .MATCH_ANY , VersionType .INTERNAL , PRIMARY , System .nanoTime (),
3723
3723
autoGeneratedIdTimestamp , isRetry , UNASSIGNED_SEQ_NO , 0 );
3724
3724
Engine .IndexResult result = engine .index (firstIndexRequest );
@@ -3730,7 +3730,7 @@ public void testRetryWithAutogeneratedIdsAndWrongOrderWorksAndNoDuplicateDocs()
3730
3730
assertThat (indexReplicaResult .getVersion (), equalTo (1L ));
3731
3731
3732
3732
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 ,
3734
3734
Versions .MATCH_DELETED , VersionType .INTERNAL , PRIMARY , System .nanoTime (), autoGeneratedIdTimestamp , isRetry , UNASSIGNED_SEQ_NO ,
3735
3735
0 );
3736
3736
Engine .IndexResult indexResult = engine .index (secondIndexRequest );
@@ -3760,7 +3760,7 @@ public Engine.Index randomAppendOnly(ParsedDocument doc, boolean retry, final lo
3760
3760
}
3761
3761
3762
3762
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 ,
3764
3764
VersionType .INTERNAL , Engine .Operation .Origin .PRIMARY , System .nanoTime (), autoGeneratedIdTimestamp , retry ,
3765
3765
UNASSIGNED_SEQ_NO , 0 );
3766
3766
}
0 commit comments