Commit Graph

7821 Commits

Author SHA1 Message Date
Neil
b22cdf18fe Add support for re-encrypting streams with new key (#4296)
This adds a new `prev_key` field to the configuration file to allow
transitioning from one encryption key to another.

Signed-off-by: Neil Twigg <neil@nats.io>
2023-07-27 10:10:08 +01:00
Derek Collison
4c41c765f7 Merge branch 'main' into dev 2023-07-26 22:30:17 -07:00
Derek Collison
3a2835c3be Cherry-pick "Fix not validating single token filtered consumer" (#4338)
This cherry-picks #3776 into `main` for the next patch release.

Signed-off-by: Neil Twigg <neil@nats.io>
2023-07-26 22:26:58 -07:00
Derek Collison
9a8f846dbb Merge branch 'main' into dev 2023-07-26 22:22:34 -07:00
Derek Collison
865f12f396 Report correct consumer count in paged list response (#4339)
Previously the Total in paged responses would always equal the size of
the first response this would stall paged clients after the first page.

Now correctly sets the total so paging continues, improves the test to
verify these aspects of the report
2023-07-26 22:19:25 -07:00
R.I.Pienaar
60e67ff9a5 Report correct consumer count in paged list response
Previously the Total in paged responses would always equal the
size of the first response this would stall paged clients after
the first page.

Now correctly sets the total so paging continues, improves the
test to verify these aspects of the report

Signed-off-by: R.I.Pienaar <rip@devco.net>
2023-07-27 07:52:24 +03:00
Derek Collison
f4f5a84c31 Added: reload server config by sending it a message (#4307)
- [ ] Link to issue, e.g. `Resolves #NNN`
 - [ ] Documentation added (if applicable)
 - [x] Tests added
- [x] Branch rebased on top of current main (`git pull --rebase origin
main`)
- [x] Changes squashed to a single commit (described
[here](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html))
 - [x] Build is green in Travis CI
- [ ] You have certified that the contribution is your original work and
that you license the work to the project under the [Apache 2
license](https://github.com/nats-io/nats-server/blob/main/LICENSE)

Resolves #

### Changes proposed in this pull request:

- Reload server's configuration by sending a message to
`$SYS.REQ.SERVER.{server-id}.RELOAD`
2023-07-26 16:34:33 -07:00
Lev Brouk
a5aaf7811e PR feedback: improved error message, and cleaned up debugging from the test 2023-07-26 08:47:33 -07:00
Lev Brouk
21888d0c72 Merge branch 'dev' of github.com:nats-io/nats-server into lev-reload-by-message 2023-07-26 08:43:09 -07:00
Tomasz Pietrek
4b72e37f27 Fix not validating single token filtered consumer
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
Signed-off-by: Neil Twigg <neil@nats.io>
2023-07-26 16:21:00 +01:00
Neil Twigg
bc78e86388 Update TestJetStreamServerReencryption to also test converting ciphers at the same time as changing keys
Signed-off-by: Neil Twigg <neil@nats.io>
2023-07-26 14:04:28 +01:00
Neil Twigg
3df08c3f89 Add support for re-encrypting streams with new key
Signed-off-by: Neil Twigg <neil@nats.io>
2023-07-26 14:04:28 +01:00
Neil
2cb1512543 Add first_seq to StreamConfig (#4322)
This allows specifying `first_seq` in the stream config when creating a
stream.

Signed-off-by: Neil Twigg <neil@nats.io>
2023-07-26 11:32:33 +01:00
Neil Twigg
65cb4b9559 Fix race condition in TestFileStoreAgeLimitRecovery
Signed-off-by: Neil Twigg <neil@nats.io>
2023-07-26 09:59:00 +01:00
Derek Collison
ff33dd2776 Bump to 2.10.0-beta.46
Signed-off-by: Derek Collison <derek@nats.io>
2023-07-25 11:49:17 -07:00
Neil Twigg
4d8d01949b Add first_seq support to memory store too
Signed-off-by: Neil Twigg <neil@nats.io>
2023-07-25 16:08:13 +01:00
Waldemar Quevedo
45beab1f17 Fix typo from internal function (#4337)
minor internal typo fix
2023-07-25 06:56:23 -07:00
Neil Twigg
9538a1895b Add first_seq to StreamConfig for file store
Signed-off-by: Neil Twigg <neil@nats.io>
2023-07-25 11:27:07 +01:00
Lev Brouk
94788b4906 PR feedback: test nits 2023-07-24 07:01:01 -07:00
Derek Collison
8ee2e2f5e3 Cleanup for some staticcheck warnings (#4332)
Signed-off-by: Derek Collison <derek@nats.io>
2023-07-23 15:32:17 -07:00
Derek Collison
0421c65c88 Bump to 2.9.21-RC.1
Signed-off-by: Derek Collison <derek@nats.io>
2023-07-23 14:58:52 -07:00
Derek Collison
5013e01d6b Merge branch 'main' into dev 2023-07-23 14:56:25 -07:00
Derek Collison
4ee3408dfd [IMPROVED] Update dependencies (#4333)
Signed-off-by: Derek Collison <derek@nats.io>
2023-07-23 14:55:07 -07:00
Derek Collison
2e48b54d14 Update dependencies
Signed-off-by: Derek Collison <derek@nats.io>
2023-07-23 11:43:51 -07:00
Waldemar Quevedo
bbfeb2a887 Fix typo on internal function
Signed-off-by: Waldemar Quevedo <wally@nats.io>
2023-07-22 20:40:26 -07:00
Derek Collison
1e15061400 Cleanup for some staticcheck warnings
Signed-off-by: Derek Collison <derek@nats.io>
2023-07-21 19:17:54 -07:00
Derek Collison
ac24110ac4 Include logtime_utc option into v2.9 series (#4331)
Includes option to log in UTC with commits from following PRs:

https://github.com/nats-io/nats-server/pull/3833
https://github.com/nats-io/nats-server/pull/3920
2023-07-21 18:37:05 -07:00
Byron Ruth
905f040d86 Change logtime_utc default to false
This ensures that the existing, default behavior of the server emitting the local timezone is not changed.
2023-07-21 16:57:12 -07:00
Neil Twigg
e88517c90e Add logtime_utc option
backport to main: https://github.com/nats-io/nats-server/pull/3833

Signed-off-by: Waldemar Quevedo <wally@nats.io>
2023-07-21 16:56:13 -07:00
Derek Collison
9d9d760af2 Merge branch 'main' into dev 2023-07-21 11:42:02 -07:00
Derek Collison
ba517e4bfb [FIXED] Leaking memory on usage of getHash() (#4329)
If we created lots of hashes, beyond server names, like for consumer or
stream NRG group names etc, these maps would grow and not release
memory. Performance hit is ~300ns per call, and we can use string intern
trick if need be at a future date since it is GC friendly.

Signed-off-by: Derek Collison <derek@nats.io>

Resolves #4289
2023-07-20 16:04:18 -07:00
Derek Collison
da60f2ab32 [IMPROVED] Don't error to server logs if message was deleted for consumer (#4328)
Signed-off-by: Derek Collison <derek@nats.io>
2023-07-20 15:20:11 -07:00
Derek Collison
b68aed90d3 If we created lots of hashes, beyond server names, like for consumer or stream NRG groups etc, the maps would grow and not release memory.
In the benchmark on my machine, this added ~300ns per call, but I think that is ok for now vs the memory usage.

Signed-off-by: Derek Collison <derek@nats.io>
2023-07-20 15:11:28 -07:00
Derek Collison
9280a552b8 Don't error to server logs if message deleted
Signed-off-by: Derek Collison <derek@nats.io>
2023-07-20 14:07:35 -07:00
Derek Collison
c6c5358513 Merge branch 'main' into dev
Signed-off-by: Derek Collison <derek@nats.io>
2023-07-20 13:21:35 -07:00
Derek Collison
6c9fb6a938 [FIXED] Server reload with highly active accounts with service imports could cause panic or dataloss (#4327)
When service imports were reloaded on active accounts with lots of
traffic the server could panic or lose data.

Signed-off-by: Derek Collison <derek@nats.io>
2023-07-20 13:19:17 -07:00
Derek Collison
7477ce8257 When service imports were reloaded on active accounts with lots of traffic the server could panic or lose data.
Signed-off-by: Derek Collison <derek@nats.io>
2023-07-20 12:20:50 -07:00
Derek Collison
8e49fcc6df Undo branch build restrictions, quote go version
Signed-off-by: Derek Collison <derek@nats.io>
2023-07-20 11:17:19 -07:00
Derek Collison
0347f272c8 Don't require TLS for in-process connection (#4323)
This should fix a bug where in-process connections expect TLS over the
`net.Pipe` if TLS is configured.

Signed-off-by: Neil Twigg <neil@nats.io>
2023-07-20 11:01:09 -07:00
Neil Twigg
b7d6b7e7a9 Add unit test to prove connection works
Signed-off-by: Neil Twigg <neil@nats.io>
2023-07-20 11:01:32 +01:00
Caleb Lloyd
7993547bee Adjust in-process server info tls_required to tls_available
Signed-off-by: Caleb Lloyd <caleb@synadia.com>
2023-07-20 10:44:03 +01:00
Neil Twigg
ed9fafc796 Don't require TLS for in-process connection
Signed-off-by: Neil Twigg <neil@nats.io>
2023-07-20 10:43:58 +01:00
Lev Brouk
46a38929d9 Fixed tests 2023-07-19 12:06:49 -07:00
Lev Brouk
4a19059002 PR feedback: use subject const in the test 2023-07-19 12:04:19 -07:00
Lev Brouk
2d42b81e7b PR feedback: use more idiomatic require_Error with text 2023-07-19 12:04:19 -07:00
Lev Brouk
0040708c92 PR feedback: (fixed) and added test for Reload failing 2023-07-19 12:04:19 -07:00
Lev Brouk
1ce772c1a0 Added: reload server config by sending it a message
gofmt

PR feedback: test that a regular account can not reload

PR feedback: set response.Data to nil on success
2023-07-19 12:04:19 -07:00
Derek Collison
e1a00a883c Fix bug that would race around check for last sequence per subject
Signed-off-by: Derek Collison <derek@nats.io>
2023-07-18 12:39:06 -07:00
Derek Collison
efbfe217f4 Moved to end for merge with other branches, minor changes
Signed-off-by: Derek Collison <derek@nats.io>
2023-07-18 12:39:06 -07:00
Byron Ruth
16a336ead3 Add test case for concurrent expected last subject sequence
Signed-off-by: Byron Ruth <byron@nats.io>
2023-07-18 12:39:06 -07:00