-
Notifications
You must be signed in to change notification settings - Fork 1k
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
EVAL multi modes + non atomic modes #818
Conversation
dranikpg
commented
Feb 18, 2023
•
edited
Loading
edited
- add multi modes to eval
- add non atomic modes
- allow undeclared kets with global & non atomic modes
Signed-off-by: Vladislav Oleshko <[email protected]>
Signed-off-by: Vladislav Oleshko <[email protected]>
Signed-off-by: Vladislav Oleshko <[email protected]>
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.
Do not have lots of comments here.
How do you suggest testing this?
Do you think borrowing lua scripts from various frameworks (laravel? something else) and then stress-testing them from multiple clients in parallel could be a good direction?
} else if (multi_mode == Transaction::NON_ATOMIC) { | ||
scheduled = true; | ||
cntx->transaction->StartMultiNonAtomic(); | ||
}; |
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.
can it be that we have "scheduled == false" ?
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 don't like this part either.
A non-atomic multi transaction is neither a "classic" multi transaction neither a regular transaction because its re-initialized with the multi mechanism.
I had to decide whether to make it transparently multi and behave like one or make it explicitly non multi. I went with the first approach. It behaves exactly like a multi for the outside users.
Internally, there is IsMulti
and IsRunningMulti
where this distinguishment happens. What do you think?
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.
Maybe it should be renamed to smth like IsAtomicMulti
?
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 was not aware of this distinction and I thought there is only IsRunningMulti
.
so yes, IsAtomicMulti
is better.
I'm not sure we need extensive tests. What are we testing for specifically? We can always test with MULTI/EXEC transactions instead |
Signed-off-by: Vladislav Oleshko <[email protected]>
af21149
to
ab8f8cd
Compare
Signed-off-by: Vladislav Oleshko <[email protected]>
Signed-off-by: Vladislav Oleshko <[email protected]>
Signed-off-by: Vladislav Oleshko <[email protected]>
Signed-off-by: Vladislav Oleshko <[email protected]>
Signed-off-by: Vladislav Oleshko <[email protected]>
LOG(ERROR) << "Internal error, system probably unstable " << e.what(); | ||
// Collect stats for all regular transactions and all multi transactions from scripts, except EVAL | ||
// itself. EXEC does not use DispatchCommand for dispatching. | ||
bool collect_stats = |
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 do not understand the second part of condition.
if exec does not use DispatchCommand, then when (!dfly_cntx->transaction->IsMulti() || under_script)
is false?
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 wrote it in the comments: except EVAL itself