Updating IsPrimaryOnly command map for new commands by slorello89 · Pull Request #2101 · StackExchange/StackExchange.Redis

@slorello89

@slorello89

@slorello89

@NickCraver

This makes maintenance easier since the place you add a command is right above where it must be a member rather than hidden elsewhere. Tweaking an existing check ensures it works.

slorello89

@NickCraver

Goal is making contributing easier, so more comments here!

@NickCraver

slorello89

@NickCraver

slorello89

slorello89

Can apply the same love to many other classes to be clear but will make another PR for it.

@NickCraver

NickCraver

mgravell

@NickCraver NickCraver deleted the slorello89/IsPrimaryCommandMap branch

April 19, 2022 15:06

This was referenced

Jul 8, 2022

NickCraver added a commit that referenced this pull request

Jul 18, 2022
…primary-only out of primary-only (#2183)

Fixes #2182 

@NickCraver for background in #2101, we changed some of the logic around primary-only to require all commands to be explicitly stated as primary-only or not. During this effort, I went through the command list and checked to see which were considered write commands (which would be rejected by a replica) so that there would be consistency in behavior when stumbling on commands that would ordinarily be rejected by a replica. This made a slightly more restrictive list of commands. 

Enter #2182, where this inconsistency had evidently become load-bearing. The user has evidently designated their replicas as writeable (I think I was subconsciously aware of this capability but have never actually seen anyone use it). As it turns out By resolving this inconsistency in #2101 and the follow-on issue when I introduced `SORT_RO` in #2111 I apparently introduced a break.

This PR reverts all the pre-2.6.45 commands' primary vs replica disposition back to their previous state which will remove the break. Any command that was introduced in 2.6.45 is correctly dispositioned.

Co-authored-by: Nick Craver <nrcraver@gmail.com>