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 replication on a single thread #676

Merged
merged 2 commits into from
Jan 15, 2023

Conversation

dranikpg
Copy link
Contributor

Previously replication didn't work with a single threaded master

@@ -428,7 +428,7 @@ uint32_t DflyCmd::CreateSyncSession(ConnectionContext* cntx) {
unique_lock lk(mu_);
unsigned sync_id = next_sync_id_++;

unsigned flow_count = shard_set->size() + 1;
unsigned flow_count = shard_set->size() == 1 ? 1 : shard_set->size() + 1;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure what comment to add:

"Only on a single thread the io fiber does not occupy a separare thread"?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I would implement it differently. Just use "pool->size()". You can access thread pool via shardset imho

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed 😅

@dranikpg dranikpg requested a review from romange January 14, 2023 07:52
@romange romange merged commit 4d97918 into dragonflydb:main Jan 15, 2023
@dranikpg dranikpg deleted the fix-single-thread 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