From 4f8f0a829020d7a7051a70fce2ddf748e7731f5e Mon Sep 17 00:00:00 2001 From: Ali Mahdavi Date: Wed, 5 Jun 2024 17:03:24 +0300 Subject: [PATCH] fix bug on findmaster --- ClusterOperator/Operator.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/ClusterOperator/Operator.js b/ClusterOperator/Operator.js index 0e84164..501399e 100644 --- a/ClusterOperator/Operator.js +++ b/ClusterOperator/Operator.js @@ -693,20 +693,20 @@ class Operator { log.info(`masterCandidates: ${JSON.stringify(this.masterCandidates)}`); // if first candidate is me i'm the master if (this.masterCandidates[0] === this.myIP) { - let MasterIP = this.myIP; + // let MasterIP = this.myIP; // ask second candidate for confirmation - if (this.masterCandidates.length > 1) MasterIP = await fluxAPI.getMaster(this.masterCandidates[1], config.containerApiPort); + // if (this.masterCandidates.length > 1) MasterIP = await fluxAPI.getMaster(this.masterCandidates[1], config.containerApiPort); - if (MasterIP === this.myIP) { - this.IamMaster = true; - this.masterNode = this.myIP; - this.status = 'OK'; - } else if (MasterIP === null || MasterIP === 'null') { - log.info('retrying FindMaster...'); - return this.findMaster(); - } else { - this.masterNode = MasterIP; - } + // if (MasterIP === this.myIP) { + this.IamMaster = true; + this.masterNode = this.myIP; + this.status = 'OK'; + // } else if (MasterIP === null || MasterIP === 'null') { + // log.info('retrying FindMaster...'); + // return this.findMaster(); + // } else { + // this.masterNode = MasterIP; + // } } else { // ask first candidate who the master is log.info(`asking master from ${this.masterCandidates[0]}`);