Skip to content

Streamline segment info logged by infostream, esp. when merging#15885

Merged
msokolov merged 9 commits into
apache:mainfrom
msokolov:simplify-merge-infostream
Apr 1, 2026
Merged

Streamline segment info logged by infostream, esp. when merging#15885
msokolov merged 9 commits into
apache:mainfrom
msokolov:simplify-merge-infostream

Conversation

@msokolov

Copy link
Copy Markdown
Contributor

Description

We've been logging infostreams in our production system and find they are overly verbose and repetitive in some ways. This takes the edge off by logging segment "diagnostic" info once per segment rather than every time the segment is mentioned, eg when listed as part of a merge

@github-actions github-actions Bot added this to the 10.5.0 milestone Mar 27, 2026

@mikemccand mikemccand left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @msokolov! This is likely a massive reduction in InfoStream size in practice... I left some small comments.

Comment thread lucene/core/src/java/org/apache/lucene/index/SegmentCommitInfo.java
Comment thread lucene/core/src/java/org/apache/lucene/index/SegmentInfo.java
Comment thread lucene/core/src/test/org/apache/lucene/index/TestInfoStream.java
Comment thread lucene/CHANGES.txt
Comment thread lucene/core/src/java/org/apache/lucene/index/IndexWriter.java

if (infoStream.isEnabled("IW")) {
infoStream.message("IW", "publishFlushedSegment " + newSegment);
infoStream.message("IW", "publishFlushedSegment " + newSegment.toStringVerbose());

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there also a corresponding toStringVerbose() for the merge case? addIndexes?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we currently emit a log message when a new segment is created by merging or addIndexes?

@msokolov msokolov merged commit 03fc503 into apache:main Apr 1, 2026
13 checks passed
@msokolov msokolov deleted the simplify-merge-infostream branch April 1, 2026 17:42
mouhc1ne added a commit to mouhc1ne/elasticsearch that referenced this pull request Apr 10, 2026
…(see apache/lucene#15885) to a less verbose message that no longer includes "timestamp". This causes this test to fail on `lucene_snapshot` branch. The `main` branch doesn't need this yet because it's still on Lucene `10.4` where the aforementioned `toString()` still emits the usual and verbose segment diagnostic that includes the timestamp.
mouhc1ne added a commit to elastic/elasticsearch that referenced this pull request Apr 10, 2026
…(see apache/lucene#15885) to a less verbose message that no longer includes "timestamp". This causes this test to fail on `lucene_snapshot` branch. The `main` branch doesn't need this yet because it's still on Lucene `10.4` where the aforementioned `toString()` still emits the usual and verbose segment diagnostic that includes the timestamp. (#146024)
mouhc1ne added a commit to mouhc1ne/elasticsearch that referenced this pull request Apr 14, 2026
…(see apache/lucene#15885) to a less verbose message that no longer includes "timestamp". This causes this test to fail on `lucene_snapshot` branch. The `main` branch doesn't need this yet because it's still on Lucene `10.4` where the aforementioned `toString()` still emits the usual and verbose segment diagnostic that includes the timestamp.
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.

3 participants