Skip to content

Commit

Permalink
skip MIGRATE for slot verification
Browse files Browse the repository at this point in the history
  • Loading branch information
vazois committed Jul 8, 2024
1 parent 5f93240 commit 71e29f3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions libs/server/Resp/Parser/RespCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,9 @@ public static RespCommand LastWriteCommand()
public static bool IsReadOnly(this RespCommand cmd)
=> cmd <= LastReadCommand();

public static bool IsDataCommand(this RespCommand cmd)
=> cmd >= FirstReadCommand() && cmd <= LastWriteCommand();

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool IsWriteOnly(this RespCommand cmd)
{
Expand Down
6 changes: 4 additions & 2 deletions libs/server/Resp/RespServerSessionSlotVerify.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ bool CanServeSlot(RespCommand cmd)
if (cmd == RespCommand.NONE)
return true;

//if (RespCommand.ZDIFF == cmd)
// return true;
// Verify slot for command if it falls into data command category
// TODO: Skip validation of MIGRATE until refactoring of parsing is complete.
if (!cmd.IsDataCommand() || cmd == RespCommand.MIGRATE)
return true;

cmd = cmd.NormalizeForACLs();
if (!RespCommandsInfo.TryFastGetRespCommandInfo(cmd, out var commandInfo))
Expand Down

0 comments on commit 71e29f3

Please sign in to comment.