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

nats-io / nats-server / 31772366452
76%

Build:
DEFAULT BRANCH: main
Ran 14 Aug 2026 06:20AM UTC
Jobs 1
Files 67
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

13 Aug 2026 02:19PM UTC coverage: 76.577% (-0.8%) from 77.388%
31772366452

push

github

web-flow
(2.15) [IMPROVED] Source stream recreation detection (#8384)

Previously if you started sourcing from a stream that was recreated, it
would wait for the recreated stream's sequence to move back up to the
last sourced sequence before it accepted new messages. This PR detects a
stream being recreated by noticing a changed `Nats-Stream-Identity`,
which is the hash of the stream's created time. There exists no unique
identifier for a stream/consumer lifetime apart from the created time,
so that's used and is the most practical since collisions are unlikely
enough.

- This hash is appended to the source header to know what "identity" of
the stream was associated with the highest sequence for that source.
(source header before: `TEST 1 > > foo`, after: `TEST 1 > > foo
sLkPMPK6`)
- This identity is passed in the consumer create request to prevent a
consumer from being created based on sequences derived from the previous
stream. An error is returned (`JSConsumerStreamIdentityMismatch`) if a
mismatch is detected, the request is then retried with reset sequences
to allow sourcing from the beginning.
- The consumer reset request does not allow for the identity to be
passed in, and instead relies on the caller to notice a different
identity and subsequent in-memory state reset. This prevents unnecessary
churn of requests since the reset will always happen based on a consumer
that already exists and needs to be reset anyway.
- Both the consumer create and reset responses contain this identity to
get informed of the latest identity of the stream, which is then passed
into the source header.

This PR additionally requires that the starting sequence for a consumer
is respected, even for sourcing consumers that were previously
(incorrectly) clamped within the sourced stream's first/last sequence
range.

Upgrade note: the servers on both ends will need to be updated for this
mechanism to kick in. A downgrade should ignore the extra appended
identity from the header and... (continued)

72943 of 95254 relevant lines covered (76.58%)

403029.37 hits per line

Coverage Regressions

Lines Coverage ∆ File
777
86.57
0.04% src/github.com/nats-io/nats-server/server/stream.go
741
79.34
-0.0% src/github.com/nats-io/nats-server/server/filestore.go
724
74.77
0.71% src/github.com/nats-io/nats-server/server/jetstream_api.go
597
83.03
0.08% src/github.com/nats-io/nats-server/server/jetstream_cluster.go
467
58.27
-0.24% src/github.com/nats-io/nats-server/server/jetstream_errors_generated.go
325
87.4
-0.45% src/github.com/nats-io/nats-server/server/consumer.go
317
76.58
-11.2% src/github.com/nats-io/nats-server/server/leafnode.go
225
45.07
-18.96% src/github.com/nats-io/nats-server/server/websocket.go
58
86.09
-1.57% src/github.com/nats-io/nats-server/server/server.go
56
78.93
-0.59% src/github.com/nats-io/nats-server/server/raft.go
54
51.67
-2.78% src/github.com/nats-io/nats-server/server/reload.go
47
88.34
-0.91% src/github.com/nats-io/nats-server/server/client.go
42
62.66
-0.77% src/github.com/nats-io/nats-server/server/opts.go
25
82.96
-1.87% src/github.com/nats-io/nats-server/server/auth.go
12
70.41
-0.41% src/github.com/nats-io/nats-server/server/monitor.go
10
82.5
-0.4% src/github.com/nats-io/nats-server/server/route.go
8
81.57
-0.75% src/github.com/nats-io/nats-server/server/parser.go
5
72.27
-0.14% src/github.com/nats-io/nats-server/server/memstore.go
5
89.66
-0.42% src/github.com/nats-io/nats-server/server/sublist.go
4
85.1
0.14% src/github.com/nats-io/nats-server/server/jetstream.go
2
86.94
0.35% src/github.com/nats-io/nats-server/server/accounts.go
2
87.7
-0.82% src/github.com/nats-io/nats-server/server/util.go
1
93.84
0.04% src/github.com/nats-io/nats-server/server/gateway.go
Jobs
ID Job ID Ran Files Coverage
1 31772366452.1 14 Aug 2026 06:20AM UTC 67
76.58
GitHub Action Run
Source Files on build 31772366452
  • Tree
  • List 67
  • Changed 25
  • Source Changed 7
  • Coverage Changed 24
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #31772366452
  • fcdcacf0 on github
  • Prev Build on main (#31669718926)
  • Next Build on main (#31865403518)
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