dragonflydb / dragonfly

A modern replacement for Redis and Memcached
https://www.dragonflydb.io/
Other
24.46k stars 884 forks source link

slave-priority / replica priority like redis configuration #3202

Closed levikhulaifi closed 1 week ago

levikhulaifi commented 1 week ago

Did you search GitHub Issues and GitHub Discussions First? Yes, I have searched for the issue and have had discussions using Discord and I was recommended to open the issue here

Is your feature request related to a problem? Please describe. yes, that's right, I use dragonfly replication / dragonfly cluster with the master slave method which can do auto failover with sentinel merging to find out the master and slave on dragonfly, so I have 3 nodes that are used as replication with 1 master, then can do auto failover if The master has a problem, the funds will make the slave the next master, with this configuration I have problems because I can't determine which one will be the next master from the best slave, because the failover selects the slave as the next master randomly.

The configuration that can determine which slave will be made the next master is the slave-priority / replica-priority configuration which I didn't find in Dragonfly, but I can find this configuration in Redis.

If this configuration can be applied to Dragonfly, the slave-priority / replica-priority configuration is very helpful in implementing cluster or master slave replication with auto failover, and can determine the next slave that you want to make master.

Describe the solution you'd like I really hope that the slave-priority or replica-priority configuration is available on Dragonfly, making it easier to do failover or of course switchover so that I can find out the next master of the selected slave

Describe alternatives you've considered Configuration slave-priority / replica-priority like redis

Additional context gambar

Thanks you

Regards Levi khulaifi

kostasrim commented 1 week ago

Hi @levikhulaifi your wish has been granted ;)

kostasrim commented 1 week ago

@levikhulaifi once the pr is merged you should also start df with info_replication_valkey_compatible=true otherwise priority will fail and fallback to random

levikhulaifi commented 1 week ago

hi @kostasrim sory for late reply. Thank you very much for making this happen, so can I close the issue or do I have to wait until it's released?

need your advice

regards levi khulaifi

kostasrim commented 1 week ago

@levikhulaifi I will close it once my PR gets merged. After that you can either download the weekly docker on Monday or wait for the next release!

levikhulaifi commented 1 week ago

@kostasrim nice, maybe i will wait until released thank you