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

bug(replica): execute expire within multi command only if its belong … #766

Merged
merged 2 commits into from
Feb 8, 2023

Conversation

adiholden
Copy link
Collaborator

No description provided.

@adiholden adiholden requested a review from dranikpg February 8, 2023 11:40
Signed-off-by: adi_holden <[email protected]>
Copy link
Contributor

@dranikpg dranikpg left a comment

Choose a reason for hiding this comment

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

Wow, good catch 👍🏻

Comment on lines +591 to +601
for i in range(8):
is_multi = i % 2
c_master_db = aioredis.Redis(port=master.port, db=i)
pipe = c_master_db.pipeline(transaction=is_multi)
# Set simple keys n_keys..n_keys*2 on master
start_key = n_keys*(i+1)
end_key = start_key + n_keys
batch_fill_data(client=pipe, gen=gen_test_data(
end_key, start_key), batch_size=20)

await pipe.execute()
Copy link
Contributor

Choose a reason for hiding this comment

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

you could run this in parallel with asyncio crate_task, I assume this would be more reliable

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

but actually I do not want this to be in parallel to make sure I add entries while other entries are expired, if I will do it in parallel it might be that I finished adding the entries before heartbeat expired the above entries

@adiholden adiholden merged commit 41c1eba into main Feb 8, 2023
@romange romange deleted the fix_replica_execute_expire branch February 18, 2023 16:06
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