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

Fixing some compile issues for alpine and centos, also fix endian issue for FLASH hashslot prefix #722

Merged
merged 16 commits into from
Oct 13, 2023

Conversation

msotheeswaran-sc
Copy link
Collaborator

@msotheeswaran-sc msotheeswaran-sc commented Oct 5, 2023

Current implementation of hash slot prefix resulted in incorrect enumeration due to using the wrong 2 bytes, so just use the whole value.
Fixes issue #677.
also update alpine version in Dockerfile Fixes issue #721.

@@ -25,7 +27,7 @@ bool FInternalKey(const char *key, size_t cch)
std::string getPrefix(unsigned int hashslot)
{
char *hash_char = (char *)&hashslot;
return std::string(hash_char + (sizeof(unsigned int) - 2), 2);
return std::string(hash_char, sizeof(unsigned int));
Copy link
Collaborator

Choose a reason for hiding this comment

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

You want uint16_t not unsigned, otherwise your wasting 2 bytes for every key

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

updated

src/server.h Show resolved Hide resolved
@msotheeswaran-sc msotheeswaran-sc merged commit 79b0c84 into main Oct 13, 2023
6 of 8 checks passed
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