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

slot missing #2360

Open
smallollams opened this issue Jun 29, 2023 · 3 comments
Open

slot missing #2360

smallollams opened this issue Jun 29, 2023 · 3 comments

Comments

@smallollams
Copy link

I am reading the source code as below:

` int cluster_dist_add_key(redisCluster *c, HashTable *ht, char *key,size_t key_len, clusterKeyVal **kv){
int key_free;
short slot;
clusterDistList *dl;
clusterKeyVal *retptr;

// Prefix our key and hash it
key_free = redis_key_prefix(c->flags, &key, &key_len);
slot = cluster_hash_key(key, key_len);

// We can't do this if we don't fully understand the keyspace
if (c->master[slot] == NULL) {
    if (key_free) efree(key);
    return FAILURE;
}

...`

my question is what bad things could lead to the situation “don't fully understand the keyspace”
thank you for reply

@michael-grunder
Copy link
Member

I don't think it should happen in normal conditions, but this is just defensive programming.

It's always good practice to test for such things in C 😄

@smallollams
Copy link
Author

thank you,but i have encountered a problem. when invoke the "set" method to save data in redis,but finally,my data is not in redis without an exception

@michael-grunder
Copy link
Member

I'd need more information to help diagnose the issue you're having.

Can you provide a small example that replicates the problem? The only other suggestion I'd have is to try and do normal debugging to narrow down exactly when this issue is occuring.

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

No branches or pull requests

2 participants