Skip to content

Don't skip uncompressed indexing when having a prefix#51

Merged
klauspost merged 1 commit into
minio:mainfrom
klauspost:uncompressed-prefix-index
Jul 3, 2026
Merged

Don't skip uncompressed indexing when having a prefix#51
klauspost merged 1 commit into
minio:mainfrom
klauspost:uncompressed-prefix-index

Conversation

@klauspost

@klauspost klauspost commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

When indexing and encountering an incompressible block don't skip indexing when having a prefix.

Prefixes significantly reduces the population, so we are likely to still get a usable index even on incompressible blocks.

Summary by CodeRabbit

  • New Features

    • Search tables are now generated more broadly, including for data that wasn’t previously indexed in some cases.
  • Bug Fixes

    • Improved handling of buffered reads and writes so search-related data is prepared and emitted more reliably.
    • Fixed cases where search indexing could be skipped during certain write paths, helping keep search results more consistent.

When indexing and encountering an incompressible block don't skip indexing when having a prefix.

Prefixes significantly reduces the population, so we are likely to still get a usable index even on incompressible blocks.
@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: dd51cbc9-1ba2-4231-a007-8410c03509d8

📥 Commits

Reviewing files that changed from the base of the PR and between cfcc325 and e302f87.

📒 Files selected for processing (2)
  • search_table.go
  • writer.go

📝 Walkthrough

Walkthrough

Introduces a hasPrefix() helper on SearchTableConfig and updates writer.go buffer layouts to reserve searchMaxChunk headroom, enabling search tables to be generated and indexed for incompressible blocks when prefix tables are configured, across async write, writeFull, and writeSync paths.

Changes

Prefix-aware search table support

Layer / File(s) Summary
hasPrefix helper
search_table.go
Adds a method reporting whether the configured table type requires a prefix filter.
Buffer layout with searchMaxChunk headroom
writer.go
ReadFrom, async write, and writeFull reserve searchMaxChunk bytes at the front of pooled buffers so search chunks can be prepended in-place; incompressible-block handling swaps buffers to preserve this invariant.
Search table emission/indexing conditions
writer.go
Broadens conditions in EncodeBuffer, async encoding, writeFull, and both writeSync modes (sidecar and inline) to trigger search-table generation/emission when hasPrefix() is true, not only when a block is compressible.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

  • minio/minlz#42: Both PRs modify MinLZ search-table emission/writer behavior so tables are generated and optionally sent to sidecar based on prefix/table configuration, not just compressible blocks.
  • minio/minlz#46: This PR's hasPrefix()-driven emission for incompressible blocks directly supports the retrieved PR's prefix-only search logic relying on correctly generated tables at block boundaries.

Poem

A rabbit hops through buffers tight,
Reserving room for prefix light,
No block too dense, no chunk too small,
The search chunk prepends before them all,
🐇✨ hasPrefix true, we index right!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main change: indexing is no longer skipped for incompressible blocks when a prefix table is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@klauspost klauspost merged commit 8ac7c53 into minio:main Jul 3, 2026
59 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant