-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
De/Serialize sample_frequency
correctly for Push and Pull Consumers
#1300
Commits on Aug 7, 2024
-
async-nats: De/Ser using
sample_freq
instead ofsample_frequency
Also adds crate-private module for handling schema differences
Benjamin Sparks committedAug 7, 2024 Configuration menu - View commit details
-
Copy full SHA for ba6ec45 - Browse repository at this point
Copy the full SHA ba6ec45View commit details
Commits on Aug 19, 2024
-
Fix KV create race after delete/purge
This change fixes an issue when using a JetStream K/V store where a user is creating, deleting, and re-creating keys. If the last entry for a key is a `Operation::Delete` or `Operation::Purge`, the initial `self.update()` returns an error, causing the second part of the method to be exercised. Prior to this change, if the entry was deleted or purged a `kv.put()` call is used which ignores the revision of that last entry. A single writer to the K/V store would succeed (as no other writers would write first) so no problem. However, if 2 writers attempt to create a key, then a second writer *could* call the `kv.put()` before the first writer calls `kv.put()`. This means that *both* writers get an `Ok(revision)` and can assume that they won the creation of the key. When using a "distributed lock" pattern (that is many writers race to create a key and the first successful writer wins), this above scenario results in potentially more than one writer who believes they have uniquely acquired the distributed lock. This change replaces the `kv.put()` call to a `kv.update()` call and provides the `revision` from the deleted/purged entry to ensure that no other writer has beaten the caller to this update. This change closes the race period between concurrent writers to between the first update and the second update call with some optimistic write concurrency to detect another writer. It appears as though this strategy is in effect in the Go client code [kv.Create] implementation. [kv.Create]: https://github.com/nats-io/nats.go/blob/278f9f188bca4d7bdee283a0e98ab66b82530c60/jetstream/kv.go#L944-L963 Co-authored-by: John Keiser <jkeiser@systeminit.com> Signed-off-by: Fletcher Nichol <fletcher@systeminit.com> Signed-off-by: Fletcher Nichol <fnichol@nichol.ca>
Configuration menu - View commit details
-
Copy full SHA for 8493766 - Browse repository at this point
Copy the full SHA 8493766View commit details -
Check that consumers have their sample frequency set correctly
Benjamin Sparks committedAug 19, 2024 Configuration menu - View commit details
-
Copy full SHA for 0c09b27 - Browse repository at this point
Copy the full SHA 0c09b27View commit details -
nats: De/Ser using
sample_freq
instead ofsample_frequency
Also adds private module from handling schema differences
Benjamin Sparks committedAug 19, 2024 Configuration menu - View commit details
-
Copy full SHA for f2b24ca - Browse repository at this point
Copy the full SHA f2b24caView commit details -
Revert "nats: De/Ser using
sample_freq
instead ofsample_frequency
"This reverts commit f2b24ca.
Benjamin Sparks committedAug 19, 2024 Configuration menu - View commit details
-
Copy full SHA for f602c58 - Browse repository at this point
Copy the full SHA f602c58View commit details -
Revert "Fix KV create race after delete/purge"
This reverts commit 8493766.
Benjamin Sparks committedAug 19, 2024 Configuration menu - View commit details
-
Copy full SHA for bbc3c34 - Browse repository at this point
Copy the full SHA bbc3c34View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4db9f51 - Browse repository at this point
Copy the full SHA 4db9f51View commit details