-
Notifications
You must be signed in to change notification settings - Fork 1k
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
feat(server): extend populate command with expire #4752
Conversation
@lichuang please see CONTRIBUTING.md on how to format the files using presubmit. |
5e03639
to
dbfa51e
Compare
@lichuang I noticed you have quite a lot of followers, in github and on X. how come? :) |
I manually verified that it's working well, great job @lichuang ! |
May be because I'm active in the Chinese developer community :) |
Well, great to meet you and thank you for your contribution! 🙏🏼 |
@@ -194,6 +195,28 @@ void DoPopulateBatch(string_view type, string_view prefix, size_t val_size, bool | |||
stub_tx->InitByArgs(cntx->ns, local_cntx.conn_state.db_index, args_span); | |||
|
|||
sf->service().InvokeCmd(cid, args_span, &crb, &local_cntx); | |||
|
|||
if (expire_ttl_range.has_value()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @lichuang
Thank you for contributing!
I see there is a bug here.
This if should be outside the while(elements_left) loop
Inside the while loop we continue to populate the same key, so when you do this in the while loop you run expire multiple times for the same key and I see that you also use std::move(key) below which actually breaks things. Dont know why it did not failed in our tests..
Would you like to follow up on this and provide a fix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, i take care of this issue now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feat(server): extend populate command with expire
fix issue #4742