Files
zeekay 5b2e5fe98e fix: revert the -X ours upstream merge, which left the tree uncompilable
`merge: upstream/unstable (-X ours, brand preserved)` resolved every conflicting
hunk in our favour. That is right for brand strings and wrong for code: it kept
our old server.h beside their new module.c, so module.c calls
commandResultSuccessListeners and reads from_call_argv off a struct that has
neither, and zslFreeLexRange lost the declarations it still has call sites for.
kvReaderFeed got a newer body calling kvReaderGetReadBuf/CommitRead grafted onto
older locals — an sds newbuf and an oom: label the new body never uses. Across
398 files nothing downstream noticed, because main has not compiled since.

That is what the Dockerfile was working around. Pulling valkey/valkey and copying
binaries out of it produced an image no matter what the source did, so a tree
that cannot build looked like a tree that builds. Now the image compiles this
source, so the build breaking is visible the moment it breaks.

src, deps and tests return to the last coherent commit. Carried forward on top:

  - Two identical rdbIsVersionAccepted definitions, differing only in a
    parameter name. The rename pass copied the function instead of editing it,
    so this never compiled either.
  - kv_strtod.h lost the #ifdef USE_FAST_FLOAT that separated its two
    implementations, leaving both definitions and a stray #endif.
  - extended-redis-compatibility is deleted, not defaulted off. It made the
    server answer HELLO with "redis" and name itself Redis in five error
    strings. A server that can be configured to lie about what it is has one
    setting too many. HELLO now reports kv unconditionally.
  - The redis-server and redis-cli install symlinks, on by default via
    USE_REDIS_SYMLINKS?=yes. This is why a running instance answered to
    redis-cli at all.
  - valkeymodule.h and redismodule.h, 3094 lines of adapters mapping old
    prefixes onto KVMODULE_*, included by nothing. kvmodule.h is the header.
  - deps/libvalkey, one documentation file the rename stranded.

Wire contract is untouched. INFO still reports redis_version, redis_git_sha1,
redis_git_dirty and redis_build_id, and the Lua sandbox still exports
REDIS_VERSION — clients parse those field names, so they are protocol, not
branding. What we choose is what the server calls itself, and it calls itself kv.

Verified: builds clean, and a live instance answers HELLO with "server kv",
reports server_name:kv, has no extended-redis-compatibility directive, and
serves strings and lists.
2026-07-26 15:04:44 -07:00

33 lines
960 B
Tcl

set testmodule [file normalize tests/modules/test_lazyfree.so]
start_server {tags {"modules"}} {
r module load $testmodule
test "modules allocated memory can be reclaimed in the background" {
set orig_mem [s used_memory]
set rd [kv_deferring_client]
# LAZYFREE_THRESHOLD is 64
for {set i 0} {$i < 10000} {incr i} {
$rd lazyfreelink.insert lazykey $i
}
for {set j 0} {$j < 10000} {incr j} {
$rd read
}
assert {[r lazyfreelink.len lazykey] == 10000}
set peak_mem [s used_memory]
assert {[r unlink lazykey] == 1}
assert {$peak_mem > $orig_mem+10000}
wait_for_condition 50 100 {
[s used_memory] < $peak_mem &&
[s used_memory] < $orig_mem*2 &&
[string match {*lazyfreed_objects:1*} [r info Memory]]
} else {
fail "Module memory is not reclaimed by UNLINK"
}
}
}