• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

cameri / nats-server
82%

Build:
DEFAULT BRANCH: main
Repo Added 10 Sep 2026 05:52AM UTC
Token BLBJFbuqus62krUh4mGJFSATQjFO5QXpA regen
Build 18 Last
Files 66
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

LAST BUILD ON BRANCH main
branch: SELECT
CHANGE BRANCH
x
Sync Branches
  • No branch selected
  • main

09 Sep 2026 09:36AM UTC coverage: 81.697% (-0.06%) from 81.755%
36295354253

push

github

web-flow
[FIXED] Remove stale JetStream account usage after peer removal (#8570)

Fixes #8563.

When a JetStream server is permanently removed from the cluster, its
last reported account usage can remain in `jsAccount.rusage`. Because
that value is still included in the account totals, replacing a stream
replica on another server can cause storage usage to be counted twice.

I reproduced this with a 4-node cluster and an R3 stream. After removing
one of the replica-holding servers and letting the stream move to the
spare node, the stream was still correctly running with 3 replicas, but
the account storage usage increased as if there were 4 copies.

This change removes the departed server's usage when its meta peer
removal is committed. It also ignores a late usage update from the
removed node so that the stale entry cannot be added back after cleanup.

I added a regression test that:

* creates an R3 stream on a 4-node cluster,
* verifies the initial account usage,
* removes one of the servers hosting a replica,
* waits for the replica to move to the spare server,
* verifies the account usage stays unchanged,
* and checks that a late usage update from the removed peer does not
recreate the stale entry.

Testing:

* new regression test passes repeatedly
* regression test passes with `-race`
* related peer-removal and account-usage tests pass
* `go vet ./server`
* `git diff --check`

70613 of 86433 relevant lines covered (81.7%)

331066.23 hits per line

Relevant lines Covered
Build:
Build:
86433 RELEVANT LINES 70613 COVERED LINES
331066.23 HITS PER LINE
Source Files on main
  • Tree
  • List 66
  • Changed 18
  • Source Changed 0
  • Coverage Changed 18
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
36295354253 main [FIXED] Remove stale JetStream account usage after peer removal (#8570) Fixes #8563. When a JetStream server is permanently removed from the cluster, its last reported account usage can remain in `jsAccount.rusage`. Because that value is still i... push 27 Sep 2026 05:54AM UTC web-flow github
81.7
36218827202 main [FIXED] Remove stale JetStream account usage after peer removal (#8570) Fixes #8563. When a JetStream server is permanently removed from the cluster, its last reported account usage can remain in `jsAccount.rusage`. Because that value is still i... push 26 Sep 2026 05:52AM UTC web-flow github
81.75
36095955724 main [FIXED] Remove stale JetStream account usage after peer removal (#8570) Fixes #8563. When a JetStream server is permanently removed from the cluster, its last reported account usage can remain in `jsAccount.rusage`. Because that value is still i... push 25 Sep 2026 05:54AM UTC web-flow github
82.72
35957154468 main [FIXED] Remove stale JetStream account usage after peer removal (#8570) Fixes #8563. When a JetStream server is permanently removed from the cluster, its last reported account usage can remain in `jsAccount.rusage`. Because that value is still i... push 24 Sep 2026 05:53AM UTC web-flow github
82.64
35819776001 main [FIXED] Remove stale JetStream account usage after peer removal (#8570) Fixes #8563. When a JetStream server is permanently removed from the cluster, its last reported account usage can remain in `jsAccount.rusage`. Because that value is still i... push 23 Sep 2026 05:53AM UTC web-flow github
82.65
35688182615 main [FIXED] Remove stale JetStream account usage after peer removal (#8570) Fixes #8563. When a JetStream server is permanently removed from the cluster, its last reported account usage can remain in `jsAccount.rusage`. Because that value is still i... push 22 Sep 2026 05:52AM UTC web-flow github
77.72
35562382724 main [FIXED] Remove stale JetStream account usage after peer removal (#8570) Fixes #8563. When a JetStream server is permanently removed from the cluster, its last reported account usage can remain in `jsAccount.rusage`. Because that value is still i... push 21 Sep 2026 05:55AM UTC web-flow github
81.19
35489953157 main [FIXED] Remove stale JetStream account usage after peer removal (#8570) Fixes #8563. When a JetStream server is permanently removed from the cluster, its last reported account usage can remain in `jsAccount.rusage`. Because that value is still i... push 20 Sep 2026 05:51AM UTC web-flow github
82.59
35422147645 main [FIXED] Remove stale JetStream account usage after peer removal (#8570) Fixes #8563. When a JetStream server is permanently removed from the cluster, its last reported account usage can remain in `jsAccount.rusage`. Because that value is still i... push 19 Sep 2026 05:51AM UTC web-flow github
82.68
35308254883 main [FIXED] Remove stale JetStream account usage after peer removal (#8570) Fixes #8563. When a JetStream server is permanently removed from the cluster, its last reported account usage can remain in `jsAccount.rusage`. Because that value is still i... push 18 Sep 2026 05:52AM UTC web-flow github
81.7
See All Builds (18)

Badge your Repo: nats-server

We detected this repo isn’t badged! Grab the embed code to the right, add it to your repo to show off your code coverage, and when the badge is live hit the refresh button to remove this message.

Could not find badge in README.

Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

Refresh
  • Settings
  • Repo on GitHub
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc