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

cameri / nats-server / 36523340145
81%

Build:
DEFAULT BRANCH: main
Ran 29 Sep 2026 05:55AM 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: 81.243% (-0.4%) from 81.66%
36523340145

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`

70221 of 86433 relevant lines covered (81.24%)

334037.79 hits per line

Coverage Regressions

Lines Coverage ∆ File
99
61.26
-6.2% src/github.com/nats-io/nats-server/server/reload.go
75
73.61
-16.09% src/github.com/nats-io/nats-server/server/msgtrace.go
54
82.17
-2.51% src/github.com/nats-io/nats-server/server/route.go
34
77.74
-0.17% src/github.com/nats-io/nats-server/server/raft.go
34
85.6
-0.51% src/github.com/nats-io/nats-server/server/stream.go
29
91.81
-0.66% src/github.com/nats-io/nats-server/server/client.go
23
82.94
0.17% src/github.com/nats-io/nats-server/server/jetstream_cluster.go
18
63.57
-0.43% src/github.com/nats-io/nats-server/server/opts.go
16
87.55
-0.35% src/github.com/nats-io/nats-server/server/consumer.go
15
73.85
-0.23% src/github.com/nats-io/nats-server/server/jetstream_api.go
13
85.77
-0.32% src/github.com/nats-io/nats-server/server/accounts.go
13
84.56
-0.46% src/github.com/nats-io/nats-server/server/events.go
5
78.11
-0.03% src/github.com/nats-io/nats-server/server/filestore.go
5
91.9
-0.72% src/github.com/nats-io/nats-server/server/jetstream_batching.go
5
86.37
-0.15% src/github.com/nats-io/nats-server/server/monitor.go
4
89.32
-0.13% src/github.com/nats-io/nats-server/server/leafnode.go
4
88.3
-0.15% src/github.com/nats-io/nats-server/server/server.go
2
84.49
-0.1% src/github.com/nats-io/nats-server/server/jetstream.go
2
83.85
-0.27% src/github.com/nats-io/nats-server/server/parser.go
1
86.38
-0.47% src/github.com/nats-io/nats-server/server/util.go
Jobs
ID Job ID Ran Files Coverage
1 36523340145.1 29 Sep 2026 05:55AM UTC 66
81.24
GitHub Action Run
Source Files on build 36523340145
  • Tree
  • List 66
  • Changed 21
  • Source Changed 0
  • Coverage Changed 21
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #36523340145
  • 3ad37644 on github
  • Prev Build on main (#36379564149)
  • 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