Skip to content

Tune Bleve merge planning for full-text indexes - #397

Closed
ajroetker wants to merge 1 commit into
v0.1.xfrom
tune/bleve-merge-plan-caps
Closed

Tune Bleve merge planning for full-text indexes#397
ajroetker wants to merge 1 commit into
v0.1.xfrom
tune/bleve-merge-plan-caps

Conversation

@ajroetker

Copy link
Copy Markdown
Contributor

Summary

  • configure Antfly full-text indexes with a 256MiB maximum planned vector-segment input footprint and at most 5 segments per merge task
  • expose max_segment_file_size and segments_per_merge_task as per-index configuration overrides
  • apply the same Bleve scorchMergePlanOptions when creating, opening, and mapping-reloading an index
  • validate invalid limits, normalize omitted legacy fields to the Antfly defaults, and log the active values when opening disk indexes

Why

Serial merge-task execution bounds a merge plan to one in-flight task at a time, but a single task can still stage a large amount of transient output. Bleve already supports these planner options; Antfly previously used bleve.New and bleve.Open, so it never supplied them.

The 256MiB value is a bound on the summed persisted input size used by Bleve when planning vector-bearing merge tasks. It is deliberately not described as a hard output-size cap because actual merge output may differ from the planner estimate.

Keeping these defaults in Antfly avoids changing Bleve library defaults for other consumers while still allowing per-index tuning as production data evolves.

Compatibility

Existing full-text configurations omit the new fields. Zero values normalize to 256MiB and 5, and explicit default values compare equal to omitted values, avoiding false configuration changes during metadata reconciliation.

Validation

  • env GOWORK=off GOEXPERIMENT=simd go test ./src/store/db/indexes
  • env GOWORK=off GOEXPERIMENT=simd go test -run ^$ ./src/store/db/...
  • env GOWORK=off GOEXPERIMENT=simd go mod tidy -diff
  • go generate ./src/store/db/indexes
  • git diff --check

Related incident: #381
Related Bleve serialization fix: antflydb/bleve#2

ajroetker added a commit to excenter/antfly that referenced this pull request Jul 24, 2026
@ajroetker

Copy link
Copy Markdown
Contributor Author

Superseded by #381. Commit 87b2e91 is now contained in #381 via merge commit 8f0ae65.

@ajroetker ajroetker closed this Jul 24, 2026
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