Skip to content

Commit 71323de

Browse files
committed
fix: add !zs| prefix to FLUSHALL to clear ZSet wide-column data
1 parent 9da1c48 commit 71323de

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

adapter/redis_compat_commands.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -546,15 +546,17 @@ func (r *RedisServer) flushDatabase(conn redcon.Conn, all bool) {
546546
return fmt.Errorf("verify leader: %w", err)
547547
}
548548

549-
// Delete only Redis-related keys. Two DEL_PREFIX operations cover
549+
// Delete only Redis-related keys. Three DEL_PREFIX operations cover
550550
// all Redis namespaces: "!redis|" (str, hash, set, zset, hll,
551-
// stream, ttl) and "!lst|" (list meta + items).
551+
// stream, ttl), "!lst|" (list meta + items), and "!zs|" (zset
552+
// wide-column meta/member/score).
552553
// Legacy bare keys are NOT deleted here to avoid a full keyspace
553554
// scan. Run FLUSHLEGACY first to clean up legacy data.
554555
_, err := r.coordinator.Dispatch(ctx, &kv.OperationGroup[kv.OP]{
555556
Elems: []*kv.Elem[kv.OP]{
556557
{Op: kv.DelPrefix, Key: []byte("!redis|")},
557558
{Op: kv.DelPrefix, Key: []byte("!lst|")},
559+
{Op: kv.DelPrefix, Key: []byte("!zs|")},
558560
},
559561
})
560562
if err != nil {

0 commit comments

Comments
 (0)