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

nats-io / nats-server / 16514080193
83%

Build:
DEFAULT BRANCH: main
Ran 25 Jul 2025 05:53AM UTC
Jobs 1
Files 59
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

24 Jul 2025 02:40PM UTC coverage: 85.848% (+0.2%) from 85.69%
16514080193

push

github

web-flow
(2.12) Filestore async flush (#7018)

The filestore's `AsyncFlush` setting can now be enabled for a JetStream
stream using the `AllowAsyncFlush` field. Some initial benchmarks showed
a 10-15% performance increase when using a R3 stream (3-node cluster
with each node in a different availability zone).

Only enabling the filestore's `AsyncFlush` setting without additional
code would be unsafe. That's why this PR introduces some new mechanisms
to make it safe. This makes the performance improvement essentially
"free", with no negative consequences for data safety/consistency.
- Before `n.InstallSnapshot(..)` we now do a `mset.flushAllPending()` to
ensure all state represented in the snapshot, actually all made it to
disk.
- The previous `fs.lmb` would only be sometimes be flushed, for example
in `fs.checkLastBlock` but not when creating a new `fs.lmb` in
`fs.newMsgBlockForWrite`. Instead, always flush and close `fs.lmb` when
creating a new block in `fs.newMsgBlockForWrite`. This resolves
non-monotonic sequence issues that could be reproduced by Antithesis.
- The `AllowAsyncFlush` stream setting can be freely/safely enabled and
disabled. It will only be effective when using file storage, and only
when the stream is backed by a Raft log, i.e. it's replicated.

Relates to https://github.com/nats-io/nats-server/issues/6784

Signed-off-by: Maurice van Veen <github@mauricevanveen.com>

71266 of 83014 relevant lines covered (85.85%)

374223.01 hits per line

Uncovered Existing Lines

Lines Coverage ∆ File
2
94.54
0.08% src/github.com/nats-io/nats-server/server/gateway.go
2
93.71
0.0% src/github.com/nats-io/nats-server/server/route.go
3
95.26
0.18% src/github.com/nats-io/nats-server/server/client.go
4
73.36
0.37% src/github.com/nats-io/nats-server/server/jetstream_api.go
6
88.27
0.23% src/github.com/nats-io/nats-server/server/consumer.go
7
53.29
-0.52% src/github.com/nats-io/nats-server/server/jetstream_errors_generated.go
26
76.63
0.0% src/github.com/nats-io/nats-server/server/store.go
173
85.95
0.02% src/github.com/nats-io/nats-server/server/memstore.go
556
85.93
-0.04% src/github.com/nats-io/nats-server/server/stream.go
591
81.7
0.56% src/github.com/nats-io/nats-server/server/jetstream_cluster.go
1102
83.69
0.2% src/github.com/nats-io/nats-server/server/filestore.go
Jobs
ID Job ID Ran Files Coverage
1 16514080193.1 25 Jul 2025 05:53AM UTC 59
85.85
GitHub Action Run
Source Files on build 16514080193
  • Tree
  • List 59
  • Changed 18
  • Source Changed 6
  • Coverage Changed 18
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #16514080193
  • 71912c72 on github
  • Prev Build on main (#16488096415)
  • Next Build on main (#16536242663)
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