leviYX opened a new pull request, #17033:
URL: https://github.com/apache/lucene/pull/17033

   ### Description
   
   `CompletionFieldsProducer.checkIntegrity()` currently checks the underlying 
postings but does not verify the checksum of the `.lkp` completion dictionary. 
Opening the dictionary validates its header and footer without scanning the 
contents, so corruption in the dictionary body can go undetected by integrity 
checks.
   
   This adds a dictionary checksum check to `checkIntegrity()` and gives merge 
instances a clone of the dictionary input so they can run the same check. This 
lets explicit integrity checks and pre-merge checks detect dictionary 
corruption. Reader initialization is unchanged: opening an index does not add a 
full-file scan, and the index format is unchanged.
   
   The regression tests flip one byte in the dictionary body while preserving 
the header and footer, so the reader can still open. Before the fix, neither 
the regular reader nor the merge instance reports corruption. With the fix, 
both throw `CorruptIndexException`. A separate test checks that a valid 
dictionary passes integrity checks and still returns suggestions.
   
   ### Validation
   
   Using JDK 25:
   
   - Regression tests with seed `DEADBEEF`: both corruption tests fail before 
the fix; all three tests pass after it.
   - `./gradlew :lucene:suggest:check -Ptests.seed=DEADBEEF`: passed (239 
tests, 7 skipped).
   - `prek` checks for the changed files: passed.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to