Skip to content

Commit b94011e

Browse files
[TEST] Add assert.Unreachable when using legacy JSON stream snapshot (#7486)
Closes #7485. Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
2 parents dd29850 + 3aa9414 commit b94011e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

server/jetstream_cluster.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8765,6 +8765,13 @@ func (mset *stream) stateSnapshotLocked() []byte {
87658765
}
87668766

87678767
// Older v1 version with deleted as a sorted []uint64.
8768+
// For a stream with millions or billions of interior deletes, this will be huge.
8769+
// Now that all server versions 2.10.+ support binary snapshots, we should never fall back.
8770+
assert.Unreachable("Legacy JSON stream snapshot used", map[string]any{
8771+
"stream": mset.cfg.Name,
8772+
"account": mset.acc.Name,
8773+
})
8774+
87688775
state := mset.store.State()
87698776
snap := &streamSnapshot{
87708777
Msgs: state.Msgs,

0 commit comments

Comments
 (0)