[ https://issues.apache.org/jira/browse/ZOOKEEPER-5063 ]


    Li Wang deleted comment on ZOOKEEPER-5063:
    ------------------------------------

was (Author: liwang):
Proposed solution:

 
Modify `Observer.findLearnerMaster()` to call `recreateSocketAddresses()` on 
the selected observer master before returning it:

```
QuorumServer findLearnerMaster() {
// ... existing code ...
finalQuorumPeer.QuorumServermaster= (prescribedLearnerMaster == null)
?self.findLearnerMaster(findLeader())
: prescribedLearnerMaster;
 
// Add this line to ensure fresh DNS resolution
if (master != null)

{ master.recreateSocketAddresses(); }

 
currentLearnerMaster = master;
// ... rest of existing code ...
}
```

> ZooKeeper observer master needs to dynamically resolve socket addresses
> -----------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-5063
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-5063
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: quorum, server
>    Affects Versions: 4.0.0, 3.7.2, 3.10.0, 3.9.5, 3.8.6
>         Environment: - Kubernetes deployments where ZooKeeper participants 
> run as pods
> - Observer Master feature enabled (`observerMasterPort` configured)
> - DNS-based service discovery
>            Reporter: Li Wang
>            Assignee: Li Wang
>            Priority: Major
>
> Observer Master feature does not dynamically recreate socket addresses when 
> connecting to learner master, causing connection failures in Kubernetes 
> environments where participant pods get rescheduled with new IP addresses.



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

Reply via email to