#272 Slots for cachedb_redis module

1.8.x
closed-fixed
None
5
2013-05-23
2013-05-10
Ezequiel Lovelle
No

Hello.

in opensips cachedb_redis module, i found a little problem, there is set the cachedb_redis slots to 4095 (0x0FFF) in cachedb_redis_utils.c in line:

92: return crc16(key->s,key->len) & 0x0FFF;

But if the cluster has different total slots, like Salvatore do now : http://redis.io/topics/cluster-spec

this calculation will fail.

I made this little patch who "detects" the number off asigned slots and set them.

I tested for cluster with 4095 slot and other cluster with 16383 slots and it work ok.

Thanks
Goodbye!

Discussion

  • The patch!

     
    Attachments
  • Hello,

    Thanks for the patch, reviewed it and it's good.
    Currently we are in the process of upgrading Sourceforge and also migrating the SVN repo to GIT, so I will apply the patch as soon as possible.

    Best Regards,
    Vlad

     
  • Hello,

    Patch was applied on 1.8, 1.9 and trunk.

    Best Regards,
    Vlad

     
    • status: open --> closed-fixed