Skip to content

Commit 420c49c

Browse files
committed
Avoid starting resilient single on last slave peer
1 parent 508bc2e commit 420c49c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

service/local_slaves.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,17 @@ func (s *Service) startLocalSlaves(wg *sync.WaitGroup, config Config, bsCfg Boot
5858
masterAddr = "127.0.0.1"
5959
}
6060
masterAddr = net.JoinHostPort(masterAddr, strconv.Itoa(s.announcePort))
61-
for _, p := range peers {
61+
for idx, p := range peers {
6262
if p.ID == s.id {
6363
continue
6464
}
6565
slaveLog := s.mustCreateIDLogger(p.ID)
6666
slaveBsCfg := bsCfg
6767
slaveBsCfg.ID = p.ID
6868
slaveBsCfg.StartLocalSlaves = false
69+
if bsCfg.Mode.IsResilientSingleMode() && idx > 1 {
70+
slaveBsCfg.StartResilientSingle = boolRef(false)
71+
}
6972
os.MkdirAll(p.DataDir, 0755)
7073

7174
// Read existing setup.json (if any)

0 commit comments

Comments
 (0)