This commit is contained in:
Josh Soref 2025-12-16 12:48:00 +08:00 committed by GitHub
commit 3df526b33c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
16 changed files with 44 additions and 44 deletions

View File

@ -261,17 +261,17 @@ endif ()
# Sanitizer
if (BUILD_SANITIZER)
# Common CFLAGS
list(APPEND VALKEY_SANITAIZER_CFLAGS "-fno-sanitize-recover=all")
list(APPEND VALKEY_SANITAIZER_CFLAGS "-fno-omit-frame-pointer")
list(APPEND VALKEY_SANITIZER_CFLAGS "-fno-sanitize-recover=all")
list(APPEND VALKEY_SANITIZER_CFLAGS "-fno-omit-frame-pointer")
if ("${BUILD_SANITIZER}" STREQUAL "address")
list(APPEND VALKEY_SANITAIZER_CFLAGS "-fsanitize=address")
list(APPEND VALKEY_SANITAIZER_LDFLAGS "-fsanitize=address")
list(APPEND VALKEY_SANITIZER_CFLAGS "-fsanitize=address")
list(APPEND VALKEY_SANITIZER_LDFLAGS "-fsanitize=address")
elseif ("${BUILD_SANITIZER}" STREQUAL "thread")
list(APPEND VALKEY_SANITAIZER_CFLAGS "-fsanitize=thread")
list(APPEND VALKEY_SANITAIZER_LDFLAGS "-fsanitize=thread")
list(APPEND VALKEY_SANITIZER_CFLAGS "-fsanitize=thread")
list(APPEND VALKEY_SANITIZER_LDFLAGS "-fsanitize=thread")
elseif ("${BUILD_SANITIZER}" STREQUAL "undefined")
list(APPEND VALKEY_SANITAIZER_CFLAGS "-fsanitize=undefined")
list(APPEND VALKEY_SANITAIZER_LDFLAGS "-fsanitize=undefined")
list(APPEND VALKEY_SANITIZER_CFLAGS "-fsanitize=undefined")
list(APPEND VALKEY_SANITIZER_LDFLAGS "-fsanitize=undefined")
else ()
message(FATAL_ERROR "Unknown sanitizer: ${BUILD_SANITIZER}")
endif ()

View File

@ -30,11 +30,11 @@ endif ()
if (BUILD_SANITIZER)
# 'BUILD_SANITIZER' is defined in ValkeySetup module (based on user input)
# If defined, the variables 'VALKEY_SANITAIZER_CFLAGS' and 'VALKEY_SANITAIZER_LDFLAGS'
# If defined, the variables 'VALKEY_SANITIZER_CFLAGS' and 'VALKEY_SANITIZER_LDFLAGS'
# are set with the link & compile flags required
message(STATUS "Adding sanitizer flags for target valkey-server")
target_compile_options(valkey-server PRIVATE ${VALKEY_SANITAIZER_CFLAGS})
target_link_options(valkey-server PRIVATE ${VALKEY_SANITAIZER_LDFLAGS})
target_compile_options(valkey-server PRIVATE ${VALKEY_SANITIZER_CFLAGS})
target_link_options(valkey-server PRIVATE ${VALKEY_SANITIZER_LDFLAGS})
endif ()
unset(BUILD_SANITIZER CACHE)

View File

@ -1591,7 +1591,7 @@ static int ACLSelectorCheckKey(aclSelector *selector, const char *key, int keyle
return ACL_DENIED_KEY;
}
/* Checks if the provided selector selector has access specified in flags
/* Checks if the provided selector has access specified in flags
* to all keys in the keyspace. For example, CMD_KEY_READ access requires either
* '%R~*', '~*', or allkeys to be granted to the selector. Returns 1 if all
* the access flags are satisfied with this selector or 0 otherwise.

View File

@ -1251,7 +1251,7 @@ void scanGenericCommand(client *c, robj *o, unsigned long long cursor) {
* 4. data.pattern: the pattern string;
* 5. data.sampled: the maxiteration limit is there in case we're
* working on an empty dict, one with a lot of empty buckets, and
* for the buckets are not empty, we need to limit the spampled number
* for the buckets are not empty, we need to limit the sampled number
* to prevent a long hang time caused by filtering too many keys;
* 6. data.only_keys: to control whether values will be returned or
* only keys are returned. */

View File

@ -3486,7 +3486,7 @@ int replicaProcessPsyncReply(connection *conn) {
if (!strncmp(reply, "+CONTINUE", 9)) {
if (server.repl_rdb_channel_state != REPL_DUAL_CHANNEL_STATE_NONE) {
/* During dual channel sync sesseion, primary struct is already initialized. */
/* During dual channel sync session, primary struct is already initialized. */
sdsfree(reply);
return PSYNC_CONTINUE;
}

View File

@ -46,7 +46,7 @@ static int checkStringLength(client *c, long long size, long long append) {
if (mustObeyClient(c)) return C_OK;
/* 'uint64_t' cast is there just to prevent undefined behavior on overflow */
long long total = (uint64_t)size + append;
/* Test configured max-bulk-len represending a limit of the biggest string object,
/* Test configured max-bulk-len representing a limit of the biggest string object,
* and also test for overflow. */
if (total > server.proto_max_bulk_len || total < size || total < append) {
addReplyError(c, "string exceeds maximum allowed size (proto-max-bulk-len)");

View File

@ -733,7 +733,7 @@ int test_random_entry(int argc, char **argv, int flags) {
*
* Selecting a single random entry: For any entry in the hash table, let
* X=1 if the we selected the entry (success) and X=0 otherwise. With m
* entries, our entry is sepected with probability p = 1/m, the expected
* entries, our entry is selected with probability p = 1/m, the expected
* value is E(X) = 1/m, E(X^2) = 1/m and the variance:
*
* Var(X) = E(X^2) - (E(X))^2 = 1/m - 1/(m^2) = (1/m) * (1 - 1/m).

View File

@ -216,37 +216,37 @@ int test_sds(int argc, char **argv, int flags) {
/* Test sdsResize - extend */
x = sdsnew("1234567890123456789012345678901234567890");
x = sdsResize(x, 200, 1);
TEST_ASSERT_MESSAGE("sdsReszie() expand type", x[-1] == SDS_TYPE_8);
TEST_ASSERT_MESSAGE("sdsReszie() expand len", sdslen(x) == 40);
TEST_ASSERT_MESSAGE("sdsReszie() expand strlen", strlen(x) == 40);
TEST_ASSERT_MESSAGE("sdsResize() expand type", x[-1] == SDS_TYPE_8);
TEST_ASSERT_MESSAGE("sdsResize() expand len", sdslen(x) == 40);
TEST_ASSERT_MESSAGE("sdsResize() expand strlen", strlen(x) == 40);
/* Different allocator allocates at least as large as requested size,
* to confirm the allocator won't waste too much,
* we add a largest size checker here. */
TEST_ASSERT_MESSAGE("sdsReszie() expand alloc", sdsalloc(x) >= 200 && sdsalloc(x) < 400);
TEST_ASSERT_MESSAGE("sdsResize() expand alloc", sdsalloc(x) >= 200 && sdsalloc(x) < 400);
/* Test sdsResize - trim free space */
x = sdsResize(x, 80, 1);
TEST_ASSERT_MESSAGE("sdsReszie() shrink type", x[-1] == SDS_TYPE_8);
TEST_ASSERT_MESSAGE("sdsReszie() shrink len", sdslen(x) == 40);
TEST_ASSERT_MESSAGE("sdsReszie() shrink strlen", strlen(x) == 40);
TEST_ASSERT_MESSAGE("sdsReszie() shrink alloc", sdsalloc(x) >= 80);
TEST_ASSERT_MESSAGE("sdsResize() shrink type", x[-1] == SDS_TYPE_8);
TEST_ASSERT_MESSAGE("sdsResize() shrink len", sdslen(x) == 40);
TEST_ASSERT_MESSAGE("sdsResize() shrink strlen", strlen(x) == 40);
TEST_ASSERT_MESSAGE("sdsResize() shrink alloc", sdsalloc(x) >= 80);
/* Test sdsResize - crop used space */
x = sdsResize(x, 30, 1);
TEST_ASSERT_MESSAGE("sdsReszie() crop type", x[-1] == SDS_TYPE_8);
TEST_ASSERT_MESSAGE("sdsReszie() crop len", sdslen(x) == 30);
TEST_ASSERT_MESSAGE("sdsReszie() crop strlen", strlen(x) == 30);
TEST_ASSERT_MESSAGE("sdsReszie() crop alloc", sdsalloc(x) >= 30);
TEST_ASSERT_MESSAGE("sdsResize() crop type", x[-1] == SDS_TYPE_8);
TEST_ASSERT_MESSAGE("sdsResize() crop len", sdslen(x) == 30);
TEST_ASSERT_MESSAGE("sdsResize() crop strlen", strlen(x) == 30);
TEST_ASSERT_MESSAGE("sdsResize() crop alloc", sdsalloc(x) >= 30);
/* Test sdsResize - extend to different class */
x = sdsResize(x, 400, 1);
TEST_ASSERT_MESSAGE("sdsReszie() expand type", x[-1] == SDS_TYPE_16);
TEST_ASSERT_MESSAGE("sdsReszie() expand len", sdslen(x) == 30);
TEST_ASSERT_MESSAGE("sdsReszie() expand strlen", strlen(x) == 30);
TEST_ASSERT_MESSAGE("sdsReszie() expand alloc", sdsalloc(x) >= 400);
TEST_ASSERT_MESSAGE("sdsResize() expand type", x[-1] == SDS_TYPE_16);
TEST_ASSERT_MESSAGE("sdsResize() expand len", sdslen(x) == 30);
TEST_ASSERT_MESSAGE("sdsResize() expand strlen", strlen(x) == 30);
TEST_ASSERT_MESSAGE("sdsResize() expand alloc", sdsalloc(x) >= 400);
/* Test sdsResize - shrink to different class */
x = sdsResize(x, 4, 1);
TEST_ASSERT_MESSAGE("sdsReszie() crop type", x[-1] == SDS_TYPE_8);
TEST_ASSERT_MESSAGE("sdsReszie() crop len", sdslen(x) == 4);
TEST_ASSERT_MESSAGE("sdsReszie() crop strlen", strlen(x) == 4);
TEST_ASSERT_MESSAGE("sdsReszie() crop alloc", sdsalloc(x) >= 4);
TEST_ASSERT_MESSAGE("sdsResize() crop type", x[-1] == SDS_TYPE_8);
TEST_ASSERT_MESSAGE("sdsResize() crop len", sdslen(x) == 4);
TEST_ASSERT_MESSAGE("sdsResize() crop strlen", strlen(x) == 4);
TEST_ASSERT_MESSAGE("sdsResize() crop alloc", sdsalloc(x) >= 4);
sdsfree(x);
return 0;

View File

@ -2439,7 +2439,7 @@ static int cliSendCommand(int argc, char **argv, long repeat) {
replicaMode(0);
config.replica_mode = 0;
zfree(argvlen);
return VALKEY_ERR; /* Error = replilcaMode lost connection to primary */
return VALKEY_ERR; /* Error = replicaMode lost connection to primary */
}
/* Read response, possibly skipping pubsub/push messages. */

View File

@ -172,7 +172,7 @@ typedef struct ValkeyModuleStreamID {
#define VALKEYMODULE_CTX_FLAGS_MULTI (1 << 1)
/* The instance is a primary */
#define VALKEYMODULE_CTX_FLAGS_PRIMARY (1 << 2)
/* The instance is a replic */
/* The instance is a replica */
#define VALKEYMODULE_CTX_FLAGS_REPLICA (1 << 3)
/* The instance is read-only (usually meaning it's a replica as well) */
#define VALKEYMODULE_CTX_FLAGS_READONLY (1 << 4)

View File

@ -700,7 +700,7 @@ int zmalloc_get_allocator_info(size_t *allocated, size_t *active, size_t *reside
je_mallctl("stats.retained", retained, &sz, NULL, 0);
}
/* Unlike retained, Muzzy representats memory released with `madvised(..., MADV_FREE)`.
/* Unlike retained, Muzzy represents memory released with `madvised(..., MADV_FREE)`.
* These pages will show as RSS for the process, until the OS decides to re-use them. */
if (muzzy) {
size_t pmuzzy, page;

View File

@ -404,7 +404,7 @@ proc pause_on_error {} {
}
} elseif {$cmd eq {help}} {
puts "ls List Sentinel and Valkey instances."
puts "show-sentinel-logs \[N\] Show latest N lines of logs."
puts "show-sentinel-logs \[N\] Show latest N lines of sentinel logs."
puts "show-valkey-logs \[N\] Show latest N lines of logs."
puts "S <id> cmd ... arg Call command in Sentinel <id>."
puts "R <id> cmd ... arg Call command in Valkey <id>."

View File

@ -296,7 +296,7 @@ start_server {} {
assert_error "ERR Background saving is currently not in progress or scheduled" {r bgsave cancel}
}
test {bgsave cancel schedulled request} {
test {bgsave cancel scheduled request} {
r config set save ""
# Generating RDB will take some 100 seconds
r config set rdb-key-save-delay 1000000

View File

@ -444,7 +444,7 @@ start_server {tags {"repl external:skip"} overrides {save {}}} {
# to the slave.
after 5000
# Stop the ability of the slave to process data by sendig
# Stop the ability of the slave to process data by sending
# a script that will put it in BUSY state.
$slave eval {for i=1,3000000000 do end} 0

View File

@ -739,7 +739,7 @@ start_server {tags {"geo"}} {
}
}
# Make sure this is a real error and not a rounidng issue.
# Make sure this is a real error and not a rounding issue.
if {[llength $diff] == $rounding_errors} {
set res $res2; # Error silenced
}

View File

@ -1320,7 +1320,7 @@ start_server {tags {"scripting"}} {
set rd [valkey_deferring_client]
r config set lua-time-limit 10
# senging (in a pipeline):
# sending (in a pipeline):
# 1. eval "while 1 do redis.call('ping') end" 0
# 2. ping
if {$is_eval == 1} {