-
Notifications
You must be signed in to change notification settings - Fork 67
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
Node: transaction commands for json module #2690
Node: transaction commands for json module #2690
Conversation
Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>
Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>
Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>
Signed-off-by: Andrew Carbonetto <andrew.carbonetto@improving.com>
Signed-off-by: Andrew Carbonetto <andrew.carbonetto@improving.com>
Signed-off-by: Andrew Carbonetto <andrew.carbonetto@improving.com>
Signed-off-by: Andrew Carbonetto <andrew.carbonetto@improving.com>
Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>
node/tests/TestUtilities.ts
Outdated
baseTransaction: ClusterTransaction, | ||
): Promise<[string, GlideReturnType][]> { | ||
const responseData: [string, GlideReturnType][] = []; | ||
const key1 = "key1" + uuidv4(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update the key to use the same prefix
node/src/server-modules/GlideJson.ts
Outdated
* is atomic only at the slot level. If one or more slot-specific requests fail, the entire | ||
* call will return the first encountered error, even though some requests may have succeeded | ||
* while others did not. If this behavior impacts your application logic, consider splitting | ||
* the request into sub-requests per slot to ensure atomicity. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@remarks When in cluster mode, all keys in the transaction must be mapped to the same slot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the remark on BaseClient mget as well. Should that also be updated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No
transaction goes to only 1 node always, but a command executed outside of transaction could be routed to multiple nodes.
Good finding - should be updated for mget in transaction for all clients
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. I have made a comment on 3 PRs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Yury-Fridlyand should it be added to MGET? (not JSON.MGET)
I think our logic was that the same comment applies to all commands (including between commands) and so it's defined on the wiki instead of in the javadoc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment could be applied to all multi-key commands.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean JSON.MGET
I remember we were not adding same slot notice in transaction, but I don't remember the reason...
… transaction tests Signed-off-by: Jonathan Louie <Jonathan.Louie@improving.com>
Signed-off-by: Jonathan Louie <Jonathan.Louie@improving.com>
Signed-off-by: Jonathan Louie <Jonathan.Louie@improving.com>
ecfe7a6
into
feature/module-transaction
* Node: Add Transaction for JSON commands --------- Signed-off-by: Prateek Kumar <prateek.kumar@improving.com> Signed-off-by: Andrew Carbonetto <andrew.carbonetto@improving.com> Signed-off-by: Jonathan Louie <Jonathan.Louie@improving.com> Co-authored-by: Andrew Carbonetto <andrew.carbonetto@improving.com> Co-authored-by: Jonathan Louie <Jonathan.Louie@improving.com>
Issue link
This Pull Request is linked to issue (URL): #2683
Checklist
Before submitting the PR make sure the following are checked:
Test results on 61a85d0: