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

cameri / nats-server / 36095955724
81%

Build:
DEFAULT BRANCH: main
Ran 25 Sep 2026 05:54AM UTC
Jobs 1
Files 66
Run time 1min
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

09 Sep 2026 09:36AM UTC coverage: 82.721% (+0.08%) from 82.64%
36095955724

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`

71498 of 86433 relevant lines covered (82.72%)

319324.96 hits per line

Coverage Regressions

Lines Coverage ∆ File
63
78.13
-0.54% src/github.com/nats-io/nats-server/server/filestore.go
26
82.98
0.01% src/github.com/nats-io/nats-server/server/jetstream_cluster.go
24
87.49
-0.26% src/github.com/nats-io/nats-server/server/consumer.go
15
83.57
3.82% src/github.com/nats-io/nats-server/server/raft.go
11
86.14
-0.13% src/github.com/nats-io/nats-server/server/stream.go
10
73.93
-0.05% src/github.com/nats-io/nats-server/server/jetstream_api.go
6
85.18
-0.2% src/github.com/nats-io/nats-server/server/events.go
5
84.39
-0.25% src/github.com/nats-io/nats-server/server/jetstream.go
3
77.72
0.24% src/github.com/nats-io/nats-server/server/opts.go
2
93.71
0.1% src/github.com/nats-io/nats-server/server/gateway.go
2
98.44
-1.56% src/github.com/nats-io/nats-server/server/jetstream_versioning.go
2
89.48
-0.08% src/github.com/nats-io/nats-server/server/leafnode.go
2
90.85
-0.27% src/github.com/nats-io/nats-server/server/parser.go
2
84.68
-0.09% src/github.com/nats-io/nats-server/server/route.go
1
92.86
-0.02% src/github.com/nats-io/nats-server/server/client.go
Jobs
ID Job ID Ran Files Coverage
1 36095955724.1 25 Sep 2026 05:54AM UTC 66
82.72
GitHub Action Run
Source Files on build 36095955724
  • Tree
  • List 66
  • Changed 19
  • Source Changed 0
  • Coverage Changed 19
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #36095955724
  • 3ad37644 on github
  • Prev Build on main (#35957154468)
  • Next Build on main (#36218827202)
  • Delete
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