@@ -123,6 +123,7 @@ void luceneIndexScrubMissingDataModelNoIssues(boolean isSynthetic, boolean isGro
123
123
124
124
@ Test
125
125
void luceneIndexScrubMissingSimpleNoIssues () {
126
+ // Scrub a valid index, expect zero issues
126
127
Index index = SIMPLE_TEXT_SUFFIXES_WITH_PRIMARY_KEY_SEGMENT_INDEX ;
127
128
try (final FDBRecordContext context = openContext ()) {
128
129
// Write some records
@@ -157,7 +158,7 @@ void luceneIndexScrubMissingSimpleNoIssues() {
157
158
@ ParameterizedTest
158
159
@ MethodSource ("threeBooleanArgs" )
159
160
void luceneIndexScrubMissingDataModel (boolean isSynthetic , boolean isGrouped , boolean isPartitioned ) {
160
- // Scrub a valid index, expect zero issues
161
+ // Scrub an index with missing entries
161
162
final long seed = 207L ;
162
163
163
164
final LuceneIndexTestDataModel dataModel = new LuceneIndexTestDataModel .Builder (seed , this ::getStoreBuilderWithRegistry , pathManager )
@@ -192,8 +193,19 @@ void luceneIndexScrubMissingDataModel(boolean isSynthetic, boolean isGrouped, bo
192
193
injectedFailures .setFlag (LUCENE_MAINTAINER_SKIP_INDEX_UPDATE );
193
194
dataModel .saveRecords (3 , 10 , context , 1 );
194
195
dataModel .saveRecords (2 , 20 , context , 3 );
196
+ injectedFailures .setFlag (LUCENE_MAINTAINER_SKIP_INDEX_UPDATE , false );
197
+
198
+ dataModel .saveRecords (7 , 40 , context , 1 );
199
+ dataModel .saveRecords (7 , 50 , context , 2 );
200
+ dataModel .explicitMergeIndex (context , timer );
201
+
202
+ injectedFailures .setFlag (LUCENE_MAINTAINER_SKIP_INDEX_UPDATE );
195
203
dataModel .saveRecords (5 , 20 , context , 4 );
196
204
injectedFailures .setFlag (LUCENE_MAINTAINER_SKIP_INDEX_UPDATE , false );
205
+
206
+ dataModel .saveRecords (7 , 60 , context , 3 );
207
+
208
+
197
209
context .commit ();
198
210
}
199
211
@@ -239,7 +251,7 @@ void luceneIndexScrubMissingSimple() {
239
251
registry .overrideFactory (new MockedLuceneIndexMaintainerFactory (injectedFailures ));
240
252
241
253
try (final FDBRecordContext context = openContext ()) {
242
- // Overwrite + add records with an injected key segment index failure
254
+ // Overwrite + add records without updating the index
243
255
Pair <FDBRecordStore , QueryPlanner > pair = LuceneIndexTestUtils .rebuildIndexMetaData (context , path , SIMPLE_DOC , index , isUseCascadesPlanner (), registry );
244
256
this .recordStore = pair .getLeft ();
245
257
this .planner = pair .getRight ();
0 commit comments