Skip to content

truncate split lists in error logs using PrettySample#6315

Open
fmassot wants to merge 1 commit intomainfrom
fmassot/truncate-split-error-logs
Open

truncate split lists in error logs using PrettySample#6315
fmassot wants to merge 1 commit intomainfrom
fmassot/truncate-split-error-logs

Conversation

@fmassot
Copy link
Copy Markdown
Collaborator

@fmassot fmassot commented Apr 18, 2026

Summary

  • When many splits fail during search, error logs dump every failed split into a single line, producing multi-KB unreadable logs at scale
  • Use PrettySample::new(&splits, 5) to show only the first 5 items + a count, matching the existing pattern in leaf.rs:1782
  • Also adds num_failed_splits / num_splits fields for easy grep/alerting
  • Fixes log format: "Merged leaf search response." → "merged leaf search response" (lowercase, no trailing punctuation per log policy)

Before (hundreds of splits failing):

failed_splits = [SplitSearchError { error: "timeout", split_id: "abc123", ... }, SplitSearchError { ... }, ... 200 more ...]

After:

num_failed_splits = 205, failed_splits = [SplitSearchError { ... }, ... (4 more) ... (200 others)]

Files changed

  • root.rsfailed_splits in leaf search response (debug log + rate-limited error)
  • list_terms.rsfailed_splits in list terms response
  • fetch_docs.rssplit_ids on fetch docs error (also avoids cloning split IDs)

Test plan

  • cargo check -p quickwit-search passes
  • Verify in staging with a query spanning many splits

🤖 Generated with Claude Code

When many splits fail during a search query, the error logs dump
every failed split (with its full error message) into a single log
line. At scale (hundreds of splits per query), this produces multi-KB
unreadable log lines.

Use PrettySample(5) to show only the first 5 items and a count of
the rest, matching the pattern already used for split_offsets in
leaf search. Also adds num_failed_splits/num_splits fields for easy
filtering without parsing the sample.

Files changed:
- root.rs: failed_splits in leaf search response (debug + error)
- list_terms.rs: failed_splits in list terms response
- fetch_docs.rs: split_ids on fetch docs error

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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