Skip to content

The TDIGEST.MERGE command in Kvrocks behaves differently from Redis when the destination key already exists. #3410

@Tangruilin

Description

@Tangruilin

Search before asking

  • I had searched in the issues and found no similar issues.

Version

unstable

Minimal reproduce step

#!/bin/bash
# TDIGEST.MERGE bug reproduction script
# Usage: ./reproduce_tdigest_merge.sh [redis-cli path] [port]

CLI="${1:-redis-cli}"
PORT="${2:-6379}"
PREFIX="$CLI -p $PORT"

echo "============================================"
echo "TDIGEST.MERGE Bug Reproduction"
echo "============================================"

echo -e "\n--- Step 1: Clean up ---"
$PREFIX DEL td_src1 td_src2 td_dest

echo -e "\n--- Step 2: Create source sketches ---"
$PREFIX TDIGEST.CREATE td_src1 COMPRESSION 100
$PREFIX TDIGEST.CREATE td_src2 COMPRESSION 100
$PREFIX TDIGEST.ADD td_src1 1 2 3
$PREFIX TDIGEST.ADD td_src2 4 5 6

echo -e "\n--- Step 3: Create destination sketch ---"
$PREFIX TDIGEST.CREATE td_dest COMPRESSION 100

echo -e "\n--- Step 4: Merge into existing destination ---"
echo "Command: TDIGEST.MERGE td_dest 2 td_src1 td_src2"
$PREFIX TDIGEST.MERGE td_dest 2 td_src1 td_src2

echo -e "\n--- Step 5: Check destination ---"
$PREFIX TDIGEST.INFO td_dest

echo -e "\n--- Step 6: Clean up ---"
$PREFIX DEL td_src1 td_src2 td_dest

echo -e "\n============================================"
echo "Test completed"
echo "============================================"

What did you expect to see?

Redis result

Image

What did you see instead?

kvrocks result

Image

Anything Else?

no

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugtype bug

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions