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

nats-io / nats-server / 20087658921
85%

Build:
DEFAULT BRANCH: main
Ran 10 Dec 2025 05:53AM 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

09 Dec 2025 02:35PM UTC coverage: 84.763% (+0.07%) from 84.691%
20087658921

push

github

web-flow
[FIXED] Filestore compaction issues (#7627)

This PR fixes a couple issues relating to `Compact(seq)`:
1. If an (almost) empty stream would be compacted or purged to `seq=2`
and the server would be hard killed after, it would not have written a
tombstone to recover this sequence from.
2. A particular sequence of `SkipMsg(seq)`, `Compact(seq)`,
`SkipMsg(seq+1)` would preserve the block and tombstones after the
compact, but the subsequent `SkipMsg(seq+1)` on the empty block would
see the server starting to overwrite block data at the head of the file.
Reading that file from disk afterward would appear corrupted and log:
`indexCacheBuf corrupt record state`.
3. Compaction of a block that would allow to reclaim over half of the
storage size taken up by the file would overwrite the file in place.
This could lose messages if the server was hard killed after the file
truncation, but before it fully wrote the compacted bytes. We now write
the file separately and rename it to overwrite the original file
atomically.

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

74120 of 87444 relevant lines covered (84.76%)

359268.04 hits per line

Uncovered Existing Lines

Lines Coverage ∆ File
1
86.91
-0.03% src/github.com/nats-io/nats-server/server/accounts.go
1
94.72
0.83% src/github.com/nats-io/nats-server/server/client.go
2
79.41
0.0% src/github.com/nats-io/nats-server/server/opts.go
2
90.96
-0.19% src/github.com/nats-io/nats-server/server/parser.go
2
93.54
0.08% src/github.com/nats-io/nats-server/server/route.go
3
86.22
0.02% src/github.com/nats-io/nats-server/server/stream.go
5
87.27
0.03% src/github.com/nats-io/nats-server/server/raft.go
6
85.98
-0.28% src/github.com/nats-io/nats-server/server/events.go
10
88.6
0.39% src/github.com/nats-io/nats-server/server/consumer.go
16
82.99
0.14% src/github.com/nats-io/nats-server/server/jetstream_cluster.go
20
73.68
-0.2% src/github.com/nats-io/nats-server/server/jetstream_api.go
22
83.14
-0.05% src/github.com/nats-io/nats-server/server/memstore.go
700
82.84
-0.16% src/github.com/nats-io/nats-server/server/filestore.go
Jobs
ID Job ID Ran Files Coverage
1 20087658921.1 10 Dec 2025 05:53AM UTC 61
84.76
GitHub Action Run
Source Files on build 20087658921
  • Tree
  • List 61
  • Changed 20
  • Source Changed 1
  • Coverage Changed 20
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #20087658921
  • 2e882d1c on github
  • Prev Build on main (#20052263983)
  • Next Build on main (#20122323441)
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

© 2025 Coveralls, Inc