mirror of https://mirror.osredm.com/root/redis.git
![]()
CI / build-macos-latest (push) Waiting to run
Details
CI / build-32bit (push) Failing after 31s
Details
CI / build-libc-malloc (push) Failing after 31s
Details
CI / build-debian-old (push) Failing after 1m32s
Details
CI / build-old-chain-jemalloc (push) Failing after 31s
Details
Codecov / code-coverage (push) Failing after 31s
Details
CI / test-ubuntu-latest (push) Failing after 3m21s
Details
Spellcheck / Spellcheck (push) Failing after 31s
Details
CI / test-sanitizer-address (push) Failing after 6m36s
Details
CI / build-centos-jemalloc (push) Failing after 6m36s
Details
External Server Tests / test-external-standalone (push) Failing after 2m10s
Details
Coverity Scan / coverity (push) Has been skipped
Details
External Server Tests / test-external-nodebug (push) Failing after 2m12s
Details
External Server Tests / test-external-cluster (push) Failing after 2m16s
Details
### Background The program runs normally in standalone mode, but migrating to cluster mode may cause errors, this is because some cross slot commands can not run in cluster mode. We should provide an approach to detect this issue when running in standalone mode, and need to expose a metric which indicates the usage of no incompatible commands. ### Solution To avoid perf impact, we introduce a new config `cluster-compatibility-sample-ratio` which define the sampling ratio (0-100) for checking command compatibility in cluster mode. When a command is executed, it is sampled at the specified ratio to determine if it complies with Redis cluster constraints, such as cross-slot restrictions. A new metric is exposed: `cluster_incompatible_ops` in `info stats` output. The following operations will be considered incompatible operations. - cross-slot command If a command has multiple cross slot keys, it is incompatible - `swap, copy, move, select` command These commands involve multi databases in some cases, we don't allow multiple DB in cluster mode, so there are not compatible - Module command with `no-cluster` flag If a module command has `no-cluster` flag, we will encounter an error when loading module, leading to fail to load module if cluster is enabled, so this is incompatible. - Script/function with `no-cluster` flag Similar with module command, if we declare `no-cluster` in shebang of script/function, we also can not run it in cluster mode - `sort` command by/get pattern When `sort` command has `by/get` pattern option, we must ask that the pattern slot is equal with the slot of keys, otherwise it is incompatible in cluster mode. - The script/function command accesses the keys and declared keys have different slots For the script/function command, we not only check the slot of declared keys, but only check the slot the accessing keys, if they are different, we think it is incompatible. **Besides**, commands like `keys, scan, flushall, script/function flush`, that in standalone mode iterate over all data to perform the operation, are only valid for the server that executes the command in cluster mode and are not broadcasted. However, this does not lead to errors, so we do not consider them as incompatible commands. ### Performance impact test **cross slot test** Below are the test commands and results. When using MSET with 8 keys, performance drops by approximately 3%. **single key test** It may be due to the overhead of the sampling function, and single-key commands could cause a 1-2% performance drop. |
||
---|---|---|
.. | ||
Makefile | ||
aclcheck.c | ||
auth.c | ||
basics.c | ||
blockedclient.c | ||
blockonbackground.c | ||
blockonkeys.c | ||
cmdintrospection.c | ||
commandfilter.c | ||
crash.c | ||
datatype.c | ||
datatype2.c | ||
defragtest.c | ||
eventloop.c | ||
fork.c | ||
getchannels.c | ||
getkeys.c | ||
hash.c | ||
hooks.c | ||
infotest.c | ||
internalsecret.c | ||
keyspace_events.c | ||
keyspecs.c | ||
list.c | ||
mallocsize.c | ||
misc.c | ||
moduleauthtwo.c | ||
moduleconfigs.c | ||
moduleconfigstwo.c | ||
postnotifications.c | ||
propagate.c | ||
publish.c | ||
rdbloadsave.c | ||
reply.c | ||
scan.c | ||
stream.c | ||
subcommands.c | ||
test_lazyfree.c | ||
testrdb.c | ||
timer.c | ||
usercall.c | ||
zset.c |