mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Minor fixes and optimizations for snapshots.
We were snappshotting more then needed, so double check that we should be doing this at the stream and consumer level. At the raft level, we should have always been compacting the WAL to last+1, so made that consistent. Also fixed bug that would not skip last if more items behind the snapshot. Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
@@ -2629,7 +2629,8 @@ func TestJetStreamClusterStreamCatchupNoState(t *testing.T) {
|
||||
t.Fatalf("Error installing snapshot: %v", err)
|
||||
}
|
||||
}
|
||||
js.Publish("foo.created", []byte("REQ"))
|
||||
_, err := js.Publish("foo.created", []byte("REQ"))
|
||||
require_NoError(t, err)
|
||||
}
|
||||
|
||||
config := nsl.JetStreamConfig()
|
||||
@@ -2668,14 +2669,14 @@ func TestJetStreamClusterStreamCatchupNoState(t *testing.T) {
|
||||
nc, js = jsClientConnect(t, c.randomServer())
|
||||
defer nc.Close()
|
||||
|
||||
if _, err := js.Publish("foo.created", []byte("REQ")); err != nil {
|
||||
t.Fatalf("Unexpected error: %v", err)
|
||||
}
|
||||
c.waitOnStreamLeader("$G", "TEST")
|
||||
|
||||
_, err = js.Publish("foo.created", []byte("ZZZ"))
|
||||
require_NoError(t, err)
|
||||
|
||||
si, err := js.StreamInfo("TEST")
|
||||
if err != nil {
|
||||
t.Fatalf("Unexpected error: %v", err)
|
||||
}
|
||||
require_NoError(t, err)
|
||||
|
||||
if si.State.LastSeq != 101 {
|
||||
t.Fatalf("bad state after restart: %+v", si.State)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user