Skip to content

fix(server): fix stream stats corruption on topic purge#2736

Open
hubcio wants to merge 1 commit intomasterfrom
stats-fix
Open

fix(server): fix stream stats corruption on topic purge#2736
hubcio wants to merge 1 commit intomasterfrom
stats-fix

Conversation

@hubcio
Copy link
Contributor

@hubcio hubcio commented Feb 13, 2026

Purging one topic while a sibling retained messages reported
zero messages for the entire stream via get_stats(). The
zero_out chain used store(0) at each tier and then called
zero_out on the parent, blanking the entire ancestor chain
rather than subtracting the purged child's contribution.

Replace store(0) with swap(0) + parent.decrement(prev) so
each tier only subtracts its own value. Remove the redundant
topic-level zero_out from purge_topic — partition zeroing
already propagates correctly through the hierarchy.

Purging one topic while a sibling retained messages reported
zero messages for the entire stream via get_stats(). The
zero_out chain used store(0) at each tier and then called
zero_out on the parent, blanking the entire ancestor chain
rather than subtracting the purged child's contribution.

Replace store(0) with swap(0) + parent.decrement(prev) so
each tier only subtracts its own value. Remove the redundant
topic-level zero_out from purge_topic — partition zeroing
already propagates correctly through the hierarchy.
@codecov
Copy link

codecov bot commented Feb 13, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.55%. Comparing base (153cb37) to head (a7e2a20).

Files with missing lines Patch % Lines
core/server/src/streaming/stats/mod.rs 50.00% 6 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2736      +/-   ##
============================================
- Coverage     68.58%   68.55%   -0.03%     
  Complexity      585      585              
============================================
  Files           735      735              
  Lines         60370    60342      -28     
  Branches      56783    56755      -28     
============================================
- Hits          41403    41366      -37     
- Misses        16941    16950       +9     
  Partials       2026     2026              
Flag Coverage Δ
rust 70.08% <50.00%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
core/server/src/shard/system/topics.rs 90.05% <ø> (+0.40%) ⬆️
core/server/src/streaming/stats/mod.rs 84.68% <50.00%> (-10.87%) ⬇️

... and 5 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

2 participants