nats-io / nats-server

High-Performance server for NATS.io, the cloud and edge native messaging system.
https://nats.io
Apache License 2.0
16k stars 1.41k forks source link

Change Consumer Priority Group State info and fix pinned TTL #6081

Closed Jarema closed 2 weeks ago

Jarema commented 2 weeks ago

This PR introduces few changes & improvements to Pinned Consumers

Fix pinned TTL timer when its assigned from existing waiting request Until now, we were resetting Pinned TTL only if pin was set on incoming Pull Request, but not when we were pinning an existing waiting request. It also simplifies some logic.

Switch to slice of PriorityGroupState Previously, we were storing just the pinned IDs, but to be more future-proof, this commit will switch approach to store a struct. It also adds PinnedTS which can be useful for debugging pinned consumers.

cc @ripienaar @jnmoyne

Signed-off-by: Tomasz Pietrek tomasz@nats.io

derekcollison commented 2 weeks ago

Let me know if you want to hold on merge til @ripienaar and/or @jnmoyne have a chance to review as well.

jnmoyne commented 2 weeks ago

Reviewed and tested the changes and they LGTM