Commit Graph

4748 Commits

Author SHA1 Message Date
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
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
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
Derek Collison
225df04662 Fix for a consumer's num pending being stuck at 1.
We were trying to protect the sgap uint64 from wrapping, but in some cases the consumers is eager and can get a message before we sgap++.
Instead of slowing things down and sycnhronizing ++ then --, we allow it to wrap temporarily and have and adjustedPending() func that will set to zero for reporting.

Signed-off-by: Derek Collison <derek@nats.io>
2021-07-10 12:37:08 -07:00
R.I.Pienaar
359a4d980b remove duplicate error
Signed-off-by: R.I.Pienaar <rip@devco.net>
2021-07-10 11:46:37 -07:00
R.I.Pienaar
73142054ed Merge pull request #2355 from ripienaar/duplicate_err
remove duplicate error
2021-07-08 21:52:14 +02:00
Ivan Kozlovic
670be37646 Merge pull request #2341 from gogrlx/main
[ADDED] ReloadOptions() for embedded cases
2021-07-08 10:24:03 -06:00
R.I.Pienaar
4ec7931726 remove duplicate error
Signed-off-by: R.I.Pienaar <rip@devco.net>
2021-07-08 18:14:03 +02:00
Derek Collison
f441c7bc8d Merge pull request #2354 from nats-io/maxcc
Fix for multiple concurrent ephemeral consumer requests with max consumers set.
2021-07-08 08:53:51 -07:00
Derek Collison
065049e090 Fix for flapper
Signed-off-by: Derek Collison <derek@nats.io>
2021-07-08 07:42:40 -07:00
Derek Collison
6337198119 Fix for multiple concurrent ephemeral consumer requests in clustered mode with max consumers set.
Signed-off-by: Derek Collison <derek@nats.io>
2021-07-08 07:02:09 -07:00
Derek Collison
2534434e24 Merge pull request #2353 from nats-io/drace
Fix for #2352
2021-07-08 06:20:09 -07:00
Derek Collison
894f26d149 Fix for #2352
Signed-off-by: Derek Collison <derek@nats.io>
2021-07-08 06:13:36 -07:00