[ 
https://issues.apache.org/jira/browse/KAFKA-14280?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Luke Chen updated KAFKA-14280:
------------------------------
    Description: 
When doing quorum election, we added a random election backoff if vote got 
rejected or timeout, and hope next round, there will be no conflict between 
different voters. But currently, we calculate the random backoff by:

 
{code:java}
Math.min(RETRY_BACKOFF_BASE_MS * random.nextInt(2 << Math.min(20, retries - 1)),
        raftConfig.electionBackoffMaxMs());{code}
 

That means, when multiple candidates tried to backoff for the 1st retries, they 
will all get 0ms backoff, and then keep conflicting again.

 

 

  was:
When doing quorum election, we added a random election backoff if vote got 
rejected or timeout, and hope next round, there will be no conflict between 
different voters. But we currently, we calculate the random backoff by:

 
{code:java}
Math.min(RETRY_BACKOFF_BASE_MS * random.nextInt(2 << Math.min(20, retries - 1)),
        raftConfig.electionBackoffMaxMs());{code}
 

That means, when multiple candidates tried to backoff for the 1st retries, they 
will all get 0ms backoff, and then keep conflicting again.

 


> quorum election random backoff always return 0 for 1st retry
> ------------------------------------------------------------
>
>                 Key: KAFKA-14280
>                 URL: https://issues.apache.org/jira/browse/KAFKA-14280
>             Project: Kafka
>          Issue Type: Bug
>          Components: kraft
>    Affects Versions: 3.3.1
>            Reporter: Luke Chen
>            Assignee: Luke Chen
>            Priority: Major
>
> When doing quorum election, we added a random election backoff if vote got 
> rejected or timeout, and hope next round, there will be no conflict between 
> different voters. But currently, we calculate the random backoff by:
>  
> {code:java}
> Math.min(RETRY_BACKOFF_BASE_MS * random.nextInt(2 << Math.min(20, retries - 
> 1)),
>         raftConfig.electionBackoffMaxMs());{code}
>  
> That means, when multiple candidates tried to backoff for the 1st retries, 
> they will all get 0ms backoff, and then keep conflicting again.
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to