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(rdb_load): add support for loading huge streams #3855

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/server/debugcmd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,15 @@ tuple<const CommandId*, absl::InlinedVector<string, 5>> GeneratePopulateCommand(
}
json[json.size() - 1] = '}'; // Replace last ',' with '}'
args.push_back(json);
} else if (type == "STREAM") {
Copy link
Contributor Author

@andydunstall andydunstall Oct 3, 2024

Choose a reason for hiding this comment

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

Added this as it's useful for testing, though it is a bit different from the other populate commands since XADD adds a single stream entry with multiple elements in that entry (but the key still has only a single entry which is why the test calls populate 2000 times)

Can remove if preferred and just move this logic into the test (though this sped up the test and useful for manual testing)

cid = registry.Find("XADD");
args.push_back("*");
for (size_t i = 0; i < elements; ++i) {
args.push_back(GenerateValue(val_size / 2, random_value, gen));
args.push_back(GenerateValue(val_size / 2, random_value, gen));
}
}

return {cid, args};
}

Expand Down
Loading
Loading