Commit Graph

4758 Commits

Author SHA1 Message Date
Ivan Kozlovic
76006273d5 Release v2.3.3
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-08-02 11:36:43 -06:00
Ivan Kozlovic
d8ee5378a7 Merge pull request #2395 from nats-io/update_jwt_deps
Update go.mod JWT reference to latest release
2021-08-02 10:41:23 -06:00
Ivan Kozlovic
50c0b40907 Update go.mod JWT reference to latest release
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-08-02 09:39:35 -06:00
Ivan Kozlovic
7ec4ce986a Merge pull request #2376 from nats-io/ocsp_leaf_missing
[FIXED] OCSP: parse cert.Leaf if not set
2021-08-02 09:20:09 -06:00
Derek Collison
e34f365fa1 Merge pull request #2394 from nats-io/consumer-delivery-after-purge
Fix for #2392. We were not resetting the pending timer properly during a stream purge.
2021-08-01 17:56:47 -07:00
Derek Collison
067ef19ce9 Fix for #2392. We were not resetting the pending timer properly during stream purge.
No we just let it fire as normal and it will be canceled or not as needed.

Signed-off-by: Derek Collison <derek@nats.io>
2021-08-01 17:28:59 -07:00
Derek Collison
3c6618d409 Merge pull request #2393 from nats-io/ln-nojs-hub
[FIX] #2388
2021-08-01 16:34:52 -07:00
Derek Collison
925a6fe6b2 Fix for #2388. Leafnodes with no JS can seamlessly access a HUB with JS.
This is the reverse of the early work to have LNs extend a non-JS cluster.
Also have mixed mode tests as well.

Signed-off-by: Derek Collison <derek@nats.io>
2021-08-01 14:57:47 -07:00
Derek Collison
19bfef59ed Merge pull request #2390 from nats-io/deliver-last-per-bug
Off by one bug (surprise) that would skip first new message on deliver last per subject.
2021-07-30 15:37:23 -07:00
Derek Collison
170b0570d4 Off by one bug (surprise) that would skip first new message on deliver last per subject.
Signed-off-by: Derek Collison <derek@nats.io>
2021-07-30 15:19:01 -07:00
Derek Collison
22af59f758 Merge pull request #2387 from nats-io/expire-on-start-fixes
[IMPROVED] Server restart time with many expired JetStream messages.
2021-07-30 12:49:50 -07:00
Derek Collison
4e92b0ed6e When a server was restarting, if a stream had a MaxAge and there were a very large amount of messages to expire, this would take too long.
During normal operation and quick restarts the number of expired messages per cycle is manageable and correct.
However if a server is shutdown for quite a long time and many messages have expired this process is too slow.

This commit introduces an optimized expiration tailored for startup vs running state.

Signed-off-by: Derek Collison <derek@nats.io>
2021-07-30 12:48:47 -07:00
Derek Collison
e6049d473d Merge pull request #2381 from nats-io/deliver-last-per-subject
Allow delivery policy of DeliverLastPerSubject, which is helpful for K/V on JetStream
2021-07-29 05:54:26 -07:00
Derek Collison
fb4cfb8c71 Merge branch 'main' into deliver-last-per-subject 2021-07-29 05:52:28 -07:00
Derek Collison
959a0da1f0 Merge branch 'main' into deliver-last-per-subject
Signed-off-by: Derek Collison <derek@nats.io>
2021-07-29 05:42:45 -07:00
Ivan Kozlovic
bb126f4527 Merge pull request #2383 from yzhao1012/include_symbols_in_build
Remove '-s' flag from ldflags from the build
2021-07-28 21:34:19 -06:00
Derek Collison
534df9a140 Merge pull request #2382 from nats-io/interest-policy-bug
[FIXED] A stream with interest retention had a clustered consumer could cause server panic.
2021-07-28 16:30:35 -07:00
Yaxiong Zhao
b0cecaf666 Remove '-s' flag from ldflags from the build
This retains the symbols (but still removes the dwarf info).
This increases the executable size by ~8% (test on my laptop):

$ go build -ldflags '-w' -o nats-server
-rwxrwxr-x 1 yzhao yzhao 11911273 Jul 28 15:52 nats-server

$ go build -ldflags '-s -w' -o nats-server
-rwxrwxr-x 1 yzhao yzhao 11128832 Jul 28 15:52 nats-server

Symbols are very useful during debugging. It would be great that if the
NATS team consider including symbols.
2021-07-28 15:56:58 -07:00
Derek Collison
6bd565c58a We had a situation where when a stream with interest retention had a clustered consumer it could cause the server to panic when the consumer was being deleted.
Signed-off-by: Derek Collison <derek@nats.io>
2021-07-28 15:10:21 -07:00
Derek Collison
9b0158daf9 Allow delivery policy of DeliverLastPerSubject, which is helpful for scoped watchers for K/V.
Signed-off-by: Derek Collison <derek@nats.io>
2021-07-28 12:49:02 -07:00
Ivan Kozlovic
aaaf28a436 Updates based on code review
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-07-28 12:40:48 -06:00
Derek Collison
c3ba9f03f5 Merge pull request #2377 from nats-io/desc
Add descriptions to JetStream streams and consumers.
2021-07-28 06:43:58 -07:00
Matthias Hanel
d319dd029f Merge pull request #2379 from nats-io/filestore-test
[fixed] crash in unit test caused by *ConsumerStore.State()
2021-07-27 20:53:25 -04:00
Matthias Hanel
d89aa258d1 [fixed] crash in unit test caused by *ConsumerStore.State() return nil, nil
Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-07-27 19:15:09 -04:00
Matthias Hanel
a40ea298e5 [fixed] jetstream unique server name requirement across domains (#2378)
* [fixed] jetstream unique server name requirement across domains

including domain in server info
adding check for cluster name in duplicate leaf node connection check

This does not address non unique domains in the same domain, say within
super cluster.

Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-07-27 18:42:19 -04:00
Matthias Hanel
7c07b4e46d Merge pull request #2375 from nats-io/update-jwt
[fixed] updated jwt library to avoid an error when counting tokens
2021-07-27 18:41:47 -04:00
Derek Collison
98970ac03d Add descriptions to JetStream streams and consumers. 2021-07-27 14:05:25 -07:00
Ivan Kozlovic
67b9bba32d [FIXED] OCSP: parse cert.Leaf if not set
When trying to update NATS Streaming server dependencies with
latest NATS Server, I noticed that a TLS test was failing and
this was because the TLS configuration was manually set like this:

```
o := DefaultTestOptions
o.HTTPHost = "127.0.0.1"
o.HTTPSPort = -1
o.TLSConfig = &tls.Config{ServerName: "localhost"}
cert, err := tls.LoadX509KeyPair("configs/certs/server-cert.pem", "configs/certs/server-key.pem")
if err != nil {
    t.Fatalf("Got error reading certificates: %s", err)
}
o.TLSConfig.Certificates = []tls.Certificate{cert}
```
Notice how the `cert.Leaf` is not parsed. This cause the NATS Server
OCSP code to fail when hasOCSPStatusRequest() is invoked with
a `nil` pointer.

My first approach was to add a `nil` check in hasOCSPStatusRequest()
and return `false` in that case.
But then I thought that maybe the correct approach is to parse the
leaf it it is not done in the provided TLS config?

It could be simply a case of fixing the test that I have in
NATS Streaming server repo, but a quick check in this repo's own
dependencies show that not setting the Leaf is something that may
happen in some cases. For instance here is how the Postgres library
build the certs: caa87158f5/ssl.go (L133)

As you can see, the leaf is not parsed here, so I am not sure if
having Leaf nil is valid or not.

The go doc regarding Leaf says:
```
// Leaf is the parsed form of the leaf certificate, which may be initialized
// using x509.ParseCertificate to reduce per-handshake processing. If nil,
// the leaf certificate will be parsed as needed.
Leaf *x509.Certificate
```
This is the last statement that made me chose the current approach of
parsing it if detected as `nil` instead of just ignoring a nil cert.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-07-27 13:57:22 -06:00
Matthias Hanel
c7f7077584 [fixed] updated jwt library to avoid an error when counting tokens
Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-07-27 12:46:44 -04:00
R.I.Pienaar
6cd3ad6e73 Merge pull request #2374 from ripienaar/errt_fix
fix error replacements in consumer validation
2021-07-27 18:45:01 +02:00
R.I.Pienaar
24584a0b4a fix error replacements in consumer validation
Signed-off-by: R.I.Pienaar <rip@devco.net>
2021-07-27 18:17:07 +02:00
Derek Collison
ba4a271cf6 Merge pull request #2373 from nats-io/si_acc_swap
Remove the swapping of accounts during processing of service imports.
2021-07-26 15:17:17 -07:00
Derek Collison
f13fa767c2 Remove the swapping of accounts during processing of service imports.
When processing service imports we would swap out the accounts during processing.
With the addition of internal subscriptions and internal clients publishing in JetStream we had an issue with the wrong account being used.
This was specific to delyaed pull subscribers trying to unsubscribe due to max of 1 while other JetStream API calls were running concurrently.
2021-07-26 07:57:10 -07:00
Derek Collison
f4117e9d5b Merge pull request #2370 from AdamKorcz/fuzz123
Change naming in server fuzzer
2021-07-23 13:13:43 -07:00
AdamKorcz
278d42900a Change naming in server fuzzer 2021-07-23 10:19:07 +01:00
Matthias Hanel
07375182e7 Merge pull request #2369 from nats-io/import-export-2361
[fixed] subscription on wildcard import that is not a subset
2021-07-22 21:01:38 -04:00
Matthias Hanel
ccef1bf327 Remove unnecessary lines
Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-07-22 18:53:06 -04:00
Matthias Hanel
0a33f040e9 fix performance by changing signature of tokenizeSubjectIntoSlice
Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-07-22 16:46:57 -04:00
Matthias Hanel
06ac80cdbe Review comments
Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-07-22 11:27:34 -04:00
Matthias Hanel
ddd665b036 [fixed] subscription on wildcard import that is not a subset
fixes #2361
The subject used was not a subset of the import. Nor the other way
around. Instead it is an overlap that needs to be dynamically computed.

Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-07-22 09:52:12 -04:00
Matthias Hanel
e8fea67b1a Merge pull request #2365 from nats-io/fetch-timeout
[changed] default account fetch timeout to be smaller as client timeout
2021-07-19 12:55:41 -04:00
Matthias Hanel
84e7fab33b [changed] default account fetch timeout to be smaller as client timeout
Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-07-19 12:22:07 -04:00
Matthias Hanel
d894496aae Merge pull request #2364 from nats-io/tls-timeout-sec
[fixed] tls timeout now accepts units
2021-07-19 11:49:26 -04:00
Matthias Hanel
1d4243b565 [fixed] tls timeout now accepts units
Signed-off-by: Matthias Hanel <mh@synadia.com>
2021-07-19 11:42:28 -04:00
Ivan Kozlovic
aa2873b682 Merge pull request #2362 from nats-io/remove_debug_printstack
Removed debug.PrintStack() from apiDispatch [ci skip]
2021-07-13 17:06:01 -06:00
Ivan Kozlovic
a7e0eeaf50 Removed debug.PrintStack() from apiDispatch [ci skip]
It was introduced by mistake in PR #2324 which I had reported
but failed to be actually removed before PR was merged:
https://github.com/nats-io/nats-server/pull/2324#pullrequestreview-695163635

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2021-07-13 16:49:44 -06:00
R.I.Pienaar
d8cc38d2cf Merge pull request #2359 from ripienaar/adr_migrate
remove ADR files from the server
2021-07-13 16:21:00 +02:00
R.I.Pienaar
0601a36b7b remove ADR files from the server
Signed-off-by: R.I.Pienaar <rip@devco.net>
2021-07-13 10:07:31 +02:00
Derek Collison
16b4206a39 Bump to 2.3.3 beta
Signed-off-by: Derek Collison <derek@nats.io>
2021-07-11 10:47:02 -07:00
Derek Collison
18fca15dd9 Merge pull request #2357 from nats-io/num-pending-bug
[FIXED] Consumer NumPending bug
2021-07-11 10:09:46 -07:00