From e49a8e1c6f574d854ed37dc3247a4f2e68920444 Mon Sep 17 00:00:00 2001 From: Twice Date: Sat, 13 Jul 2024 17:47:01 +0900 Subject: [PATCH 1/2] perf(conn): skip index matching when index map is empty (#2405) --- src/server/redis_connection.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/redis_connection.cc b/src/server/redis_connection.cc index 0457c71d57e..b8985f60812 100644 --- a/src/server/redis_connection.cc +++ b/src/server/redis_connection.cc @@ -544,7 +544,8 @@ void Connection::ExecuteCommands(std::deque *to_process_cmds) { // TODO: transaction support for index recording std::vector index_records; - if (IsHashOrJsonCommand(cmd_name) && (attributes->flags & redis::kCmdWrite) && !config->cluster_enabled) { + if (!srv_->index_mgr.index_map.empty() && IsHashOrJsonCommand(cmd_name) && (attributes->flags & redis::kCmdWrite) && + !config->cluster_enabled) { attributes->ForEachKeyRange( [&, this](const std::vector &args, const CommandKeyRange &key_range) { key_range.ForEachKey( From 32062061a0952df7a77b0d047d6577acee503edf Mon Sep 17 00:00:00 2001 From: Aleks Lozovyuk Date: Sat, 13 Jul 2024 16:31:50 +0300 Subject: [PATCH 2/2] chore(test): bump dependencies of go-redis (#2407) Co-authored-by: Twice --- tests/gocase/go.mod | 2 +- tests/gocase/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/gocase/go.mod b/tests/gocase/go.mod index 377c6296892..e8d66034c2a 100644 --- a/tests/gocase/go.mod +++ b/tests/gocase/go.mod @@ -3,7 +3,7 @@ module github.com/apache/kvrocks/tests/gocase go 1.21 require ( - github.com/redis/go-redis/v9 v9.5.3 + github.com/redis/go-redis/v9 v9.5.4 github.com/shirou/gopsutil/v3 v3.24.5 github.com/stretchr/testify v1.9.0 golang.org/x/exp v0.0.0-20240707233637-46b078467d37 diff --git a/tests/gocase/go.sum b/tests/gocase/go.sum index 141ee382722..4835c504654 100644 --- a/tests/gocase/go.sum +++ b/tests/gocase/go.sum @@ -19,8 +19,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= -github.com/redis/go-redis/v9 v9.5.3 h1:fOAp1/uJG+ZtcITgZOfYFmTKPE7n4Vclj1wZFgRciUU= -github.com/redis/go-redis/v9 v9.5.3/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M= +github.com/redis/go-redis/v9 v9.5.4 h1:vOFYDKKVgrI5u++QvnMT7DksSMYg7Aw/Np4vLJLKLwY= +github.com/redis/go-redis/v9 v9.5.4/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI=