From 71e29f33677c62c903afa41f71ec7ff5a6dda43d Mon Sep 17 00:00:00 2001 From: Vasileios Zois Date: Tue, 2 Jul 2024 10:31:03 -0700 Subject: [PATCH] skip MIGRATE for slot verification --- libs/server/Resp/Parser/RespCommand.cs | 3 +++ libs/server/Resp/RespServerSessionSlotVerify.cs | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/libs/server/Resp/Parser/RespCommand.cs b/libs/server/Resp/Parser/RespCommand.cs index b373837d39a..b07c1dd4b1a 100644 --- a/libs/server/Resp/Parser/RespCommand.cs +++ b/libs/server/Resp/Parser/RespCommand.cs @@ -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) { diff --git a/libs/server/Resp/RespServerSessionSlotVerify.cs b/libs/server/Resp/RespServerSessionSlotVerify.cs index 41dbd4cf003..0e138d57a36 100644 --- a/libs/server/Resp/RespServerSessionSlotVerify.cs +++ b/libs/server/Resp/RespServerSessionSlotVerify.cs @@ -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))