From 3eb4571be4b9ca7059c2e3f36ea8f1c59ad0408b Mon Sep 17 00:00:00 2001 From: "gd.zhou" Date: Mon, 19 Oct 2026 20:39:15 +0800 Subject: [PATCH] [feat] intercept swap-unsupported hyperloglog commands HyperLogLog commands (PFADD, PFMERGE, PFDEBUG, PFSELFTEST) operate on a data type that swap does not currently support. Tag them with the swap-soft-blocked flag so the existing interception/counter mechanism counts and (optionally) blocks them, mirroring the stream commands change from #456. Also bump deps/xredis-gtid to pick up the matching 8.x hotfix. --- deps/xredis-gtid | 2 +- src/ctrip_swap_cmd.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/deps/xredis-gtid b/deps/xredis-gtid index 837ee264308..e4c64ef3c12 160000 --- a/deps/xredis-gtid +++ b/deps/xredis-gtid @@ -1 +1 @@ -Subproject commit 837ee264308d2b2544c4de55678eefcd291f176b +Subproject commit e4c64ef3c122d80a368b3af1a9aa3c6eadb74ac6 diff --git a/src/ctrip_swap_cmd.c b/src/ctrip_swap_cmd.c index a08d5fba90f..dfaad122a76 100644 --- a/src/ctrip_swap_cmd.c +++ b/src/ctrip_swap_cmd.c @@ -843,11 +843,11 @@ struct redisCommand redisCommandTable[SWAP_CMD_COUNT] = { 0,NULL,getKeyRequestsGeoSearchStore,SWAP_IN,SWAP_IN_DEL,1,2,1,0,0,0}, {"pfselftest",pfselftestCommand,1, - "admin @hyperloglog @swap_string", + "admin swap-soft-blocked @hyperloglog @swap_string", 0,NULL,NULL,SWAP_IN,0,0,0,0,0,0,0}, {"pfadd",pfaddCommand,-2, - "write use-memory fast @hyperloglog @swap_string", + "write use-memory fast swap-soft-blocked @hyperloglog @swap_string", 0,NULL,NULL,SWAP_IN,0,1,1,1,0,0,0}, /* Technically speaking PFCOUNT may change the key since it changes the @@ -859,14 +859,14 @@ struct redisCommand redisCommandTable[SWAP_CMD_COUNT] = { 0,NULL,NULL,SWAP_IN,0,1,-1,1,0,0,0}, {"pfmerge",pfmergeCommand,-2, - "write use-memory @hyperloglog @swap_string", + "write use-memory swap-soft-blocked @hyperloglog @swap_string", 0,NULL,NULL,SWAP_IN,0,1,-1,1,0,0,0}, /* Unlike PFCOUNT that is considered as a read-only command (although * it changes a bit), PFDEBUG may change the entire key when converting * from sparse to dense representation */ {"pfdebug",pfdebugCommand,-3, - "admin write use-memory @hyperloglog @swap_string", + "admin write use-memory swap-soft-blocked @hyperloglog @swap_string", 0,NULL,NULL,SWAP_IN,0,2,2,1,0,0,0}, {"xadd",xaddCommand,-5,