Skip to content

[v26.2.x] INC-1235 storage: keep segment_set formatting bounded under fmt - #31503

Merged
pgellert merged 1 commit into
redpanda-data:v26.2.xfrom
vbotbuildovich:backport-pr-31500-v26.2.x-661
Aug 10, 2026
Merged

[v26.2.x] INC-1235 storage: keep segment_set formatting bounded under fmt#31503
pgellert merged 1 commit into
redpanda-data:v26.2.xfrom
vbotbuildovich:backport-pr-31500-v26.2.x-661

Conversation

@vbotbuildovich

Copy link
Copy Markdown
Collaborator

Backport of PR #31500

Since the fmt 9 upgrade, formatter resolution for segment_set selects
fmt/ranges.h's range formatter over the ostream operator<<, printing
every segment and silently bypassing the 8-segment truncation added in
2023 for this same problem. On partitions with thousands of segments,
formatting a log handle (e.g. "Removing: {}" in log_manager::remove)
then builds a multi-megabyte string in one contiguous fmt buffer, which
can fail allocation on a fragmented shard and abort the process; the
allocation failure report is itself suppressed by the logger's
re-entrancy silencer, so such crashes appear as bare SIGABRTs. Move the
truncation into a format_to member and add an explicit full
fmt::formatter specialization, which takes precedence over any partial
specialization, so no future fmt upgrade or include change can route
around the bound; operator<< now delegates to it. The new gtest covers
the fmt dispatch path (the one that regressed) and asserts ostream
output stays identical.

(cherry picked from commit c4d8e60)
@vbotbuildovich vbotbuildovich added this to the v26.2.x-next milestone Aug 10, 2026
@vbotbuildovich vbotbuildovich added the kind/backport PRs targeting a stable branch label Aug 10, 2026
@pgellert pgellert self-assigned this Aug 10, 2026
@vbotbuildovich

Copy link
Copy Markdown
Collaborator Author

CI test results

test results on build#88476
test_status test_class test_method test_arguments test_kind job_url passed reason test_history
FLAKY(PASS) NodeWiseRecoveryTest test_node_wise_recovery {"dead_node_count": 2} integration https://buildkite.com/redpanda/redpanda/builds/88476#019febe3-9ec1-43fc-9847-526d331ccc7a 10/11 Test PASSES after retries.No significant increase in flaky rate(baseline=0.0139, p0=1.0000, reject_threshold=0.0100. adj_baseline=0.1000, p1=0.3487, trust_threshold=0.5000) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=NodeWiseRecoveryTest&test_method=test_node_wise_recovery

@pgellert
pgellert merged commit f4a7605 into redpanda-data:v26.2.x Aug 10, 2026
18 checks passed
@tyson-redpanda tyson-redpanda modified the milestones: v26.2.x-next, v26.2.2 Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build area/redpanda kind/backport PRs targeting a stable branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants