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: add support for recovery mode #14394

Closed
twmb opened this issue Oct 24, 2023 · 10 comments · Fixed by #14909
Closed

rpk: add support for recovery mode #14394

twmb opened this issue Oct 24, 2023 · 10 comments · Fixed by #14909
Assignees
Labels
area/rpk kind/enhance New feature or request

Comments

@twmb
Copy link
Contributor

twmb commented Oct 24, 2023

This ticket tracks the rpk side of recovery mode.

What we will need to change:

The proposed admin APIs are:

echo '{"disabled": true} | POST v1/cluster/partitions/foo
echo '{"disabled": true} | POST v1/cluster/partitions/foo/1
echo '{"disabled": false} | POST v1/cluster/partitions/foo
echo '{"disabled": false} | POST v1/cluster/partitions/foo/1
GET v1/cluster/partitions?disabled=true
GET v1/cluster/partitions/foo?disabled=true

These should be in this PR: #14236

@twmb twmb added kind/enhance New feature or request area/rpk labels Oct 24, 2023
@ztlpn
Copy link
Contributor

ztlpn commented Oct 24, 2023

#14236 contains only code related to the first bullet point.

I'll publish a pr with APIs needed for remaining bullet points shortly, will link it here.

@ztlpn
Copy link
Contributor

ztlpn commented Oct 27, 2023

#14461 adds APIs for setting/listing disabled partitions. Doesn't include any real effects but it should be enough to unblock implementing rpk support.

@ztlpn
Copy link
Contributor

ztlpn commented Oct 27, 2023

Note that for consistency with other admin API endpoints I added a namespace argument to the path. So /v1/cluster/partitions/foo becomes /v1/cluster/partitions/kafka/foo etc.

@ztlpn
Copy link
Contributor

ztlpn commented Nov 6, 2023

just merged #14461, should unblock this issue

@r-vasquez
Copy link
Contributor

Thanks @ztlpn. For the Admin API request, is it fine if I send the request to any node in the cluster, or should the request be directed to the leader only?

@ztlpn
Copy link
Contributor

ztlpn commented Nov 7, 2023

@r-vasquez GETs can be sent to any node (but for nodes other than controller leader, results can be slightly out of date). POSTs should be sent to the controller leader (other nodes will reply with a redirect).

@r-vasquez
Copy link
Contributor

@ztlpn If I disable a single partition of a topic (POST /v1/cluster/partitions/kafka/<topic>/<partition>) and later on, I try to enable all partitions in the topic (POST /v1/cluster/partitions/kafka/<topic>/), should it enable the partition that I disabled alone?

I'm getting the opposite:

# Disable a single partition [1]
$ curl -X POST localhost:9644/v1/cluster/partitions/kafka/baz/1 -d '{"disabled":true}'

# I see that it's disabled:
$ curl localhost:9644/v1/cluster/partitions/kafka/baz?disabled=true           
[{"ns": "kafka", "topic": "baz", "partition_id": 1, "replicas": [{"node_id": 2, "core": 2},{"node_id": 0, "core": 2},{"node_id": 1, "core": 2}], "disabled": true}]

# Then I try to enable ALL partitions
$ curl -X POST localhost:9644/v1/cluster/partitions/kafka/baz -d '{"disabled":false}'

# But I still see the partition [1] disabled
$ curl localhost:9644/v1/cluster/partitions/kafka/baz\?disabled=true
[{"ns": "kafka", "topic": "baz", "partition_id": 1, "replicas": [{"node_id": 2, "core": 2},{"node_id": 0, "core": 2},{"node_id": 1, "core": 2}], "disabled": true}]%   

Is this expected? If I disable the enable the single partition back, it's fine though.

@ztlpn
Copy link
Contributor

ztlpn commented Nov 17, 2023

@r-vasquez yes, this is a bug, thanks for catching! I'll fix it shortly

@ztlpn
Copy link
Contributor

ztlpn commented Nov 22, 2023

fix for the bug above: #15071

@ztlpn
Copy link
Contributor

ztlpn commented Nov 23, 2023

we also need this small thing: #15104

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
Development

Successfully merging a pull request may close this issue.

3 participants