Derek Collison
960c45df81
Use of sync.Pool for filestore could cause msg corruption.
...
Signed-off-by: Derek Collison <derek@nats.io >
2021-07-06 08:41:01 -07:00
Derek Collison
9b73fae5bd
We should not sit in place here, no measurable effect on latency in tests
...
Signed-off-by: Derek Collison <derek@nats.io >
2021-07-01 14:29:09 -07:00
Derek Collison
617f061084
Check not really needed here, so removed
...
Signed-off-by: Derek Collison <derek@nats.io >
2021-06-30 15:08:56 -07:00
Derek Collison
99fed910f0
Improvements to large numbers of JetStream R1 consumers per stream.
...
1. We were holding open FDs longer than we should for consumers causing issues with open FD limits. We now do not hold them open and cap updates a bit better.
2. When doing a stream delete, consumer delete was repeating alot of work that was not necessary, causing longer delays. This has been optimized a bit, still more improvements to be made.
3. We cover all JS under a single export, but that was also trapping GetNext for pull based consumers, and since this was a no-op (is handled at user account level) we were creating alot of garbage service import responses and reverse map entries that had to be garbage collected. We have a fix in to avoind this but still looking for a better one.
4. Still had some lingering references to all exports vs single JS export.
Signed-off-by: Derek Collison <derek@nats.io >
2021-06-29 05:45:55 -07:00
Derek Collison
bb84ef7d91
Added ability to match based on last expected sequence per subject.
...
Signed-off-by: Derek Collison <derek@nats.io >
2021-06-28 10:57:50 -07:00
R.I.Pienaar
0d71d35e43
do not log at Error level for some store failures
...
Some of these are quite generic errors that can happen a lot
in normal circumstances so no need to be too noisy about them
Fixes one missed old style Api Error
Signed-off-by: R.I.Pienaar <rip@devco.net >
2021-06-28 10:18:16 +02:00
Derek Collison
545230bd9e
FIXED Clustered streams can become broken with seq mismatch state on low level store failures.
...
We can account for high level failure properly but were not properly accounting for low level store failures.
Signed-off-by: Derek Collison <derek@nats.io >
2021-06-25 13:46:40 -07:00
Derek Collison
bf6335dff9
Add in ability to have encrypted JetStream filestores.
...
This supports XChaChaPoly1305 for Seal and Open and ChaCha20 for our message blocks which use highway hashes and sequence numbers for authenticity.
We support snapshot and restore as well.
Signed-off-by: Derek Collison <derek@nats.io >
2021-06-21 19:28:10 -07:00
Derek Collison
9398c3ca28
Allow for more advanced purge operations that filter by subject, specify the sequence or number of messages to keep.
...
Signed-off-by: Derek Collison <derek@nats.io >
2021-06-19 07:04:44 -07:00
R.I.Pienaar
53ae604403
further tagged error confusion cleanups
...
Signed-off-by: R.I.Pienaar <rip@devco.net >
2021-06-18 21:35:26 +02:00
Derek Collison
e7fd6961d6
Fix data race condition
...
Signed-off-by: Derek Collison <derek@nats.io >
2021-06-18 07:47:19 -07:00
Derek Collison
d0ac1a40ca
Added in per subject limits for streams.
...
Signed-off-by: Derek Collison <derek@nats.io >
2021-06-15 06:36:34 -07:00
Derek Collison
08cdb2d2ea
Make filtered consumers in large mixed streams more efficient.
...
Allow wider scoped filtered subjects.
We introduce a per subject information tracking to filestore to optimize for large mux'd streams and more efficient filtered consumers.
Signed-off-by: Derek Collison <derek@nats.io >
2021-06-15 04:44:05 -07:00
Derek Collison
326a377b3e
When leader changes happened to streams that mirrored or sourced other streams we could continue to try to create consumers.
...
This could get excessive on a stream that has sourced many upstream origin streams and had several leader changes.
Signed-off-by: Derek Collison <derek@nats.io >
2021-06-10 19:47:46 -07:00
Derek Collison
e238512285
Handling of rewrites for subjects to a globally routed subject was not properly handling c.pa.deliver or reply rewrite.
...
Signed-off-by: Derek Collison <derek@nats.io >
2021-06-09 15:34:47 -07:00
R.I.Pienaar
ee9d10f40b
restore old error constants for backwards compat
...
Signed-off-by: R.I.Pienaar <rip@devco.net >
2021-05-26 08:04:50 +02:00
R.I.Pienaar
0d391b02eb
richer api errors proposal
...
Signed-off-by: R.I.Pienaar <rip@devco.net >
2021-05-26 08:04:50 +02:00
Derek Collison
308355a2fd
Fix for #2242 .
...
When we had a duplicate detected in R>1 mode we set the skip sequence indicator but were not using that when dealing with underlying store.
Signed-off-by: Derek Collison <derek@nats.io >
2021-05-24 08:21:41 -07:00
Derek Collison
4bde91e9bd
Fix a data race.
...
Signed-off-by: Derek Collison <derek@nats.io >
2021-05-20 07:31:55 -07:00
Derek Collison
a27b0dd673
Move default file and dir perms
...
Signed-off-by: Derek Collison <derek@nats.io >
2021-05-19 14:46:07 -07:00
Derek Collison
df8835d2d0
Stupid spelling where I introduced this..
...
Signed-off-by: Derek Collison <derek@nats.io >
2021-05-12 14:32:06 -07:00
Derek Collison
060f2ec127
Fix stream source lookup and add in optional External to StreamSourceInfo.
...
Signed-off-by: Derek Collison <derek@nats.io >
2021-05-12 12:32:56 -07:00
Derek Collison
6e17b7a303
Fix for #2213
...
We do not want to report consumers that were created for the purpose of sources or mirrors.
Signed-off-by: Derek Collison <derek@nats.io >
2021-05-12 07:51:53 -07:00
Derek Collison
494ddeec5b
Fix for #2202
...
When using multiple source streams from either different accounts or domains, the stream name could be the same and would cause bad behavior.
Signed-off-by: Derek Collison <derek@nats.io >
2021-05-11 13:12:10 -07:00
Derek Collison
9a517194a1
Merge pull request #2191 from nats-io/raft_catchup_snap
...
[FIXED] Raft groups could continually spin trying to catch up.
2021-05-07 14:20:37 -07:00
Derek Collison
4500f7889e
For WorkQueues that have direct we need to make sure they have received the message before deleting.
...
Signed-off-by: Derek Collison <derek@nats.io >
2021-05-07 14:13:36 -07:00
Derek Collison
bd9172fb61
With WorkQueue policy streams that are mirrored or sourced need to only delete if no regular consumers.
...
Signed-off-by: Derek Collison <derek@nats.io >
2021-05-07 13:14:56 -07:00
R.I.Pienaar
b5f846a719
add domain in JS advisories
...
Signed-off-by: R.I.Pienaar <rip@devco.net >
2021-05-07 19:35:46 +02:00
Derek Collison
35a60289d9
Fixed mirror/source streams from work queues.
...
Fixed deadlock with no-ack consumers on interest retention streams.
Signed-off-by: Derek Collison <derek@nats.io >
2021-05-07 06:01:52 -07:00
Derek Collison
c8d2132ee5
Expand test to target mirrors and sources in different JS domains.
...
Signed-off-by: Derek Collison <derek@nats.io >
2021-05-06 18:45:27 -06:00
Derek Collison
a301d3a892
Check direct consumers directly, stream state back to previous behavior
...
Signed-off-by: Derek Collison <derek@nats.io >
2021-04-21 09:40:04 -07:00
Derek Collison
b5521053e6
Make sure to clean up ephemerals across a Gateway.
...
Also report direct consumers in num consumers in stream info.
Signed-off-by: Derek Collison <derek@nats.io >
2021-04-21 08:47:55 -07:00
Derek Collison
ef7a811a71
Check that we have mirror still to not panic and deadlock/hang
...
Signed-off-by: Derek Collison <derek@nats.io >
2021-04-20 16:41:41 -07:00
Derek Collison
5aa3dd7761
Put back direct consumer subject prefix
...
Signed-off-by: Derek Collison <derek@nats.io >
2021-04-20 13:35:48 -07:00
Derek Collison
0a3e54c88a
Fix subscription leaks for mirrors and sources for streams as well as flow control subjects for consumers.
...
Signed-off-by: Derek Collison <derek@nats.io >
2021-04-20 12:13:07 -07:00
Derek Collison
68ddd519d2
Process upstream missing messages for mirrors better.
...
Signed-off-by: Derek Collison <derek@nats.io >
2021-04-19 20:15:21 -07:00
Derek Collison
7adf7bc7d6
Maintain stream sequence properly
...
Signed-off-by: Derek Collison <derek@nats.io >
2021-04-18 18:38:28 -07:00
Derek Collison
d84af39f16
Make sure source consumers work properly after expiration/purge
...
Signed-off-by: Derek Collison <derek@nats.io >
2021-04-16 17:28:04 -07:00
Derek Collison
60df8a2fcb
Minimize proposals doing skip msgs
...
Signed-off-by: Derek Collison <derek@nats.io >
2021-04-16 14:19:29 -07:00
Derek Collison
f3f04e6442
Fix flapper
...
Signed-off-by: Derek Collison <derek@nats.io >
2021-04-15 06:34:12 -07:00
Derek Collison
466789e307
Cleanup request subscription if no answer
...
Signed-off-by: Derek Collison <derek@nats.io >
2021-04-14 15:04:22 -07:00
Derek Collison
395728bab9
Allow control messages like heartbeats to pass the old sub test.
...
Signed-off-by: Derek Collison <derek@nats.io >
2021-04-14 14:11:02 -07:00
Derek Collison
627d20f7d4
Make sure to stop retries for mirror consumers when not leader and through old control messages.
...
Signed-off-by: Derek Collison <derek@nats.io >
2021-04-14 10:43:55 -07:00
Derek Collison
f6a82a7c98
When messages were no longer available in an upstream stream a mirror could wedge and not resolve.
...
This fixes that scenario by detecting the situation and inserting skip msgs to catch up.
Signed-off-by: Derek Collison <derek@nats.io >
2021-04-13 11:46:03 -07:00
Derek Collison
90989d57d6
Change to report total deleted by default for stream info.
...
Allow deleted details if requested.
Signed-off-by: Derek Collison <derek@nats.io >
2021-04-12 18:10:11 -07:00
Derek Collison
2bea1f64f5
Merge pull request #2078 from nats-io/mirror_panic
...
If a mirror was removed or changed this would panic.
2021-04-07 14:26:56 -07:00
Derek Collison
114431bb3c
If a mirror config was removed the reference to mset.mirror.msgs would fail.
...
This protects against that.
Signed-off-by: Derek Collison <derek@nats.io >
2021-04-07 10:59:05 -07:00
Derek Collison
c0e8590c0f
During startup each filtered consumer could do a linear scan of the stream
...
to determine number of messages pending. This improves that with a startup cache.
Signed-off-by: Derek Collison <derek@nats.io >
2021-04-07 09:15:01 -07:00
Derek Collison
5a48369b4b
Make sure to not delete streams on bad updates.
...
If an update was asssigned but failed at the stream group server we would send back the result which would always delete the stream.
Signed-off-by: Derek Collison <derek@nats.io >
2021-03-29 07:35:30 -07:00
Derek Collison
c05ff97d09
Fixes based on PR feedback
...
Signed-off-by: Derek Collison <derek@nats.io >
2021-03-25 18:09:35 -07:00