Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rpk: support node-local core assignment APIs for dispatching cross-core partition moves #21562

Closed
ztlpn opened this issue Jul 22, 2024 · 1 comment · Fixed by redpanda-data/common-go#10 or #21573
Assignees
Labels
area/rpk kind/enhance New feature or request

Comments

@ztlpn
Copy link
Contributor

ztlpn commented Jul 22, 2024

New v24.2 Redpanda clusters will switch to "node-local core assignment" which means that APIs for dispatching cross-core partition moves will be different (endpoints for cross-core and cross-node movements will be different).

To support that, the rpk cluster partitions move command has to do the following:
0. Determine if the feature is enabled by querying GET /v1/features (node_local_core_assignment feature has to be present and in the active state). If it is not, rpk should call old APIs.

  1. Determine the current node assignment. This can be done by querying GET /v1/partitions/{namespace}/{topic}/{partition} for each moved NTP.
  2. If the current node assignment differs from the one requested by the user, dispatch a POST /v1/partitions/{namespace}/{topic}/{partition}/replicas with the json body corresponding to the requested node assignment (e.g. [{"node_id":2, "core":0},{"node_id":3, "core":0},{"node_id":4, "core":0}] for node assignment {2, 3, 4}, cores can be arbitrary).
  3. If the user additionally requested one or more cross-core movements (e.g. -p foo/0:1,2-1,3), for each requested core assignment dispatch a POST /v1/partitions/{namespace}/{topic}/{partition}/replicas/{node} request with the requested core in the json body (in the previous example, {node} should be 2 and the request body should be {"core": 1}.

Additionally, the following guardrails have to be implemented:

  1. The command should never change the number of replicas. Current number of replicas can be determined from the current assignment that was queried in step 1
  2. Assigning a core to a new replica (i.e. replica not present in the current assignment) should be forbidden.

JIRA Link: CORE-5739

@ztlpn ztlpn added kind/enhance New feature or request area/rpk labels Jul 22, 2024
@ztlpn
Copy link
Contributor Author

ztlpn commented Jul 22, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/rpk kind/enhance New feature or request
Projects
None yet
2 participants