Commit Graph

31 Commits

Author SHA1 Message Date
Waldemar Quevedo
a9e4aa4d42 JS Headers and case-sensitivity
Currently JS Headers such as `Nats-Expected-Last-Sequence` are case-sensitive
in the server to have a fast path rather and avoid `ReadMIMEHeader`.

In this change, we try to keep the fast path but add another check for cases
when the header may have been sent in a different case than expected.

Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2021-04-09 12:50:33 -07:00
Jaime Piña
d929ee1348 Check errors when removing test directories and files
Currently in tests, we have calls to os.Remove and os.RemoveAll where we
don't check the returned error. This hides useful error messages when
tests fail to run, such as "too many open files".

This change checks for more filesystem related errors and calls t.Fatal
if there is an error.
2021-04-07 11:09:47 -07:00
Jaime Piña
e44275b963 Consolidate temporary test files and directories
Currently, temporary test files and directories are written in lots of
different paths within the OS's temp dir. This makes it hard to know
which files are from nats-server and which are unrelated. This in turn
makes it hard to clean up nats-server test files.
2021-04-06 10:42:55 -07:00
Derek Collison
c3ec8d9fb3 Agressive cache expiration was hindering performance when publishing and receiving from a stream concurrently.
Signed-off-by: Derek Collison <derek@nats.io>
2021-04-01 16:32:43 -07:00
Derek Collison
c6bb9b0644 Fix test since we moved from 500 to 404
Signed-off-by: Derek Collison <derek@nats.io>
2021-04-01 07:09:10 -07:00
Jaime Piña
6941bb3ade Update Go client in tests 2021-03-30 13:17:34 -07:00
Derek Collison
6f8c0f9193 Fix broken test
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-22 20:31:28 -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
1dde8aed5d Do not send idle heartbeats if not active
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-20 09:22:06 -07:00
Derek Collison
61771e88f8 In operator mode with JetStream we want to load accounts that have stable storage.
Also if an account was registered but not JetStream enabled, update it vs error.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-20 06:53:13 -07:00
Derek Collison
259cb07284 When a stream was busy but not for a filtered consumer with idle heartbeats they would be suppressed.
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-18 07:46:29 -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
Waldemar Quevedo
3e61c2e5b1 Prevent pull batch size larger than max ack pending
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2021-03-08 08:55:47 -08:00
Derek Collison
0b3c686430 Fixes for data races and some locking.
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-05 17:19:51 -08:00
Derek Collison
ff98984358 Reworked internal consumers used for sources and mirrors.
Now use ephemerals and heartbeats and flowcontrol.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-05 14:32:57 -08:00
Derek Collison
75b0455e0b Enable opt-in flow control for push based consumers.
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-05 08:48:12 -08:00
Derek Collison
955594ce9d Use code 100 instead
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-05 05:57:50 -08:00
Derek Collison
7e2b2a1033 Allow an option to push based consumers to have idle heartbeats delivered.
This allows an endpoint to know the consumer is still alive.

Signed-off-by: Derek Collison <derek@nats.io>
2021-03-05 05:48:00 -08:00
Derek Collison
32ffb55a22 Provide feedback to users when trying to pull from a push based consumer.
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-03 09:17:27 -08:00
Derek Collison
d170647c04 More time to make sure mirror consumer has hooked up properly
Signed-off-by: Derek Collison <derek@nats.io>
2021-03-03 07:58:45 -08:00
Matthias Hanel
c50ee2a1c6 [Changed] all times exposed will be computed in UTC (#1943)
This also applies to times that end up in that json.
Where applicable moved time.Now() to where it is used.
Moved calls to .UTC() to where time is created it that time is converted
later anyway.

Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-03-02 21:37:42 -05:00
Derek Collison
8cfc56f8b0 Enable support for changing config on stream restore.
Signed-off-by: Derek Collison <derek@nats.io>
2021-02-28 10:01:01 -08:00
Derek Collison
57a6599777 Test updates
Signed-off-by: Derek Collison <derek@nats.io>
2021-02-28 05:19:45 -08:00
Matthias Hanel
c73d3b21eb changing NEXT expires field from time to duration in nanoseconds
Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-02-26 20:45:44 -05:00
Derek Collison
7c670e4eae Allow sources and mirrors to not be pre-defined.
Will keep trying to establish contact.

Fixed bug where double source headers for sourced messages were causing issues.

Signed-off-by: Derek Collison <derek@nats.io>
2021-02-26 07:32:29 -08:00
R.I.Pienaar
45a42864f6 always store the filter subject
This avoids a situation where a consumer asks for
ORDERS.new today on a stream of ORDERS.new but later
someone makes the same stream ORDERS.* and the new
consumer would then get messages for other purposes
as well

Signed-off-by: R.I.Pienaar <rip@devco.net>
2021-02-25 18:29:21 +01:00
Derek Collison
09e3d26fa3 Add in support for stream mirrors and sources.
Add in proper support for stream updates in clustered mode.
Don't send API updates without subjects, caused GW parser errors.
Stream internal loops use their own clients now.

Signed-off-by: Derek Collison <derek@nats.io>
2021-02-23 10:57:27 -08:00
Derek Collison
fcb9be5f6c Skip perf tests
Signed-off-by: Derek Collison <derek@nats.io>
2021-02-13 14:37:15 -08:00
Derek Collison
f0cfc187d2 Set pindex to wrong setting on snapshot restore with no WAL
Signed-off-by: Derek Collison <derek@nats.io>
2021-02-13 06:50:50 -08:00
Derek Collison
5ef4d138cb Interest based retention did not work correctly with wildcards or multiple subjects and filtered consumers.
This allows that to work properly, needed for MQTT.

Signed-off-by: Derek Collison <derek@nats.io>
2021-02-11 20:59:20 -08:00
Derek Collison
c16f6e193d Move JetStream direct APIs to private.
Signed-off-by: Derek Collison <derek@nats.io>
2021-02-07 15:19:22 -08:00