NATS - v2.9.0


Changelog

IMPORTANT NOTE: Leafnode connections will now be closed if the cluster name is detected to be the same on the "hub" and "spoke", and reconnect attempts will be delayed by 30 seconds. If you are unaware of this misconfiguration you may experience a split network for longer than expected during the upgrade process. See the CHANGED section below and more details in pull request #3232.

Go Version

  • 1.19.1: Both release executables and Docker images are built with this Go release.

Added

  • JetStream:
    • A new stream configuration field AllowDirect allows capable client libraries to have a new API that retrieves a message from any member of the group (leader or replicas). Note that this can lead to non-coherent reads after write since a replica may respond to the request although that replica does not yet have the latest write. The configuration field MirrorDirect allow the mirror to be part of the origin's group (#3158, #3221, #3238, #3247, #3252, #3325, #3329, #3358, #3380, #3392, #3441)
    • Support for InactiveThreshold for durable consumers. If the inactivity threshold is specified, a durable that is offline for more than this duration will be removed (#3190)
    • Ability for an operator to move streams, and support for tags reload (#3217, #3236, #3234, #3270, #3354, #3376, #3419)
    • Support for filter subject in a mirror configuration (#3227)
    • Support for consumer replica change. Thanks to @goku321 for the report (#3293)
    • Support for account purge operation by sending a request to $JS.API.ACCOUNT.PURGE.<account name>. Thanks to @goku321 and @sourabhaggrawal for the report (#3319, #3378)
    • Support for AES-GCM cipher encryption for FileStore (#3371)
    • Ability to override the default server limit for stream catchup. For instance jetstream: { max_outstanding_catchup: 32MB }. This limit is how many bytes in total may be inflight during streams catchup. This can help lower network bandwidth saturation (#3418)
    • Pagination for StreamInfo requests. Note that not all clients may have the ability to provide the offset at the time of the server release (#3454)
  • LeafNodes:
    • Support for a SignatureHandler in remote configurations. This is applicable to applications embedding the NATS Server. Thanks to @kung-foo for the suggestion (#3335)
  • Monitoring:
  • Account specific in/out messages/bytes and slow consumers statistics in $SYS.ACCOUNT.%s.SERVER.CONNS message response (#3187)
  • New endpoint /accstatz to get specific account statistics (such as number of connections, messages/bytes in/out, etc...) (#3250, #3382)
  • The /healthz endpoint is now also available via the system account under the $SYS.REQ.SERVER.PING.HEALTHZ subject (#3250)
  • New options for the /healthz endpoint: /healthz?js-enabled=true to return an error if JetStream is disabled, and /healthz?js-server-only=true to skip the check of JetStream accounts, streams and consumers. Thanks to @mfaizanse for the contribution (#3326)
  • The /connz?auth=1 endpoint now includes a tls_peer_certs array with subject, subject public key and raw certificate sha256. Thanks to @RedShift1 for the suggestion (#3387)
  • The /jsz?accounts=true endpoint will now show non 0 values for reserved_memory and reserved_storage when applicable (#3435)
  • MQTT:
  • A new configuration option consumer_inactive_threshold allow new QoS1 consumers to be removed if they are offline for more than the specified duration (based on #3190) (#3193)
  • Use of a library that automatically sets GOMAXPROCS to match Linux container CPU quota. Thanks to @1995parham for the contribution (#3218, #3224, #3237, #3406)
  • A new server configuration option DontListen that triggers the server to accept only "in memory" client connections. This is for embedded use-cases only and is paired with changes made in the client library nats.go. Thanks to @neilalexander for the contribution (#2360, #3225)
  • Support for JWT account option DisallowBearer (#3127)
  • Stubs for WebAssembly. This allows NATS Server to be built under the js/wasm target. Thanks to @neilalexander for the contribution (#2363)
  • Symlink for the deb/rpm packages. Since v2.7.4, the server is installed under /usr/bin instead of /usr/local/bin as it used to. We now have added symlink to /usr/local/sbin. Thanks to @ismail0352 for the report (#3242)
  • Templates to scoped signing key user permissions (#3367, #3373, #3390)
  • New subject mapping functions: SplitFromLeft, SplitFromRight, SliceFromLeft, SliceFromRight and Split (#3305)
  • Building of executable, deb and rpm packages for the s390x architecture (#3458)

Changed

  • Gateway:
    • Phasing out of the "optimistic" mode whereby a server could send messages to the remote cluster without knowing if there was an interest or not. The remote cluster would reply with a "no interest" protocol. As of v2.9.0, servers that creates a gateway connection to a server of that version (and above) will no longer send messages in optimistic mode since it is assumed that all accounts will be switched to interest-only mode (where the subscription interest map is sent over) (#3383)
  • JetStream:
    • Stream's RePublish configuration field is now a new RePublish object (and SubjectMapping has been removed) that allows for a new boolean field called HeadersOnly. This could be useful for large messages and having republish just be a signaling mechanism (#3157)
    • When a pull request exceeds the maximum bytes, the error returned will be a "409" now instead of a "408" (#3172)
    • Make pull consumers FIFO per message, not per request (#3241)
    • Accept Nats-Expected-Last-Sequence with a 0 value. The server used to ignore if the sequence was 0, but now it will treat it as a requirement that the stream be empty if the header is present with a value of 0. Thanks to @bruth for the suggestion (#3038)
    • A consumer "Maximum Deliveries" count can now be updated. Thanks to @abegaj for the contribution (#3265)
    • Encryption of meta and RAFT stores (#3308)
    • Now return an error if there is an overlap between a source/mirror filter subject and the existing origin stream's subjects (#3356)
    • Compression in RAFT and stream catchup traffic when nodes are v2.9.0+. This can reduce network bandwidth (#3419)
  • LeafNodes:
    • On establishment, the connection will now be closed when the same cluster name is detected on the "hub" and "spoke" side (#3232)
  • Default to essential client information. We did default to full sharing for an export from the system account, the main one being JetStream (#3220)
  • The queue group named _sys_ is now reserved and an application attempting to use it would get a permission violation (#3246)

Improved

  • JetStream:
    • Server under heavy load and low on resources like file descriptors (#3168)
    • Performance of wildcard filtered consumer with stream with many subjects (#3184)
    • Better distribution in placement of streams in a cluster when no "max bytes" is set (#3194)
    • When the user adds a stream that already exists with a different configuration, the error description returned to the application was "stream name already in use", it will now be "stream name already in use with a different configuration". Also, when the user tries to restore a stream, if the stream was already present, the operation would fail with "stream name already in use", it will now be "stream name already in use, cannot restore". Thanks to @AndrewDK for the suggestion (#3280)
    • Speed of storing new keys with a large number of pre-existing keys (#3320)
    • Replicas ordering and information regarding unknown replica in stream information API response (#3347)
    • Catchup logic (#3348)
    • Catchup aborted on requester failure and better flow control (#3349)
    • FileStore for large KeyValue streams (#3351, #3353, #3366, #3401, #3413, #3416)
    • Usage of the FileStore implementation for the RAFT logs (#3377, #3394)
    • General improvements to clustered streams during server restart and KV/Compare-And-Swap use cases (#3392)
    • Ability to secure the creation of consumer for libraries sending consumer creation requests to the new subject $JS.API.CONSUMER.CREATE.<stream>.<subject>.<filter> (#3409)
    • Better accounting for max-bytes for pull consumers (#3456)
    • Better error description when an asset placement fails (#3342, #3459)
  • Server banner for Trusted Operators now displays the Expires date as Never instead of the epoch time. Thanks @mschneider82 for the contribution (#3452)

Updated

  • Dependencies (#3153, #3263, #3286)
  • JetStream:
    • Allow consumer filter subjects to be updated (#3216)
    • AckAll and NoAck are now allowed on pull consumers (#3442)

Fixed

  • Configuration Reload:
    • Configuration reload would fail if a leafnodes block would contain an authorization{} block, even if no modification was done there. Thanks to @cleaton for the report (#3204)
    • Some data races that could also lead to a server panic when processing a subscription and trying to send it to routes (#3222)
  • Gateway:
    • Possible panic if monitor endpoint is inspected too soon on startup (#3374)
    • Possible routing issues with System messages and JetStream when internal subscriptions are created and internal requests are sent through gateways. The replies may sometimes be missed (#3427)
  • JetStream:
    • Suppress consumer and stream advisories on server restart and any direct stream get message (#3156, #3160, #3162)
    • Possibly fail to retrieve a newly stored message. This would happen when stores and load using "last for subject" were concurrent (#3159)
    • When using Republish feature, republish on the republish subject and place original subject in a Nate-Subject header - similar to stream direct get messages (#3169)
    • Data race with account exported services. Thanks to @Davincible for the report (#3189)
    • Path separators in consumer or stream names prevented restoring the stream. Thanks to @daudcanugerah for the report (#3205)
    • Pull consumer may be incorrectly removed after the InactiveThreshold interval (#3229)
    • When a pull consumer is stalled for MaxAckPending, expire all pull requests that had at least 1 delivered message (#3241)
    • Possible bad stream placement when increasing the stream replica's value (scale up) and using unique_tag configuration (#3248)
    • Stalled stream catchup in endless cycle on EOF error trying to retrieve a catchup message (#3249)
    • Servers may be reported as orphaned (considering the node offline) (#3258)
    • Updates to a stream mirror configuration were not rejected in standalone mode, as they are in cluster mode (#3269)
    • Possible panic when removing a mirror configuration from a stream, which was possible because of the issue above. Thanks to @chris13524 for the report (#3269)
    • A stream with RePublish configuration would republish any incoming message, regardless of the RePublish's source subject (#3271)
    • Raft issue that could cause a follower's log index to be ahead of the leader's by 1 (#3277)
    • Possible panic in cluster mode. Thanks to @vishaltripathi24 for the report (#3279)
    • Scale down of a stream was not always waiting for the scale down of its consumers (#3282)
    • Short index write could lead to loss of stream sequence for an empty stream (#3283)
    • Losing stream sequence on multiple restarts and leader changes (#3284)
    • In clustering mode, the "stream names" API could return more than the JS API limit, and "stream infos" list would return that the total of stream is the JS API limit of 256 channels, when in reality it could be more (#3287)
    • Scaling up and some RAFT issues (#3288)
    • Reject update of a pull consumer MaxWaiting configuration since it is not currently supported (#3302)
    • Catching up a RAFT follower that involved snapshots (#3307)
    • Instability with encrypted systems (#3314)
    • Reject stream update with changes to the RePublish configuration since it is not currently supported (#3328)
    • Internal consumer restart on source filter update (#3355)
    • The proper error regarding "subject overlap" was not returned in standalone mode (was correct in clustering mode). Thanks to @swDevTX for the report (#3363)
    • Messages that had reached the max delivery count may be redelivered after a server or cluster restart (#3365)
    • Issue if the source consumer changes the subjects filter (#3364)
    • Possible race during an asset scale down that could cause a node to prematurely being considered caught up (#3381)
    • Consumer subject validation on recovery which caused delivery of messages to a downstream stream that should not have been delivered (#3389)
    • Issues with concurrent use of Nats-Expected headers, such as concurrent uses of kv.Create()/kv.Delete() (#3400)
    • Stream information numbers may be 0 after a cluster restart (#3411)
    • Wrong streams returned in some conditions involving wildcard in subjects and filters (#3423)
    • Expired/removed accounts were counted toward limits. Thanks to @JulienVdG for the contribution (#3421, #3428)
    • Don't allow subjects overlap between multiple subjects for a stream (for instance configuration that had subjects "foo.*", "foo.bar" would create duplicate messages if produced on foo.bar and will now be reported as an invalid configuration (#3429)
    • Some nodes in a super cluster may never be reported as offline in some situations (#3433)
    • Restarted queue subscriptions may not receive messages. Thanks to @kyle8615 for the report (#3440)
    • Durables with replicas of 1 but different from the stream's replicas could possibly be incorrectly migrated on server shutdown (#3451)
  • MQTT:
    • Possible panic when clients repeatedly connect with a client ID while that is already connected. Thanks to @gebv for the report (#3315)
  • Delivery of internal system messages to queue subscribers across routes. Thanks to @rebelf for the report (#3185)
  • Memory leak when unsubscribing the last queue subscription on a given queue group (#3338)
  • Issue with services import/export cycles that could cause stack-overflow. Thanks to @apis for the report (#3407)
  • Strings that started with a number and had some of the "bytes" suffix (such as K/G/etc..) but not as suffixes were not parsed properly. Thanks to @julian-dolce-form3 for the report (#3434, #3436)

Complete Changes

https://github.com/nats-io/nats-server/compare/v2.8.4...v2.9.0


Details

date
Sept. 9, 2022, 2:53 p.m.
name
Release v2.9.0
type
Minor
👇
Register or login to:
  • 🔍View and search all NATS releases.
  • 🛠️Create and share lists to track your tools.
  • 🚨Setup notifications for major, security, feature or patch updates.
  • 🚀Much more coming soon!
Continue with GitHub
Continue with Google
or