Commit Graph

735 Commits

Author SHA1 Message Date
Ivan Kozlovic
14aecb2202 Fixed headers support for inbound leafnode connection
The server that solicits a LeafNode connection does not send an
INFO, so the accepting side had no way to know if the remote
supports headers or not. The solicit side will now send the headers
support capability in the CONNECT protocol so that the receiving
side can mark the inbound connection with headers support based
on that and its own support for headers.

Resolves #1781

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-12-21 11:53:24 -07:00
Alberto Ricart
f09992a889 updated iteration of signing keys (previously a list, now a map). (#1779) 2020-12-17 13:59:18 -07:00
Derek Collison
eb403ed4d0 Merge pull request #1773 from nats-io/cycle_wc_bug
Catch condition where a serviceImport response matched the original import.
2020-12-14 08:20:55 -08:00
Derek Collison
ced28eca93 Fix flapper
Signed-off-by: Derek Collison <derek@nats.io>
2020-12-13 10:29:34 -08:00
Derek Collison
a3f7e97f9a Catch condition where a serviceImport response matched the original import subject.
Signed-off-by: Derek Collison <derek@nats.io>
2020-12-13 10:17:29 -08:00
Ivan Kozlovic
d5f255b98e Merge pull request #1771 from nats-io/gw_ln_tls_config_reload
[FIXED] Config reload for gateways/leaf remote TLS configurations
2020-12-12 10:51:52 -07:00
Ivan Kozlovic
9f345ac420 Reduce risk of failure for TestJetStreamConsumerMaxDeliveryAndServerRestart
Just increased the AckWait from 20ms to 100ms and reduced max
deliveries from 4 to 3.

I believe that there is still the risk that the message is redelivered
while the server is being shutdown and that message is not making it
to the sub.

But using those new values (100ms/3), I have ran 200 rounds on a Linux
VM and did not get the failure (but did before the change).

Again, this is not proper test fix, but may help. This test has been
failing 11 times already (keeping track in spreadsheet) and causes
several minutes of tests to have to be recycled.
Note that the test ran in about 0.4s and now 0.7s, so not that much
and would be worth the added delay if it helps not breaking the whole
test suite!

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-12-11 19:49:58 -07:00
Ivan Kozlovic
399ff89817 Fixed debug num subs tests
Subject interest propagation delays could cause some of the system
service tests to fail.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-12-11 19:27:23 -07:00
Ivan Kozlovic
ce5f9d6683 Fixed some flappers
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-12-11 17:30:33 -07:00
Ivan Kozlovic
fc1521636c [FIXED] Config reload for gateways/leaf remote TLS configurations
Presence of TLS config in any remote gateway or leafnode would
cause the config reload to fail (because TLS config internal
content may change which fails the DeepEqual check).

This PR excludes the TLS configs in such case to check for
changes in gateways and leafnodes.

Although GW and LN config reload is technically supported, this
PR updates the internal remotes' TLS configuration so that
changes/updates to TLS certificates would take effect after
a configuration reload.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-12-11 16:56:25 -07:00
Derek Collison
a97e84d8b9 Merge pull request #1760 from nats-io/jsbug
[FIXES] https://github.com/nats-io/jetstream/issues/396
2020-12-02 16:29:39 -08:00
Derek Collison
0f7d18d6e8 Fixes https://github.com/nats-io/jetstream/issues/396
Had a deadlock with new preconditions. We need to hold lock across Store() call but that call could call into storeUpdate() such that we may need to acquire the lock. We can enter this callback from the storage layer itself and the lock would not be held so added an atomic.

Signed-off-by: Derek Collison <derek@nats.io>
2020-12-02 16:18:00 -08:00
Derek Collison
cddf23c200 Limit search depth for account cycles for imports
Signed-off-by: Derek Collison <derek@nats.io>
2020-12-02 11:44:27 -08:00
Derek Collison
9b107c0f4b Merge pull request #1759 from nats-io/acc_cycles
Better implementation to detect various cycles from account imports/exports.
2020-12-02 10:02:24 -08:00
Waldemar Quevedo
a9a6bdc04f Merge pull request #1732 from nats-io/rdn-ordering
Match DNs regardless of order when using TLS auth
2020-12-02 09:25:36 -08:00
Derek Collison
705cc0f5ea Better impl for detecting cycles between accounts
Signed-off-by: Derek Collison <derek@nats.io>
2020-12-02 08:56:19 -08:00
Derek Collison
bfb726e8e9 Make sure to clear JS resources on reload
Signed-off-by: Derek Collison <derek@nats.io>
2020-11-30 17:18:33 -08:00
Derek Collison
4e6d600ecc Also make sure account works after reload
Signed-off-by: Derek Collison <derek@nats.io>
2020-11-30 16:18:36 -08:00
Derek Collison
7e27042e6e Fix for #1736
When a system account was configured and not the default when we did a reload we would lose the JetStream service exports.

Signed-off-by: Derek Collison <derek@nats.io>
2020-11-30 16:11:50 -08:00
Derek Collison
4532447908 Remove limitation on ackall for filtered consumers
Signed-off-by: Derek Collison <derek@nats.io>
2020-11-28 07:18:17 -08:00
R.I.Pienaar
5e5b2e4dfd ensure the stream originating a pub error is reported
Signed-off-by: R.I.Pienaar <rip@devco.net>
2020-11-27 12:24:41 +01:00
Derek Collison
954f5a9093 Flattened filters for stream names API
Signed-off-by: Derek Collison <derek@nats.io>
2020-11-25 07:46:56 -08:00
Derek Collison
44a1373f89 JetStream changes.
Made several changes based on feedback.

1. Made PubAckResponse only optionally include an ApiError and not force an API type.
2. Allow FilterSubject to be set on a consumer config and cleared if it matches the only stream subject.
3. Remove LookupStream by subject, and add in filters for stream names API.

Signed-off-by: Derek Collison <derek@nats.io>
2020-11-25 06:50:25 -08:00
Matthias Hanel
f8872c8307 Added more straight forward loop detection fail
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-11-23 23:44:30 -05:00
Matthias Hanel
66fff6259a Adding test that fails where there is no cycle but sometimes passes
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-11-23 17:11:51 -05:00
Matthias Hanel
f467f32f4a We prevent cycles between services but not streams
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-11-23 16:19:41 -05:00
Matthias Hanel
352f6b3b45 Imported services can be renamed, this eludes cycle detection
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-11-23 15:49:49 -05:00
Waldemar Quevedo
a766b52c47 Allow matching DNs regardless of order
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2020-11-23 12:16:49 -08:00
Derek Collison
c0bc788c6d Merge pull request #1735 from nats-io/ehdrs
Stream publish changes
2020-11-23 09:44:37 -08:00
Derek Collison
18108be374 Merge pull request #1731 from nats-io/cycle
[FIXED] Detect service import cycles.
2020-11-23 09:43:51 -08:00
Derek Collison
0279e00b00 Fix for flapper
Signed-off-by: Derek Collison <derek@nats.io>
2020-11-23 07:34:24 -08:00
Derek Collison
afa5cae58c Formalized PubAckResponse
Signed-off-by: Derek Collison <derek@nats.io>
2020-11-22 16:31:37 -08:00
Derek Collison
a50f96461b Allow to check for last sequence and last msgid for conditional publish
Signed-off-by: Derek Collison <derek@nats.io>
2020-11-22 15:12:00 -08:00
Derek Collison
b528b1f74e Allow complete $JS.API to be imported from another account.
Signed-off-by: Derek Collison <derek@nats.io>
2020-11-21 16:54:58 -08:00
Derek Collison
2e3c226729 Fix for service import cycles
Signed-off-by: Derek Collison <derek@nats.io>
2020-11-21 13:13:08 -08:00
Waldemar Quevedo
886ecf7f89 Add support for subjects with multi value RDN
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2020-11-20 22:13:52 -08:00
Waldemar Quevedo
4029650740 Add test for multiple CNs
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2020-11-20 22:08:03 -08:00
Ivan Kozlovic
a0c4c5cb78 Add test with service import cycle
Not sure if this should be detected as misconfiguration or if
code need to be fixed to work properly.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-11-20 15:38:55 -07:00
Ivan Kozlovic
4d51a41dfd Merge pull request #1727 from nats-io/tls-verify-and-impliict-allow
[ADDED] verify_cert_and_check_known_urls to tie subject alt name to url in cfg
2020-11-20 15:10:01 -07:00
Matthias Hanel
8fd1b66f66 Renaming to verify_cert_and_check_known_urls
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-11-20 16:56:44 -05:00
Matthias Hanel
eda80ff7b5 changing the option name verify_and_implicit_allow to verify_and_accept_known_urls
This follows the suggestion by phil. I added the and to be similar to verify_and_map.
I fixed a minor issue where the implicit verify could be overwriting an
explicitly configured one.

Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-11-20 14:27:24 -05:00
Matthias Hanel
06e4e93185 Speeding up unit test fail case
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-11-20 13:57:34 -05:00
Matthias Hanel
f24aec4af7 Incorporating comments and fixed an issue where code was not invoked
had to change failing tests to use insecure as to not fail due to the
outgoing connection being not trusted.

Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-11-20 13:57:34 -05:00
Matthias Hanel
74642e024e [Added] verify_and_implicit_allow to tie subject alt name to url in cfg
Only works for gateways and routes. When true the subject alt DNS name
must match one url in the corresponding configuration

Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-11-20 13:57:34 -05:00
Derek Collison
a1c1ead39d Enable JetStream streams and consumer access to be exported to another account
Signed-off-by: Derek Collison <derek@nats.io>
2020-11-20 10:17:16 -08:00
Derek Collison
28d8a4be9c Merge pull request #1721 from nats-io/fsfix2
Fix for not properly recovering first sequence number on recovery.
2020-11-17 15:22:02 -08:00
Derek Collison
d358aaddf6 Fixes for filestore not remember first sequence when all messages deleted.
Thsi fixed a few minor bugs as well as the one where we did not remember our sequence numbers.

Signed-off-by: Derek Collison <derek@nats.io>
2020-11-17 15:04:57 -08:00
Ivan Kozlovic
5e9bad5b26 Test showing issue with filestore after a restart
I have pin-pointed that the issue started at this commit:
d737ccef55

This was PR: https://github.com/nats-io/nats-server/pull/1685

Prior to this PR, the test would pass.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-11-17 09:01:36 -07:00
R.I.Pienaar
ca8cbcdc63 support subjects starting with {
still doesnt support a subject {}

Signed-off-by: R.I.Pienaar <rip@devco.net>
2020-11-17 16:33:22 +01:00
R.I.Pienaar
a4116cc0fa support json requests for stream lookup 2020-11-17 15:33:44 +01:00