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

feat(server): extend populate command with expire #4752

Merged
merged 1 commit into from
Mar 12, 2025

Conversation

lichuang
Copy link
Contributor

feat(server): extend populate command with expire

fix issue #4742

@romange
Copy link
Collaborator

romange commented Mar 12, 2025

@lichuang please see CONTRIBUTING.md on how to format the files using presubmit.

@romange
Copy link
Collaborator

romange commented Mar 12, 2025

@lichuang I noticed you have quite a lot of followers, in github and on X. how come? :)

@romange
Copy link
Collaborator

romange commented Mar 12, 2025

I manually verified that it's working well, great job @lichuang !

@lichuang
Copy link
Contributor Author

@lichuang I noticed you have quite a lot of followers, in github and on X. how come? :)

May be because I'm active in the Chinese developer community :)

@romange
Copy link
Collaborator

romange commented Mar 12, 2025

Well, great to meet you and thank you for your contribution! 🙏🏼

@romange romange merged commit 70e757f into dragonflydb:main Mar 12, 2025
10 checks passed
@@ -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()) {
Copy link
Collaborator

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?

Copy link
Contributor Author

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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.

None yet

3 participants