remove weird session dump crap

This commit is contained in:
2026-05-08 17:21:18 +00:00
parent a2370006f7
commit b08afea425

View File

@@ -1,76 +0,0 @@
#!/usr/bin/bash
# Verify Dragonfly keys have TTL set after LMCache write
# Usage: kubectl run dragonfly-ttl-check --rm -it --image=redis:7-alpine --restart=Never --overrides='{"spec":{"podAnnotations":{"k8s.v1.cni.cncf.io/networks":"[{\"name\":\"ipoib-network-dragonfly\",\"ips\":[\"10.66.0.101/16\"]}]"}}}' -- ./check-ttl.sh 10.66.0.100 6379
#
# Or just drop into redis-cli:
# kubectl run dragonfly-cli --rm -it --image=redis:7-alpine --restart=Never --overrides='...' -- redis-cli -h 10.66.0.100 -p 6379
set -e
HOST="${1:-10.66.0.100}"
PORT="${2:-6379}"
echo "=== Connecting to Dragonfly at ${HOST}:${PORT} ==="
echo ""
# 1. Write a test key with TTL
echo "--- Writing test key with TTL=60s ---"
redis-cli -h "$HOST" -p "$PORT" SET lmcache:ttl:testkey "hello_ttl" EX 60
echo ""
# 2. Check TTL on our test key
echo "--- TTL on test key (should be ~60, not -1) ---"
TTL=$(redis-cli -h "$HOST" -p "$PORT" TTL lmcache:ttl:testkey)
echo "TTL = ${TTL}s"
if [ "$TTL" = "-1" ]; then
echo "FAIL: Key has no TTL (would persist forever)"
else
echo "OK: Key has TTL set"
fi
echo ""
# 3. Find LMCache keys and check their TTLs
echo "--- Scanning for LMCache keys and checking TTLs ---"
# Dragonfly/Redis SCAN - look for keys matching common LMCache patterns
KEYS=$(redis-cli -h "$HOST" -p "$PORT" SCAN 0 COUNT 100 | tail -n +2)
if [ -z "$KEYS" ]; then
echo "No keys found yet. Make sure LMCache is running and has stored some chunks."
echo "Then re-run this check."
else
NO_TTL_COUNT=0
WITH_TTL_COUNT=0
for KEY in $KEYS; do
TTL=$(redis-cli -h "$HOST" -p "$PORT" TTL "$KEY")
if [ "$TTL" = "-1" ]; then
echo " NO TTL: ${KEY}"
NO_TTL_COUNT=$((NO_TTL_COUNT + 1))
else
echo " TTL=${TTL}s: ${KEY}"
WITH_TTL_COUNT=$((WITH_TTL_COUNT + 1))
fi
done
echo ""
echo "--- Summary ---"
echo "Keys WITH TTL: ${WITH_TTL_COUNT}"
echo "Keys WITHOUT TTL: ${NO_TTL_COUNT}"
if [ "$NO_TTL_COUNT" -gt 0 ]; then
echo ""
echo "WARNING: ${NO_TTL_COUNT} keys have no TTL and will persist forever."
echo "This means LMCache was either:"
echo " 1. Written before remote_ttl was configured (old keys)"
echo " 2. Written by a connector that doesn't support TTL (resp://)"
fi
fi
echo ""
echo "--- Dragonfly INFO memory ---"
redis-cli -h "$HOST" -p "$PORT" INFO memory | grep -E "used_memory_human|maxmemory_human|used_memory_peak_human"
# Cleanup test key
redis-cli -h "$HOST" -p "$PORT" DEL lmcache:ttl:testkey > /dev/null 2>&1
echo ""
echo "Done."