Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
31b4b1a
Add IPv6 availability check to skip tests when unavailable
diego-ciciani01 Oct 2, 2025
a1a601b
feat: Refactor test utility and implement IPv6 feature tagging
diego-ciciani01 Oct 9, 2025
63e36cb
feat: Refactor test utility and implement IPv6 feature tagging
diego-ciciani01 Oct 9, 2025
d77f90d
Merge branch 'valkey-io:unstable' into fix-ipv6-test-detection
diego-ciciani01 Oct 10, 2025
8c0c442
fix: correct typos, update help text, and relocate IPv6 availability …
diego-ciciani01 Oct 10, 2025
b2927f4
Tests: Don't dump logs when skipping test using 'skip' (#2718)
zuiderkwast Oct 10, 2025
8cbd6a9
Update the misleading zdiff() comment on empty first key handling. (#…
kyle-yh-kim Oct 11, 2025
e0bb2b5
Bump CLUSTER SHARDS command update version to 9.1.0 (#2729)
hpatro Oct 13, 2025
0bf354b
Stop using DEBUG LOADAOF on replica in ASM tests (#2719)
murphyjacob4 Oct 13, 2025
9b08fe0
Deflake atomic slot migration client flag test (#2720)
murphyjacob4 Oct 13, 2025
d54b5e7
Fix crash that occurs sometimes when aborting a slot migration while …
murphyjacob4 Oct 13, 2025
d9223c5
Add `Slot migration is ok when the replicas are down test` back (#2727)
enjoy-binbin Oct 14, 2025
a8165cb
Fix double MOVED reply on unblock at failover (#2734)
zuiderkwast Oct 14, 2025
53eac74
Deflakes Primary COB growth with inactive replica (#2715)
sarthakaggarwal97 Oct 16, 2025
b4b6b5d
Remove the outupdated unknown key/value pairs comment in CLUSTER SYNC…
enjoy-binbin Oct 17, 2025
96ecf87
Deflake Psync established within grace period (#2743)
roshkhatri Oct 17, 2025
1b9ee07
Bump old engine version(s) for compatibility test (#2741)
hpatro Oct 17, 2025
d8b535c
FUNCTION FLUSH re-create lua VM, fix flush not gc, fix flush async + …
enjoy-binbin Oct 17, 2025
55062f9
Fix incorrect kvstore size and BIT accounting after completed migrati…
murphyjacob4 Oct 18, 2025
571b480
Initialize the lua attributes of the luaFunction script (#2750)
enjoy-binbin Oct 20, 2025
bd42ae2
Fix invalid memory address caused by hashtable shrinking during safe …
murphyjacob4 Oct 20, 2025
276e0ba
Fix outdated comment around clusterLink->flags (#2752)
enjoy-binbin Oct 21, 2025
73d42eb
Fix is_ipv6_available() catch block behavior
diego-ciciani01 Oct 21, 2025
fe06ea2
Fix typo in is_ipv6_available() comment
diego-ciciani01 Oct 21, 2025
cc2508f
Merge branch 'unstable' into fix-ipv6-test-detection
diego-ciciani01 Oct 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/cluster_legacy.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ typedef struct clusterLink {
size_t rcvbuf_alloc; /* Allocated size of rcvbuf */
clusterNode *node; /* Node related to this link. Initialized to NULL when unknown */
int inbound; /* 1 if this link is an inbound link accepted from the related node */
int flags; /* We share CLUSTER_NODE_* with clusterNode->flags. */
int flags; /* CLUSTER_LINK_... */
} clusterLink;

/* Cluster link flags and macros. */
Expand Down
13 changes: 9 additions & 4 deletions src/hashtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -1231,14 +1231,18 @@ void hashtableResumeAutoShrink(hashtable *ht) {

/* Pauses incremental rehashing. When rehashing is paused, bucket chains are not
* automatically compacted when entries are deleted. Doing so may leave empty
* spaces, "holes", in the bucket chains, which wastes memory. */
* spaces, "holes", in the bucket chains, which wastes memory. Additionally, we
* pause auto shrink when rehashing is paused, meaning the hashtable will not
* shrink the bucket count. */
static void hashtablePauseRehashing(hashtable *ht) {
ht->pause_rehash++;
hashtablePauseAutoShrink(ht);
}

/* Resumes incremental rehashing, after pausing it. */
static void hashtableResumeRehashing(hashtable *ht) {
ht->pause_rehash--;
hashtableResumeAutoShrink(ht);
}

/* Returns true if incremental rehashing is paused, false if it isn't. */
Expand Down Expand Up @@ -1630,6 +1634,9 @@ void hashtableTwoPhasePopDelete(hashtable *ht, hashtablePosition *pos) {
assert(isPositionFilled(b, pos_in_bucket));
b->presence &= ~(1 << pos_in_bucket);
ht->used[table_index]--;
/* When we resume rehashing, it may cause the bucket to be deleted due to
* auto shrink. */
hashtablePauseAutoShrink(ht);
hashtableResumeRehashing(ht);
if (b->chained && !hashtableIsRehashingPaused(ht)) {
/* Rehashing paused also means bucket chain compaction paused. It is
Expand All @@ -1638,7 +1645,7 @@ void hashtableTwoPhasePopDelete(hashtable *ht, hashtablePosition *pos) {
* we do the compaction in the scan and iterator code instead. */
fillBucketHole(ht, b, pos_in_bucket, table_index);
}
hashtableShrinkIfNeeded(ht);
hashtableResumeAutoShrink(ht);
}

/* Initializes the state for an incremental find operation.
Expand Down Expand Up @@ -1816,7 +1823,6 @@ size_t hashtableScanDefrag(hashtable *ht, size_t cursor, hashtableScanFunction f
/* Prevent entries from being moved around during the scan call, as a
* side-effect of the scan callback. */
hashtablePauseRehashing(ht);
hashtablePauseAutoShrink(ht);

/* Flags. */
int emit_ref = (flags & HASHTABLE_SCAN_EMIT_REF);
Expand Down Expand Up @@ -1928,7 +1934,6 @@ size_t hashtableScanDefrag(hashtable *ht, size_t cursor, hashtableScanFunction f
} while (cursor & (mask_small ^ mask_large));
}
hashtableResumeRehashing(ht);
hashtableResumeAutoShrink(ht);
return cursor;
}

Expand Down
5 changes: 5 additions & 0 deletions tests/support/server.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,11 @@ proc tags_acceptable {tags err_return} {
return 0
}

if {[lsearch $tags "ipv6"] >= 0 && ![is_ipv6_available]} {
set err "IPv6 not available on this system"
return 0
}

return 1
}

Expand Down
15 changes: 15 additions & 0 deletions tests/test_helper.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -987,6 +987,21 @@ proc close_replication_stream {s} {
return
}

# IPv6 detection utilities
# for this detection: the socket connection on ::1 address
proc is_ipv6_available {} {
if {[catch {
set server [socket -server dummy -myaddr ::1 0]
set port [lindex [chan configure $server -sockname] 2]
set client [socket ::1 $port]
close $server
close $client
}] == 0} {
return 1
}
return 0
}

# With the parallel test running multiple server instances at the same time
# we need a fast enough computer, otherwise a lot of tests may generate
# false positives.
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/introspection.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ start_server {tags {"introspection"}} {
} {}

start_server {tags {"ipv6"} overrides {bind {127.0.0.1 ::1}}} {
test {CLIENT LIST with IPv6 filter} {
test {CLIENT KILL with IPv6 filter} {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

set c [valkey ::1 [srv 0 port] 0 $::tls]
$c client setname "client-ipv6"

Expand All @@ -279,7 +279,7 @@ start_server {tags {"introspection"}} {
$c close
}
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

test {CLIENT KILL with CAPA filter} {
set c1 [valkey_client]
$c1 client setname "killme-capa"
Expand Down Expand Up @@ -509,7 +509,7 @@ start_server {tags {"introspection"}} {
# Use the extracted IP for filtering.
r client list not-ip $not_ip not-ip $not_ip
} {}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

start_server {tags {"ipv6"} overrides {bind {127.0.0.1 ::1}}} {
test {CLIENT LIST with IPv6 negative filter} {
set c [valkey ::1 [srv 0 port] 0 $::tls]
Expand Down