valkey icon indicating copy to clipboard operation
valkey copied to clipboard

finally remove all master/slave terminology

Open zuiderkwast opened this issue 4 months ago • 21 comments

Primary and replica, are these the preferred terms?

The current situation is master/replica, with slave kept as an alias of replica. Some commands like ROLE still returns "master" and "slave".

So far "master" was accepted, so there aren't yet any aliases for "master". Shall we first introduce aliases and deprecate master in our first release, then in our next release (not too far in the future) do all the breaking changes?

  1. Add aliases for master (not a breaking change)
  2. Delete master and slave terminology (breaking change)

Occurrences of "master" where we can add "primary" and make "master" an alias:

  • CLIENT KILL TYPE MASTER
  • CLIENT LIST TYPE MASTER
  • SENTINEL GET-MASTER-ADDR-BY-NAME

Breaking changes:

  • Remove all aliases "slave"
  • Replace all remaining occurrences of "slave" and "master" with the new terms. This includes the return value of the ROLE command.
  • CLUSTER SHARDS ("role" => "master", in the reply)

zuiderkwast avatar Mar 26 '24 11:03 zuiderkwast

Hi! Would this be a decent "first issue" for a techie who's interested in getting more involved with the alt/redis ecosystem? I'd be happy to use this as a way to get more familiar with the repo :)

GaryPWhite avatar Mar 26 '24 13:03 GaryPWhite

@GaryPWhite Yes, that's great, but first we need to analyze and decide exactly what we need to do and in which steps. There are implications like Redis compatibility to consider.

zuiderkwast avatar Mar 26 '24 13:03 zuiderkwast

@GaryPWhite Actually I think you can start with the non-breaking changes of simply adding PRIMARY aliases (or rather make MASTER an alias of PRIMARY) for these:

  • CLIENT KILL TYPE MASTER
  • CLIENT LIST TYPE MASTER
  • SENTINEL GET-MASTER-ADDR-BY-NAME

Look into how SLAVE is already an alias of REPLICA in these commands.

zuiderkwast avatar Mar 26 '24 13:03 zuiderkwast

Agree with master as an alias of primary. But suggest to hold the master and slave name, maybe they will remove in future version

hwware avatar Mar 26 '24 14:03 hwware

Yes, the breaking change is a "major decision". We should analyze the implications a bit more too. There may be reasons to be compatible with other forks and implementations so we should also keep on eye on them.

We may even consider some possibility for conditional compilation or similar.

zuiderkwast avatar Mar 26 '24 14:03 zuiderkwast

I would vote for "primary" and "replica".

As for changes, I now think more and more that we need a "compat" knob. It can be either compile time or runtime (via config).

We could also consider a staged change:

  1. Anything non-user facing, i.e., comments, function/variable names, etc

  2. Aliasing input to support both terminologies (but also under the "compat" switch)

  3. Changing output. Aliasing would not work in this case. We will default to the new terminology but it can be overridden by the user, again either compile time or runtime (pending decision)

PingXie avatar Mar 26 '24 14:03 PingXie

Yes, 1 and 2 can be done immediately IMO, but in two separate PRs.

zuiderkwast avatar Mar 26 '24 14:03 zuiderkwast

If there is a compat knob, it would be good to have a pre-determined sequence of deprecation.

E.g. version n introduce knob and optional new terminology, version n+1 new terminology becomes default, old terminology is deprecated, version n+2 remove old terminology.

Otherwise these things just linger. Pull off the bandaid, as they say.

stockholmux avatar Mar 26 '24 15:03 stockholmux

Pull off the bandaid, as they say

Yes we should do it at some point but I think the timing of it falls in another major decision and we need to give our users ample time to adjust. As much as I am personally in strong favor of ripping this bandaid off asap I also understand that the success of this project is very much dependent on "continuity". It takes time to turn this huge ship around.

PingXie avatar Mar 26 '24 15:03 PingXie

3 major version would be enough transition time, I'd assume.

But mainly I'm just advocating have a set plan before changes happen so it doesn't languish for an undetermined amount of time.

stockholmux avatar Mar 26 '24 15:03 stockholmux

I'm just advocating have a set plan before changes happen so it doesn't languish for an undetermined amount of time.

Timing aside, I think one option, as you suggested too, is to just remove this compat knob and we are done. I have yet to think of other options because as far as output is concerned, it is a binary decision. So the plan in my opinion is more about deliberating a timeline with the help of the community, than an engineering plan to help with a smooth transition. In other words, I think https://github.com/placeholderkv/placeholderkv/issues/36#issuecomment-2020632035 is the best we can do. Curious to hear other folks' thoughts.

PingXie avatar Mar 26 '24 16:03 PingXie

de-crapify 😂

hpatro avatar Mar 26 '24 16:03 hpatro

Maybe we need to consider some compatibility to SDKs like jedis.

Like "cluster nodes", it may return with "master" field and might be used by some SDKs.

DarrenJiang13 avatar Mar 27 '24 03:03 DarrenJiang13

@alonohana627 May I ask why you down-voted this? Just curious. If it's about compatibility, I'd like to hear it so we can make a better decision.

zuiderkwast avatar Mar 28 '24 12:03 zuiderkwast

@alonohana627 May I ask why you down-voted this? Just curious. If it's about compatibility, I'd like to hear it so we can make a better decision.

all his (recently) created github repositories are using "master" for branch naming, so I think it is personal preference in this case

singlyfy avatar Mar 30 '24 01:03 singlyfy

@singlyfy @zuiderkwast sry for downvote!!! I don't have an opinion, when I create a repo I don't consider the main's repo name. It was a missclick. I remove the downvote.

I want to contribute but I'm new, I'm not sure if upvote/downvote this suggestion because I sincerely don't understand it. I hope you won't think I tried to troll or anything, sorry for the inconvenient.

alonohana627 avatar Apr 01 '24 10:04 alonohana627

I have down-voted only because I don't encourage making breaking changes, aliases are totally fine. But please do not force name change by removing old naming conventions.

Dom4n avatar Apr 02 '24 13:04 Dom4n

@Dom4n It is a very valid concern. I think backward compatibility is very important, especially in this kind of project which has been mostly feature-complete since many years. Let's think about it a bit more.

zuiderkwast avatar Apr 02 '24 19:04 zuiderkwast

@GaryPWhite Are you still interesting in helping out with the non-breaking changes?

We will not do any of the breaking changes at this point.

zuiderkwast avatar Apr 15 '24 17:04 zuiderkwast

absolutely interested -- sorry for the delay. Felt like a lot happened at once -- I'll start taking a look!

GaryPWhite avatar May 02 '24 14:05 GaryPWhite