Skip to content

Fix stale block size comments in Lucene104 postings reader/writer - #16491

Open
vukasin-djuricic wants to merge 1 commit into
apache:mainfrom
vukasin-djuricic:fix-stale-block-size-comments
Open

Fix stale block size comments in Lucene104 postings reader/writer#16491
vukasin-djuricic wants to merge 1 commit into
apache:mainfrom
vukasin-djuricic:fix-stale-block-size-comments

Conversation

@vukasin-djuricic

@vukasin-djuricic vukasin-djuricic commented Aug 6, 2026

Copy link
Copy Markdown

Fixes #15670.

BLOCK_SIZE went from 128 to 256 in 10.4, but a few comments still spell out
values computed with the old block size:

  • Lucene104PostingsWriter: level 1 skip data is written every 32 blocks, which
    is 8,192 docs, not 4,096.
  • Lucene104PostingsWriter: BLOCK_SIZE * Integer.SIZE / Long.SIZE is 128, not 64.
    The assert on the next line already uses BLOCK_SIZE / 2.
  • Lucene104PostingsReader: BLOCK_SIZE / Long.SIZE is 4, not 2.

This is a follow-up to #15672, where the question was raised whether other
comments needed the same fix. I went through the lucene104 package looking
for comments that hard-code values derived from BLOCK_SIZE, and these three
are the only ones left. The version history in package-info.java is correct
as is, since it describes the 9.12 format where BLOCK_SIZE was still 128.

Documentation only, no change in behaviour, so no CHANGES.txt entry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update Lucene104PostingsWriter level1skipdata doc count

1 participant