Skip to content
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

Merged
merged 9 commits into from
Feb 20, 2023

Conversation

dranikpg
Copy link
Contributor

@dranikpg dranikpg commented Feb 18, 2023

  • add multi modes to eval
  • add non atomic modes
  • allow undeclared kets with global & non atomic modes

@dranikpg dranikpg requested a review from romange February 18, 2023 17:35
Copy link
Collaborator

@romange romange left a 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?

src/server/main_service.cc Outdated Show resolved Hide resolved
src/server/main_service.cc Outdated Show resolved Hide resolved
src/server/main_service.cc Outdated Show resolved Hide resolved
} else if (multi_mode == Transaction::NON_ATOMIC) {
scheduled = true;
cntx->transaction->StartMultiNonAtomic();
};
Copy link
Collaborator

@romange romange Feb 18, 2023

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" ?

Copy link
Contributor Author

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?

Copy link
Contributor Author

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?

Copy link
Collaborator

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.

@dranikpg
Copy link
Contributor Author

I'm not sure we need extensive tests. What are we testing for specifically? We can always test with MULTI/EXEC transactions instead

@dranikpg dranikpg requested a review from romange February 19, 2023 12:19
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 =
Copy link
Collaborator

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?

Copy link
Contributor Author

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

@dranikpg dranikpg merged commit 03e99a5 into dragonflydb:main Feb 20, 2023
@dranikpg dranikpg deleted the update-multi-2 branch February 27, 2023 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants