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

nats-io / nats-server / 22169421386
84%

Build:
DEFAULT BRANCH: main
Ran 19 Feb 2026 06:16AM UTC
Jobs 1
Files 61
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

18 Feb 2026 12:32PM UTC coverage: 84.003% (-0.7%) from 84.714%
22169421386

push

github

web-flow
[IMPROVED] Asynchronous meta stream/consumer assignments snapshots (#7827)

A NATS system with many 100s of thousands up to millions of
stream/consumer assets spread over many nodes will notice occasional
freezes of the JetStream API while meta snapshots are generated. These
snapshots were created synchronously, inline, and while holding the JS
lock. This could hold up new JetStream API requests coming in as well as
delay inflight stream/consumer CRUD responses.

This PR improves this, perhaps fixes to a degree, by having these meta
snapshots be asynchronous. It will generally take a bit longer to create
these asynchronous snapshots (when compared to the sync/blocking ones)
as JetStream operations will continue without significant delay or
freezes.

Log messages have been updated to clearly differentiate between
generating/encoding the snapshot content and blocking/async creation and
installation of it (as well as containing human-readable sizes and how
much of the log was compacted away as a result of the snapshot):
```
[WRN] Metalayer snapshot generation took 6.792s (streams: 1, consumers: 102048, marshal: 5.645s, s2: 0.373s, uncompressed: 58MB, compressed: 5MB)
[WRN] Metalayer async snapshot took 22.887s (streams: 1, consumers: 110724, compacted: 17MB)
```

Asynchronous snapshots will be used by default, but there can be cases
where we need to fall back to synchronous/blocking snapshots:
- The snapshot created during shutdown or shortly after restart will
still be blocking. This cleans up the log before allowing new operations
in for a server that's recovering.
- While reading in the previous snapshot and the append entries that can
be snapshotted, some disk corruption could technically have silently
slipped in between us applying the changes before and us reading them in
again now. We fall back to blocking snapshots to install it while the
system is still running without endangering safety/correctness during
runtime, or being unavailable after a r... (continued)

74506 of 88694 relevant lines covered (84.0%)

363192.07 hits per line

Uncovered Existing Lines

Lines Coverage ∆ File
1
80.68
-0.57% src/github.com/nats-io/nats-server/server/log.go
1
87.13
0.04% src/github.com/nats-io/nats-server/server/monitor.go
2
83.73
-0.09% src/github.com/nats-io/nats-server/server/jetstream.go
2
90.32
0.08% src/github.com/nats-io/nats-server/server/leafnode.go
2
86.18
-0.92% src/github.com/nats-io/nats-server/server/util.go
3
86.83
-0.09% src/github.com/nats-io/nats-server/server/accounts.go
3
88.13
0.0% src/github.com/nats-io/nats-server/server/auth.go
4
73.92
0.42% src/github.com/nats-io/nats-server/server/jetstream_api.go
5
86.4
0.0% src/github.com/nats-io/nats-server/server/events.go
6
93.68
-0.16% src/github.com/nats-io/nats-server/server/gateway.go
9
93.65
-0.15% src/github.com/nats-io/nats-server/server/client.go
14
89.67
-0.43% src/github.com/nats-io/nats-server/server/server.go
21
88.09
0.15% src/github.com/nats-io/nats-server/server/consumer.go
53
80.71
0.93% src/github.com/nats-io/nats-server/server/auth_callout.go
63
82.85
-0.47% src/github.com/nats-io/nats-server/server/filestore.go
64
85.95
-0.01% src/github.com/nats-io/nats-server/server/stream.go
121
82.57
0.07% src/github.com/nats-io/nats-server/server/memstore.go
206
84.14
-8.21% src/github.com/nats-io/nats-server/server/route.go
323
71.56
-18.16% src/github.com/nats-io/nats-server/server/reload.go
370
88.17
-0.21% src/github.com/nats-io/nats-server/server/raft.go
530
78.66
-0.83% src/github.com/nats-io/nats-server/server/opts.go
1215
82.43
-0.12% src/github.com/nats-io/nats-server/server/jetstream_cluster.go
Jobs
ID Job ID Ran Files Coverage
1 22169421386.1 19 Feb 2026 06:16AM UTC 61
84.0
GitHub Action Run
Source Files on build 22169421386
  • Tree
  • List 61
  • Changed 24
  • Source Changed 8
  • Coverage Changed 24
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #22169421386
  • f6c12565 on github
  • Prev Build on main (#22127492550)
  • Next Build on main (#22212128311)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc