Commit Graph

89 Commits

Author SHA1 Message Date
Derek Collison
bb7a8a5f79 Introduced default max ack pending for ack explicit.
Fixed a bug that would introduce performance degradation for durable consumers R>1.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-30 11:47:24 -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
Matthias Hanel
03aee09847 [Added] error when mirror/source stream prefix overlaps with stream subs (#2041)
* [Added] error when mirror/source stream prefix overlaps with stream subs

Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-03-27 14:01:51 -04:00
Derek Collison
0f71c260fb Durable consumers with R>1 had performance challenges.
This code changes the way we handle raft based proposals for consumers.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-26 12:53:49 -07:00
Derek Collison
5d5de5925f Introduce a previous leader state in the raft layer to allow quicker responses when leaderless.
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-25 17:08:29 -07:00
Derek Collison
e53caee5e8 Enforce server limits even when dynamic limits for accounts in play.
We were not properly enforcing server limits. This commit will allow a server to enforce limits but still remain functional even at the JetStream level.
Also fixed a bug for RAFT replay that could cause instability.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-25 16:06:27 -07:00
Derek Collison
a75e8f8c80 Fix for an issue with multiple restarts that showed stalled and sometimes lost streams.
The issue was when a state was removed from a server and restarted it would catch up properly.
However upon cluster restart the system could exhibit strange behaviors. This was due to on
catchup not properly creating a meta snapshot when one was received, leaving no meta state to recover.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-22 20:06:38 -07:00
Derek Collison
022c5b4ab2 Fix for bad behavior with flow control and multiple sources streams.
Allow chaining of sources and mirrors with filtered consumers.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-22 11:13:51 -07:00
Derek Collison
7284756a8e Update to use Go client
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-21 09:31:17 -07:00
Derek Collison
0f548edcc6 Reduce sliding window for direct consumers and catchup stream windows.
Remove another possible wire blocking operation in raft.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-21 09:24:27 -07:00
Derek Collison
fcd4d0b75f Removed un-needed check in test
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-20 17:11:58 -07:00
Derek Collison
ced35e5b8c Reworked sources and mirrors on missed data.
Add last delivered sequence to consumer idle heartbeats.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-20 14:03:46 -07:00
Derek Collison
faa6dc85eb Fix for flapping test
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-20 11:16:40 -07:00
Derek Collison
14a896fee8 Wait longer
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-20 10:53:12 -07:00
Derek Collison
4c6fd179d6 Can not use sub comparisons for old messages from direct consumers.
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-20 10:30:09 -07:00
Derek Collison
cfe2f448ad Fix for when gateways were dropped and we did not detect interest returning.
Fix for leaked subscription when retrying the source consumers.
Better suppression of old messages from old direct consumers.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-20 08:44:18 -07:00
Derek Collison
d32f3ce479 Directs may not show up here anymore
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-18 11:29:33 -07:00
Derek Collison
b00b723168 Mirrors were not properly retrying after failures to create their internal consumer.
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-18 06:13:26 -07:00
Derek Collison
74cc2b581a When a stream is a mirror or has sources we need to check the upstream streams for filter subject correctness.
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-17 06:39:21 -07:00
Derek Collison
4d15658ec2 Merge pull request #1996 from nats-io/updates
JSC Updates
2021-03-14 17:17:08 -07:00
Derek Collison
d4e4c37e94 Test fixes
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-14 06:18:50 -07:00
Derek Collison
6c7d4af2d3 Increase wait time
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-13 18:00:34 -05:00
Derek Collison
76d3a76e14 Skip test since no auto remap atm
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-13 16:53:45 -05:00
Derek Collison
a3a35c0ddb Updated raft processing and dealing with remove peer.
Made sure to not remove us if we were remapped after the peer removal.
Fixed some raft behaviors.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-13 16:28:24 -05:00
Ivan Kozlovic
9e858ff81f Ephemeral cleanup across GWs
Watch for interest loss across GWs so ephemeral consumers are removed
when there is no longer local and GW interest.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-03-13 14:11:34 -07:00
Matthias Hanel
efdb80cc48 More unit test fixes
Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-03-12 01:51:28 -05:00
Matthias Hanel
6a0debbb71 more timeout changes
Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-03-12 00:52:58 -05:00
Matthias Hanel
b316cccfd1 Fixed a quorum formation issue that caused truncation
When a new leader is elected it has to give everyone a chance to reply,
so that we can observe rejections with higher term.

The maximum election timeout is 7.5 seconds.
The new behavior of waiting for the election timeout caused unit tests
to fail. Hence upping the timeout there as well.

Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-03-11 19:44:47 -05:00
Ivan Kozlovic
4af86becc7 Merge pull request #1993 from nats-io/remove-peer
Lost quorum changes for streams
2021-03-11 08:20:03 -07:00
Derek Collison
299f44cddf This changes our behaviors for streams and peer removals in several ways.
First we no longer try to auto-remap stream assignments on peer removals from the system.
We also now can always respond to stream info requests if at least a member is running.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-11 06:52:28 -05:00
Matthias Hanel
cab415cf61 Increasing test timeout
Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-03-10 11:52:21 -05:00
Matthias Hanel
32c686d77d Merge pull request #1986 from nats-io/js-test-timeout-3
Increasing test timeout
2021-03-09 20:51:25 -05:00
Matthias Hanel
e554d54b87 Increasing test timeout
Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-03-09 19:44:15 -05:00
Matthias Hanel
137e450137 Increasing the timeout of waitOnClusterReady
Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-03-09 18:37:11 -05:00
Matthias Hanel
fdcebf5c3a Increasing unit test timeout for waitOnStreamCurrent from 10 to 30 sec
Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-03-08 19:17:36 -05:00
Waldemar Quevedo
278c0efc8a Fix check from next request msg
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2021-03-07 00:12:31 -08:00
Derek Collison
038a5cadc4 LQ is longer now
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-04 18:39:32 -08:00
Derek Collison
e523e8f8de Fix based on feedback
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-04 09:37:09 -08:00
Derek Collison
051a5c4095 Tweaks to flaky test
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-03 21:11:14 -08:00
Derek Collison
d7201a110b Better handling on out of disk.
Suppress some stream and consumer bad results since they delete the asset.
Allow rehup to re-enable JetStream.
Various bug fixes and improvements.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-03 20:12:10 -08:00
Ivan Kozlovic
e7e756034a Switch Gateway JS accounts to interest-only mode + some other fixes
- Fixed the close of a TLS connection which starting Go 1.16
set the deadline to 5 seconds.

- Fixed an issue with setHeader that was causing these error messages
```
=== RUN   TestServiceImportReplyMatchCycleMultiHops
nats: message could not decode headers on connection [4] for subscription on "foo"
--- PASS: TestServiceImportReplyMatchCycleMultiHops (0.04s)
```

- Fixed names of tests in norace_test.go since they must start with
TestNoRace in order to make sure that we execute them in Travis:
```
go test -v -run=TestNoRace --failfast -p=1 ./...
```

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-03-03 19:15:28 -07:00
Ivan Kozlovic
0f53bf6580 Fixed data race with nodeInfo
Took the approach of storing struct instead of pointer. Of course,
when changing the offline bool from false to true, it means that
we need to call Store again (with same key).

This is based on the assumption that those Load/Store are not too
frequent. Otherwise, we may need to use locking (and keep *nodeInfo)

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-03-03 13:28:45 -07:00
Derek Collison
66cbf75712 Merge branch 'master' into consumer 2021-03-03 10:29:39 -07:00
Derek Collison
5da343eed8 More time for consumer delivered state to propagate
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-03 07:43:03 -08:00
R.I.Pienaar
236498a142 restore meta peer remove by name rather than id
Signed-off-by: R.I.Pienaar <rip@devco.net>
2021-03-03 15:55:50 +01:00
Derek Collison
af6b5d856a Better errors, no need to wait on leader twice
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-03 06:45:27 -08:00
Derek Collison
c6b0ed6069 Flapping test
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-03 05:06:24 -08:00
Derek Collison
d084853aff Actually need to wait to accumulate, make sure we get at least 8.
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-02 18:33:22 -08:00
Derek Collison
04634d3358 One less api call
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-02 18:28:06 -08:00
Derek Collison
a3c526a0eb Merge pull request #1951 from nats-io/xmirrors
Enable cross account behaviors for mirrors and sources.
2021-03-02 08:30:48 -07:00