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(server): Fix transaction index + shard_data multi re-use #958

Merged
merged 2 commits into from
Mar 19, 2023

Conversation

dranikpg
Copy link
Contributor

Fix:

  • shard_data re-use for non-atomic multi
  • indexing

Comment on lines 385 to 387
for (auto& sd : shard_data_) {
sd.arg_count = sd.arg_start = sd.local_mask = 0;
sd.pq_pos = TxQueue::kEnd;
sd.is_armed.store(false, memory_order_relaxed);
}
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'd really like to default-assign it, but atomic is not copyable

Copy link
Collaborator

Choose a reason for hiding this comment

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

pls add DCHECK before store that is_armed.load(relaxed) is false?
(the store should be redundant anyway, imho).

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.

lgtm

@dranikpg dranikpg marked this pull request as ready for review March 18, 2023 20:11
@dranikpg dranikpg requested a review from romange March 18, 2023 20:11
@dranikpg dranikpg merged commit 623c5a8 into dragonflydb:main Mar 19, 2023
@dranikpg dranikpg deleted the fix-tx branch March 22, 2023 07:05
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