[ 
https://issues.apache.org/jira/browse/RATIS-2042?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17829742#comment-17829742
 ] 

Xinyu Tan commented on RATIS-2042:
----------------------------------

Hi, the peer's state may change, so is comparing raftpeer less expensive than 
comparing AtomicReference.set()? This feeling is not a sure thing

> Prevent unnecessary updates on FollowerInfoImpl#peer
> ----------------------------------------------------
>
>                 Key: RATIS-2042
>                 URL: https://issues.apache.org/jira/browse/RATIS-2042
>             Project: Ratis
>          Issue Type: Improvement
>            Reporter: Janus Chow
>            Priority: Major
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> FollowerInfoImpl#getPeer() will always update peer now, we should only update 
> it when it's changed.
>  
> Since `AtomicReference.set()` has minimal performance overhead, will keep the 
> original implementation then.



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

Reply via email to