[
https://issues.apache.org/jira/browse/RATIS-1769?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Kaijie Chen updated RATIS-1769:
-------------------------------
Summary: Avoid changing priorities in TransferCommand unless necessary
(was: Add TransferLeaderCommand and deprecate TransferCommand)
> Avoid changing priorities in TransferCommand unless necessary
> -------------------------------------------------------------
>
> Key: RATIS-1769
> URL: https://issues.apache.org/jira/browse/RATIS-1769
> Project: Ratis
> Issue Type: Sub-task
> Reporter: Kaijie Chen
> Priority: Major
> Time Spent: 2h 50m
> Remaining Estimate: 0h
>
> This is a followup of RATIS-1762. -TransferCommand should not change priority
> of peers (or at least not by default).-
> -Sadly this will break backward compatibility. But version 3.0 hasn't been
> released, so it might be OK.-
> -Add a new TransferLeadershipCommand which will not change priority of peers
> when transfer leadership.-
> -The old TransferCommand is deprecated and keeped as is for backward
> compatibility reasons.-
> Try to avoid changing priorities before transfer leadership in
> TransferCommand.
> It will fallback to "transfer leadership by changing priority" for backward
> compatibility.
> Example:
> {{bin/ratis sh election transfer -peers
> 127.0.0.1:10024,127.0.0.1:10124,127.0.0.1:11124 -address 127.0.0.1:10024}}
> Backward compatibility:
> {{{}Ratis shell version: 3.0.0-SNAPSHOT{}}}.
> {{{}Ratis server version: 2.4.1{}}}.
> {code:java}
> $ bin/ratis sh election transfer -peers
> 127.0.0.1:10024,127.0.0.1:10124,127.0.0.1:11124 -address
> 127.0.0.1:11124[main] INFO org.reflections.Reflections - Reflections took 164
> ms to scan 1 urls, producing 5 keys and 18 values[main] WARN
> org.apache.ratis.metrics.MetricRegistries - Found multiple MetricRegistries
> implementations: class org.apache.ratis.metrics.impl.MetricRegistriesImpl,
> class org.apache.ratis.metrics.dropwizard3.Dm3MetricRegistriesImpl. Using
> first found implementation:
> org.apache.ratis.metrics.impl.MetricRegistriesImpl@1e67a849Transferring
> leadership to server with address <127.0.0.1:11124> Changing priority of
> <127.0.0.1:11124> to 1: caught an error when executing transfer:
> n0@group-ABB3109A44C1 refused to transfer leadership to peer n2 as it does
> not has highest priority 9:
> peers:[n0|rpc:127.0.0.1:10024|admin:|client:|dataStream:|priority:1|startupRole:FOLLOWER,
>
> n1|rpc:127.0.0.1:10124|admin:|client:|dataStream:|priority:0|startupRole:FOLLOWER,
>
> n2|rpc:127.0.0.1:11124|admin:|client:|dataStream:|priority:1|startupRole:FOLLOWER]|listeners:[],
> old=nullTransferring leadership to server with address <127.0.0.1:11124>
> Changing priority of <127.0.0.1:11124> to 2: Transferring leadership
> initiated{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)