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

fix(transaction): Improve ACTIVE flags management #2458

Merged
merged 2 commits into from
Jan 23, 2024

Conversation

dranikpg
Copy link
Contributor

Fix for #2457

  1. Previously we set the ACTIVE flag on the wrong shard for non-atomic multi transactions, however we determined our activeness by the shard_id == unique_shard_id rule, so the code was working correctly. Added a DCHECK that asserts this (yes it failed tests)

  2. I'm now explicitly clearing local_mask for atomic multi in MultiSwitchCmd and DHCECK that it's cleared during the initialization


if (multi_->mode == NON_ATOMIC) {
sd.local_mask = 0; // Non atomic transactions schedule each time, so remove all flags
sd.pq_pos = TxQueue::kEnd; // and txq pos
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should not it be already at kEnd?

}
coordinator_state_ = 0;
DCHECK_EQ(sd.is_armed.load(memory_order_relaxed), false);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DCHECK(!...) :)

romange
romange previously approved these changes Jan 23, 2024
Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
@dranikpg dranikpg merged commit aeb2b00 into dragonflydb:main Jan 23, 2024
7 checks passed
@dranikpg dranikpg deleted the fix-tx branch January 31, 2024 11:19
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