You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by GitBox <gi...@apache.org> on 2021/11/11 07:06:29 UTC
[GitHub] [ratis] maobaolong opened a new pull request #531: RATIS-1428. Add ratis-shell elect command
maobaolong opened a new pull request #531:
URL: https://github.com/apache/ratis/pull/531
## What changes were proposed in this pull request?
Add a elect sub command to trigger elect specific peer to be next leader.
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/RATIS-1428
## How was this patch tested?
mI did the following test within three alluxio ratis based masters.
```Console
➜ incubator-ratis git:(rs-elect) ✗ mvn clean install assembly:single -DskipTests -Dmaven.javadoc.skip=true -Dlicense.skip=true -Dfindbugs.skip=true -Denforcer.skip=true -Djsse.enableSNIExtension=false -Prelease -Papache-release
➜ incubator-ratis git:(rs-elect) ✗ cd ratis-assembly/target
➜ target git:(rs-elect) ✗ tar -xzf apache-ratis-2.3.0-SNAPSHOT-ratis-shell.tar.gz
➜ target git:(rs-elect) ✗ cd apache-ratis-2.3.0-SNAPSHOT
➜ apache-ratis-2.3.0-SNAPSHOT git:(rs-elect) ✗ bin/ratis sh
Usage: ratis sh [generic options]
[elect -address <HOSTNAME:PORT> -peers <PEER0_HOST:PEER0_PORT,PEER1_HOST:PEER1_PORT,PEER2_HOST:PEER2_PORT> [-groupid <RAFT_GROUP_ID>]]
[info -peers <PEER0_HOST:PEER0_PORT,PEER1_HOST:PEER1_PORT,PEER2_HOST:PEER2_PORT> [-groupid <RAFT_GROUP_ID>]]
➜ apache-ratis-2.3.0-SNAPSHOT git:(rs-elect) ✗ bin/ratis sh info -peers localhost:19200,localhost:19201,localhost:19202
group id: 02511d47-d67c-49a3-9011-abb3109a44c1
leader info: localhost_19201(localhost:19201)
[server {
id: "localhost_19200"
address: "localhost:19200"
}
commitIndex: 2
, server {
id: "localhost_19202"
address: "localhost:19202"
}
commitIndex: 2
, server {
id: "localhost_19201"
address: "localhost:19201"
}
commitIndex: 2
]
➜ apache-ratis-2.3.0-SNAPSHOT git:(rs-elect) ✗ bin/ratis sh elect -peers localhost:19200,localhost:19201,localhost:19202 -address localhost:19202
Applying new peer state before transferring leadership:
[localhost_19202|rpc:localhost:19202|admin:|client:|dataStream:|priority:2, localhost_19201|rpc:localhost:19201|admin:|client:|dataStream:|priority:1, localhost_19200|rpc:localhost:19200|admin:|client:|dataStream:|priority:1]
Transferring leadership to server with address <localhost:19202>
Transferring leadership initiated
➜ apache-ratis-2.3.0-SNAPSHOT git:(rs-elect) ✗ bin/ratis sh info -peers localhost:19200,localhost:19201,localhost:19202
group id: 02511d47-d67c-49a3-9011-abb3109a44c1
leader info: localhost_19202(localhost:19202)
[server {
id: "localhost_19200"
address: "localhost:19200"
priority: 1
}
commitIndex: 16
, server {
id: "localhost_19202"
address: "localhost:19202"
priority: 2
}
commitIndex: 16
, server {
id: "localhost_19201"
address: "localhost:19201"
priority: 1
}
commitIndex: 16
]
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ratis] maobaolong closed pull request #531: RATIS-1428. Add ratis-shell elect command
Posted by GitBox <gi...@apache.org>.
maobaolong closed pull request #531:
URL: https://github.com/apache/ratis/pull/531
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ratis] szetszwo merged pull request #531: RATIS-1428. Add ratis-shell elect command
Posted by GitBox <gi...@apache.org>.
szetszwo merged pull request #531:
URL: https://github.com/apache/ratis/pull/531
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ratis] maobaolong closed pull request #531: RATIS-1428. Add ratis-shell elect command
Posted by GitBox <gi...@apache.org>.
maobaolong closed pull request #531:
URL: https://github.com/apache/ratis/pull/531
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ratis] runzhiwang commented on pull request #531: RATIS-1428. Add ratis-shell elect command
Posted by GitBox <gi...@apache.org>.
runzhiwang commented on pull request #531:
URL: https://github.com/apache/ratis/pull/531#issuecomment-966932825
+1, @maobaolong thanks the patch.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org