Skip to content

Conversation

@tezc
Copy link
Owner

@tezc tezc commented Jun 1, 2025

Dummy implementation for these commands:

  • CLUSTER MIGRATION IMPORT start-slot end-slot [start-slot end-slot ...]
  • CLUSTER MIGRATION STATUS
  • CLUSTER MIGRATION CANCEL start-slot end-slot [start-slot end-slot ...]

The implementation primarily handles command parsing. Import requests are simply queued without triggering any action.

@ShooterIT this is a quick implementation to get an idea about the API. Let's see if we are comfortable with this.
Please notice that CANCEL may cancel multiple operations and the reply is number of cancelled operation. I feel like this makes more sense. Let me know what you think.

@tezc tezc requested a review from ShooterIT June 1, 2025 22:16
unsigned char owner_not_claiming_slot[CLUSTER_SLOTS / 8];

/* Atomic slot migration */
list *asm_links;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will a dest node be imported concurrently multiple slot ranges from different source nodes?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, there might be multiple ongoing operations.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, if so, it may be much complicated

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

initially, we can allow single migration operation but we should keep that in mind, it can be multiple parallel operations in future.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw I'm thinking that this list will be there on source side as well, so we can run CLUSTER MIGRATION STATUS. IT is just a single list holds both importing and migrating operations on either side.

#define ASM_IMPORT (1 << 1)
#define ASM_MIGRATE (1 << 2)

typedef struct asmLink {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we call it asmLink, it seems a slot-ranges migration task, right?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't like the name? cluster_legacy.c uses "link" for the connection. I just added asm prefix similar to it. Do you prefer a better name?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the connection just is a part of migration task, how about asmTask

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, changed to it

@ShooterIT
Copy link
Collaborator

Please notice that CANCEL may cancel multiple operations and the reply is number of cancelled operation

makes sense to me

@tezc tezc marked this pull request as ready for review June 4, 2025 06:41
@tezc tezc merged commit 433021e into cluster-asm Jun 4, 2025
31 checks passed
@tezc tezc deleted the cluster-asm-first branch June 30, 2025 23:31
tezc added a commit that referenced this pull request Sep 10, 2025
Dummy implementation of CLUSTER MIGRATION
tezc added a commit that referenced this pull request Sep 16, 2025
Dummy implementation of CLUSTER MIGRATION
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.

3 participants