File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -65,24 +65,17 @@ async def validate(
6565 validation .key_sample_exists = False
6666 validation .errors .append ("Failed to get Redis client for key sample check" )
6767 else :
68- # Handle prefix change: transform key_sample to use new prefix
68+ # Handle prefix change: transform key_sample to use new prefix.
69+ # Must match the executor's RENAME logic exactly:
70+ # new_key = new_prefix + key[len(old_prefix):]
6971 keys_to_check = key_sample
7072 if plan .rename_operations .change_prefix is not None :
7173 old_prefix = plan .source .keyspace .prefixes [0 ]
7274 new_prefix = plan .rename_operations .change_prefix
73- # Normalize separator: strip trailing separator from both
74- # prefixes to avoid double/missing separator in transformed keys
75- sep = ":"
76- old_base = old_prefix .rstrip (sep )
77- new_base = new_prefix .rstrip (sep ) if new_prefix else ""
7875 keys_to_check = []
7976 for k in key_sample :
8077 if k .startswith (old_prefix ):
81- suffix = k [len (old_prefix ):]
82- if new_base :
83- keys_to_check .append (f"{ new_base } { sep } { suffix } " )
84- else :
85- keys_to_check .append (suffix )
78+ keys_to_check .append (new_prefix + k [len (old_prefix ) :])
8679 else :
8780 keys_to_check .append (k )
8881 existing_count = await client .exists (* keys_to_check )
You can’t perform that action at this time.
0 commit comments