Commit Graph

4 Commits

Author SHA1 Message Date
Derek Collison
340fcc90bc Basic raft tests
Signed-off-by: Derek Collison <derek@nats.io>
2023-04-12 11:48:22 -07:00
Matthias Hanel
268a29e719 fix unit test that did not fail when header was modified (#3000)
Signed-off-by: Matthias Hanel <mh@synadia.com>
2022-04-04 19:24:09 -04:00
Ivan Kozlovic
9f30bf00e0 [FIXED] Corrupted headers receiving from consumer with meta-only
When a consumer is configured with "meta-only" option, and the
stream was backed by a memory store, a memory corruption could
happen causing the application to receive corrupted headers.

Also replaced most of usage of `append(a[:0:0], a...)` to make
copies. This was based on this wiki:
https://github.com/go101/go101/wiki/How-to-efficiently-clone-a-slice%3F

But since Go 1.15, it is actually faster to call make+copy instead.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-12-01 10:50:15 -07:00
Derek Collison
1a4410a3f7 Added more robust checking for decoding append entries.
Allow a buffer to be passed in to relive GC pressure.

Signed-off-by: Derek Collison <derek@nats.io>
2021-10-09 09:37:03 -07:00