Skip to content

[CELEBORN-1632] Support to apply ratis local raft_meta_conf command with RESTful api#2829

Closed
turboFei wants to merge 4 commits into
apache:mainfrom
turboFei:local_raft_conf
Closed

[CELEBORN-1632] Support to apply ratis local raft_meta_conf command with RESTful api#2829
turboFei wants to merge 4 commits into
apache:mainfrom
turboFei:local_raft_conf

Conversation

@turboFei
Copy link
Copy Markdown
Member

@turboFei turboFei commented Oct 19, 2024

What changes were proposed in this pull request?

Sub-task of CELEBORN-1628.

Support to apply ratis local raft_meta_conf with RESTful api.

See https://celeborn.apache.org/docs/latest/celeborn_ratis_shell/#local-raftmetaconf

$ celeborn-ratis sh local raftMetaConf -peers <[P0_ID|]P0_HOST:P0_PORT,[P1_ID|]P1_HOST:P1_PORT,[P2_ID|]P2_HOST:P2_PORT> -path <PARENT_PATH_OF_RAFT_META_CONF>

The implementation is same with https://github.com/apache/ratis/blob/e96ed1a33840385446f4e647864a169467da5ab7/ratis-shell/src/main/java/org/apache/ratis/shell/cli/sh/local/RaftMetaConfCommand.java#L122-L133

Why are the changes needed?

We have implemented the RESTful implementation for all the others ratis-shell command.

image
Ratis Shell RESTful api
election transfer /ratis/election/transfer
election stepDown /ratis/election/step_down
election pause /ratis/election/pause
election resume /ratis/election/resume
group info /masters
peer add /ratis/peer/add
peer remove /ratis/peer/remove
peer setPriority /ratis/peer/set_priority
snapshot create /ratis/snapshot/create

And the local raftMetaConf command is the last one.

I closed the ticket CELEBORN-1632 before, I thought it is a local command and wonder whether it is necessary to implement it with RESTful api.

But we have implemented all the others, so I decide to implement it as well.

Does this PR introduce any user-facing change?

A new API.

The implementation is same with https://github.com/apache/ratis/blob/e96ed1a33840385446f4e647864a169467da5ab7/ratis-shell/src/main/java/org/apache/ratis/shell/cli/sh/local/RaftMetaConfCommand.java#L122-L133

How was this patch tested?

image
image
image

image image

@turboFei turboFei changed the title ratis local raft_meta_conf [CELEBORN-1632] Support to apply ratis local raft_meta_conf command with RESTful api Oct 19, 2024
@turboFei
Copy link
Copy Markdown
Member Author

turboFei commented Oct 22, 2024

which is used to move a raft node to a new node.

will self review the logical again, we may need to allow to replace the existing peer.

@turboFei
Copy link
Copy Markdown
Member Author

turboFei commented Oct 22, 2024

Have update the logical to allow to replace the existing peers.
gentle ping @SteNicholas again

method name
@turboFei
Copy link
Copy Markdown
Member Author

turboFei commented Oct 23, 2024

image image

cc @RexXiong

@RexXiong RexXiong closed this in 216152d Oct 24, 2024
@RexXiong
Copy link
Copy Markdown
Contributor

Thanks, merge to main(v0.6.0)

@turboFei turboFei deleted the local_raft_conf branch October 24, 2024 08:10
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