Commit Graph

4465 Commits

Author SHA1 Message Date
Derek Collison
b22ed47a26 Use fast state in case many interior deletes and small fix for staticcheck
Signed-off-by: Derek Collison <derek@nats.io>
2023-02-04 13:55:41 -08:00
Derek Collison
9c02be2409 Various fixes for snapshots.
Due to bug, in rare circumstances could write an empty snapshot for aplied == 0. This would cause a spinning at the raft layer.

1. Allow Truncate() to also properly do a reset of the store when terms were only mismatch.
2. During testing fixed memstore truncate and also made sure per subject info was also cleaned up.
3. Then added fix to detect a bad snapshot on initialization and remove.
4. Do not allow snapshots for applied == 0.

Signed-off-by: Derek Collison <derek@nats.io>
2023-02-04 13:46:06 -08:00
Byron Ruth
a56dcc60c2 Bump 2.9.13-beta
Signed-off-by: Byron Ruth <byron@nats.io>
2023-02-02 14:01:49 -05:00
Byron Ruth
035edeaecb Release v2.9.12
Signed-off-by: Byron Ruth <byron@nats.io>
2023-02-02 13:26:59 -05:00
Tomasz Pietrek
46af979871 Fix current consumers not getting messages after purge
Until now, purge updated all consumers sequences
even if purge subject was only a subset of given consumer filter.
Because of that, even messages from not purged subjects were not fetched
or properly accounted for existing consumers.

Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
2023-02-02 16:27:32 +01:00
Derek Collison
4744ff3478 Bump to 2.9.12-RC.3
Signed-off-by: Derek Collison <derek@nats.io>
2023-02-01 22:46:25 -07:00
Derek Collison
e9a983c802 Do not let !NeedSnapshot() avoid snapshots and compaction.
Signed-off-by: Derek Collison <derek@nats.io>
2023-02-01 22:05:25 -07:00
Derek Collison
390fd02918 Updates to tests for updated Go client changes
Signed-off-by: Derek Collison <derek@nats.io>
2023-01-31 09:47:36 -08:00
Derek Collison
1252653c16 Merge pull request #3829 from nats-io/jarema/fix-message-after-update
Fix Consumer not getting messages after filter update
2023-01-30 19:59:32 -08:00
Derek Collison
d9aa69c332 Bump to 2.9.12-RC.2
Signed-off-by: Derek Collison <derek@nats.io>
2023-01-30 19:56:53 -08:00
Derek Collison
e0798d26eb Merge pull request #3831 from nats-io/snapshots
Minor fixes and optimizations for snapshots.
2023-01-30 19:53:22 -08:00
Derek Collison
598e27243f Fix possible deadlock on dataloss
Signed-off-by: Derek Collison <derek@nats.io>
2023-01-30 19:10:19 -08:00
Derek Collison
6058056e3b 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>
2023-01-30 17:54:18 -08:00
Waldemar Quevedo
13372508e2 Fix for isGroupLeaderless when JS not available (due to shutdown)
Signed-off-by: Waldemar Quevedo <wally@nats.io>
2023-01-30 15:29:42 -08:00
Tomasz Pietrek
836848ca64 Fix Consumer not getting messages after filter update
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
2023-01-30 20:47:17 +01:00
Derek Collison
52a78c0352 Small optimizations.
1. Only snapshot with minSnap time window like consumers and meta. Make it consistent for all to 5s.
2. Only snapshot at the end of processing all entries pending vs inside the loop.
3. Use fast state when calculating sync request, do not need deleted details there.

Signed-off-by: Derek Collison <derek@nats.io>
2023-01-29 10:58:00 -08:00
Derek Collison
e1a2da8d85 Small optimizations
Signed-off-by: Derek Collison <derek@nats.io>
2023-01-28 11:45:47 -08:00
Derek Collison
bf49f23bb1 Only hold on to so many pending in memory, will fetch from WAL
Signed-off-by: Derek Collison <derek@nats.io>
2023-01-28 11:34:55 -08:00
Derek Collison
64096e5ef5 Fix for flapping test
Signed-off-by: Derek Collison <derek@nats.io>
2023-01-27 13:19:44 -08:00
Derek Collison
f4e6481ce7 Allow report cycles between source streams if subjects truly form a cycle.
Signed-off-by: Derek Collison <derek@nats.io>
2023-01-27 13:03:24 -08:00
Derek Collison
7682eaa389 Merge pull request #3804 from madper/dragonflybsd
Add support for dragonfly bsd.
2023-01-27 08:35:42 -08:00
Chengjun Xie
6cbca6b783 Add support for dragonfly bsd.
Simply copy the pse implementation for openbsd.
2023-01-27 10:43:30 +08:00
Derek Collison
8a40326a70 Bump to 2.9.12-RC.1
Signed-off-by: Derek Collison <derek@nats.io>
2023-01-26 10:07:30 -08:00
Derek Collison
c7a75c5a6d Merge pull request #3817 from nats-io/force-consumer-replicas
[FIXED] Force consumer replicas to match for interest policy streams
2023-01-26 09:39:15 -08:00
Derek Collison
3d78459ad1 Fixup for bad merge
Signed-off-by: Derek Collison <derek@nats.io>
2023-01-26 09:09:30 -08:00
Neil Twigg
83932b4be6 Don't mark a clustered stream as unhealthy if making forward progress, add TestJetStreamClusterCurrentVsHealth 2023-01-26 16:57:34 +00:00
Derek Collison
d0a7a8169a Merge branch 'main' into force-consumer-replicas 2023-01-26 08:35:49 -08:00
Derek Collison
461aad17a5 Merge pull request #3820 from nats-io/issue-3791
[FIXED] Select consumer peer(s) from active peers only.
2023-01-26 08:27:11 -08:00
Derek Collison
e15eb22ca6 When we create a consumer with less replicas then the stream, make sure to select from online peers.
Signed-off-by: Derek Collison <derek@nats.io>
2023-01-25 20:08:04 -08:00
Derek Collison
a5cbd0b029 Fixed a bug that would not properly process updates on a stream on restart.
During restart if the stream existed but was also in a meta-snapshot delivered by the leader we would not process the update properly.

Signed-off-by: Derek Collison <derek@nats.io>
2023-01-25 18:16:33 -08:00
Derek Collison
4a3c27a251 Fix MQTT test for consumer replica override.
This was ill-advised by me, not understanding that the messages stream for MQTT was interested policy based.
Interest policy based streams require consumers to match the replica count.

Signed-off-by: Derek Collison <derek@nats.io>
2023-01-25 17:58:57 -08:00
Derek Collison
bcd53ba53a Merge pull request #3808 from nats-io/jarema/fix-not-assigning-sig-sub
Assign signal subscription to consumer when created
2023-01-24 07:12:53 -08:00
Tomasz Pietrek
c89883b6aa Fix assigning signal subscription to consumer
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
2023-01-24 12:26:22 +01:00
Derek Collison
f62d929018 Consumer must match replica of parent stream if interest based policy.
Signed-off-by: Derek Collison <derek@nats.io>
2023-01-23 20:16:42 -08:00
Derek Collison
f4ee6530a0 When updating a stream to Direct Gets we were not spinning up subscription endpoint properly.
Signed-off-by: Derek Collison <derek@nats.io>
2023-01-23 16:51:07 -08:00
Ivan Kozlovic
79ca0c1787 Move test to "norace_test.go"
The test TestJetStreamClusterConsumerListPaging was in the
jetstream_cluster_3_test.go and because of `-race` flag would
take more than 440 seconds (7+ minutes) as seen here:

https://app.travis-ci.com/github/nats-io/nats-server/jobs/593984385#L335

Without the `-race` flag, this test takes ~17 seconds.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2023-01-23 17:05:18 -07:00
Derek Collison
68b4570226 Fix for filtered state for all subjects when the first sequence(s) are deleted.
Discovered doing the optimizations for interior deletes.

Signed-off-by: Derek Collison <derek@nats.io>
2023-01-21 16:01:44 -08:00
Derek Collison
2aeb5e2c5a Update snapshots to numCores and maxProcs after maxrocs.Set()
Signed-off-by: Derek Collison <derek@nats.io>
2023-01-20 11:30:43 -08:00
Neil Twigg
1baa1fbda8 Use highwayhash for last stream, consumer and cluster snapshots 2023-01-12 16:16:14 +00:00
peaaceChoi
038037381b Fix some typos in code comment 2023-01-12 10:31:32 +09:00
Byron Ruth
f3c0890a97 Bump to 2.9.12-beta
Signed-off-by: Byron Ruth <byron@nats.io>
2023-01-06 12:40:19 -05:00
Byron Ruth
3491f43199 Release v2.9.11
Signed-off-by: Byron Ruth <byron@nats.io>
2023-01-06 12:24:36 -05:00
Neil Twigg
d853b0eb89 Deduplicate *subscription in Sublist 2023-01-06 13:19:20 +00:00
Derek Collison
f5d939ec24 Added test for #3636
Signed-off-by: Derek Collison <derek@nats.io>
2023-01-05 10:56:52 -08:00
Derek Collison
9a69172236 Bump to 2.9.11-RC.1
Signed-off-by: Derek Collison <derek@nats.io>
2023-01-05 10:33:47 -08:00
Derek Collison
ad53d455f8 When migrating leaders off a server when the leafnode is not connected, also ensure leaders can not return until reconnected.
Signed-off-by: Derek Collison <derek@nats.io>
2023-01-05 08:02:50 -08:00
Derek Collison
6c5f0a669d Ensure we add in new consumers from a meta snapshot from the leader.
Signed-off-by: Derek Collison <derek@nats.io>
2023-01-04 22:18:31 -08:00
Derek Collison
d9cb1e6286 Fix for #3734
When a msg blk was not writen correctly, but the idx file was, max bytes for a stream would no longer be honored since the deletion of any messages in that empty block were not being handled properly.

Signed-off-by: Derek Collison <derek@nats.io>
2022-12-31 18:50:46 -08:00
Neil
1d53b47b33 Merge pull request #3754 from nats-io/neil/golangcilint
Switch to `golangci-lint`
2022-12-30 20:12:03 +00:00
Neil Twigg
14d0ba1c65 Fix some lint errors after move to golangci-lint 2022-12-30 20:00:08 +00:00