Skip to content

Code Review Bench PR #14637 - Fix adjacent slot range behavior in ASM operations#2

Open
tomerqodo wants to merge 8 commits intobase_pr_14637_20260125_9355from
corrupted_pr_14637_20260125_9355
Open

Code Review Bench PR #14637 - Fix adjacent slot range behavior in ASM operations#2
tomerqodo wants to merge 8 commits intobase_pr_14637_20260125_9355from
corrupted_pr_14637_20260125_9355

Conversation

@tomerqodo
Copy link

Code Review Bench PR redis#14637

Original PR Title: Fix adjacent slot range behavior in ASM operations
Original PR Description: This PR containts a few changes for ASM:

Bug fix:

  • Fixes an issue in ASM when adjacent slot ranges are provided in CLUSTER MIGRATION IMPORT command (e.g. 0-10 11-100). ASM task keeps the original slot ranges as given, but later the source node reconstructs the slot ranges from the config update as a single range (e.g. 0-100). This causes asmLookupTaskBySlotRangeArray() to fail to match the task, and the source node incorrectly marks the ASM task as failed. Although the migration completes successfully, the source node performs a blocking trim operation for these keys, assuming the slot ownership changed outside of an ASM operation. With this PR, redis merges adjacent slot ranges in a slot range array to avoid this problem.

Other improvements:

  • Indicates imported/migrated key count in the log once asm operation is completed.
  • Use error return value instead of assert in parseSlotRangesOrReply()
  • Validate slot range array that is given by cluster implementation on ASM_EVENT_IMPORT_START.

Original PR URL: redis#14637

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants