Changelog
Important
This is a preview release for the upcoming 2.12 series. This is not a final build.
This release also contains all changes up to and including v2.11.8.
Go Version
- 1.25.0 (#7166)
Added
General
- Exponential backoff on route/gateway reconnection attempts (#7042, #7048)
- Added
allow_insecure_cipher_suites
configuration option totls
block, as insecure ciphers are now disabled by default (#7144) - No responders errors from the server now include the original subject in the
Nats-Subject
header (#5250)
JetStream
- Atomic batch publishes (#6966, #7057, #7060, #7085, #7090, #7091, #7119, #7152, #7175)
- Stage-and-commit style batches for JetStream message publishes with normal consistency checks
- ADR: https://github.com/nats-io/nats-architecture-and-design/blob/main/adr/ADR-50.md
- Counter streams (#6973, #6988, #7081, #7118)
- Counters are incremented or decremented by publishing to the stream with
Nats-Incr
headers, with full aggregate consistency over sources and mirrors - ADR: https://github.com/nats-io/nats-architecture-and-design/blob/main/adr/ADR-49.md
- Counters are incremented or decremented by publishing to the stream with
- Prioritised mode for consumer priority groups (#7113)
- Allows for low-latency switching between clients based on the priority set
- ADR: https://github.com/nats-io/nats-architecture-and-design/blob/main/adr/ADR-42.md
- Added
no_hdr
flag to message get and direct get API endpoints (#6994)- Messages returned with this flag set will not contain headers, allowing fast access to e.g. counter values
- ADR: https://github.com/nats-io/nats-architecture-and-design/blob/main/adr/ADR-52.md
- Support for trusted proxies (#7153)
- Allows enforcing that connections arrive via a NATS protocol-aware proxy
- ADR: https://github.com/nats-io/nats-architecture-and-design/blob/main/adr/ADR-55.md
- Added the ability to promote mirrors to normal streams by removing the mirror configuration (#7171)
- This allows a mirror to take over operation if the original stream is lost, for example in a disaster recovery scenario
- This operation cannot be undone and also requires configuring the stream subjects to continue operation
- Added delayed message scheduling (#7170)
- Implements single schedule messages using the
Nats-Schedule-TTL
message header - ADR: https://github.com/nats-io/nats-architecture-and-design/blob/main/adr/ADR-51.md
- Implements single schedule messages using the
- Added support for offline assets (#7158)
- Streams and consumers from a higher API version or using unsupported features (i.e. after a downgrade) will be marked as offline to prevent corruption
- ADR: https://github.com/nats-io/nats-architecture-and-design/blob/main/adr/ADR-44.md
- Added
partition(n)
for deterministic hash-based partitioning andrandom(n)
for non-deterministic random partitioning to subject transforms (#6950) - Added the ability to specify the required API level in JetStream API requests with the
Nats-Required-Api-Level
request header (#7157) - Add
server_metadata
block to server config, allowing arbitrary key-pairs to be set on a per-server basis, similar to stream/consumer metadata (#6935) - Asynchronous flush support for the filestore with the new
allow_async_flush
stream option (#7018) - Support for empty votes, which improves how the Raft election logic handles nodes that have lost their stable storage and attempt to rejoin the cluster regardless (#7038)
- Added
"leader_since"
to the stream and consumer info responses (#7189)
Leafnodes
- Added the ability to isolate leafnode subject interest propagation with the hub-side
isolate_leafnode_interest
configuration option, suppressing east-west traffic and reducing subscription overheads when there are many leafnodes (#7238) - Added
disabled
option for leafnode remotes, with support for reloading from the config at runtime (#7054)
Changed
JetStream
- The JetStream API level has been increased to
2
(#6969) - The API surface is now in strict mode by default, erroring if unknown fields are provided in the request body (#7049)
- Replicated streams will now default to async flush as long as
sync: always
is not configured (#7163) - The default value for
max_buffered_msgs
has been increased by 10x to 100,000 messages (#6633)
Improved
General
- When logging closed connections, the remote is now logged if known, making it easier to identify where route/gateway/leafnode connections have dropped (#7077)
- Client-specific log lines now include the account and user if known (#7079)
JetStream
- Raft nodes will no longer respond success to catchup messages and will ignore responses if not leader, fixing some potential stream desync scenarios (#6944)
- The stream leader is now responsible for remapping consumer assignments on scaling/moves, fixing some potential placement races (#7071, #7112, #7083)
- Replicated streams can now be created even if some of the replica nodes are offline (#7075)
- The storage type is now logged when logging resource limits exceeded (#7076)
- JetStream API requests are always handled from the worker pool, improving the semantics of the API request queue and logging when requests take too long (#7125)
- Filestore in-memory caches now use weak pointers and can respond to garbage collector (GC) pressure, which should help to avoid a number of possible out-of-memory scenarios (#7180)
Leafnodes
- Leafnode connections without auth no longer unexpectedly connect to the global account (#7116)
Fixed
JetStream
- Improved validation for stream/consumer configs (#7134)
- An error will now be correctly surfaced when the
Nats-Expected-Last-Subject-Sequence-Subject
header is supplied but the accompanyingNats-Expected-Last-Subject-Sequence
header is not (#7196)