Skip to content

feat: add more auxillary strings to the snapshot #5411

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

Merged
merged 2 commits into from
Jul 15, 2025
Merged

feat: add more auxillary strings to the snapshot #5411

merged 2 commits into from
Jul 15, 2025

Conversation

romange
Copy link
Collaborator

@romange romange commented Jul 3, 2025

This PR adds aux-strings to the header of dfs files.
aux-strings do not break compatibility and potentially provide
better memory management and consistency checks during the snapshot load.

All in all this PR should not change functionality or compatibility
with older Dragonfly versons.

Signed-off-by: Roman Gershman [email protected]

[&] { return LoadRdb(std::string(load_path), existing_keys, &snapshot_id); });
if (!load_result.has_value())
aggregated_result->first_error = load_result.error();
error_code load_result =
Copy link
Contributor

Choose a reason for hiding this comment

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

load_result is error_code, please rename it to result_ec or something else

else
aggregated_result->first_error = load_result.error();
auto load_func = [=]() mutable {
error_code load_result = LoadRdb(file, existing_keys, &load_opts);
Copy link
Contributor

Choose a reason for hiding this comment

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

the same, please rename

BorysTheDev
BorysTheDev previously approved these changes Jul 5, 2025
@romange romange requested a review from BorysTheDev July 6, 2025 04:37
@romange romange force-pushed the Pr1 branch 3 times, most recently from 1605561 to fedcc11 Compare July 6, 2025 18:56
@romange romange changed the title feat: pass segment count information to the snapshot feat: add more auxillary strings to the snapshot Jul 6, 2025
This PR adds aux-strings to the header of dfs files.
aux-strings do not break compatibility and potentially provide
better memory management and consistency checks during the snapshot load.

All in all this PR should not change functionality or compatibility
with older Dragonfly versons.

Signed-off-by: Roman Gershman <[email protected]>
Comment on lines +2481 to +2484
uint32_t shard_count;
if (absl::SimpleAtoi(auxval, &shard_count)) {
shard_count_ = shard_count;
}
Copy link
Contributor

@BorysTheDev BorysTheDev Jul 10, 2025

Choose a reason for hiding this comment

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

maybe let's do some wrapper, because you do it a lot

@romange romange enabled auto-merge (squash) July 15, 2025 07:47
@romange romange merged commit 4e9e28e into main Jul 15, 2025
10 checks passed
@romange romange deleted the Pr1 branch July 15, 2025 08:48
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