fix: startup is not allowed when fqdn is changed
This commit is contained in:
parent
f7b8f0043e
commit
20c513f42e
|
@ -291,13 +291,17 @@ static void dmPrintEps(SDnode *pDnode) {
|
||||||
|
|
||||||
static bool dmIsEpChanged(SDnode *pDnode, int32_t dnodeId, const char *ep) {
|
static bool dmIsEpChanged(SDnode *pDnode, int32_t dnodeId, const char *ep) {
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
|
if (dnodeId == 0) return changed;
|
||||||
taosRLockLatch(&pDnode->data.latch);
|
taosRLockLatch(&pDnode->data.latch);
|
||||||
|
|
||||||
SDnodeEp *pDnodeEp = taosHashGet(pDnode->data.dnodeHash, &dnodeId, sizeof(int32_t));
|
SDnodeEp *pDnodeEp = taosHashGet(pDnode->data.dnodeHash, &dnodeId, sizeof(int32_t));
|
||||||
if (pDnodeEp != NULL) {
|
if (pDnodeEp != NULL) {
|
||||||
char epstr[TSDB_EP_LEN + 1];
|
char epstr[TSDB_EP_LEN + 1] = {0};
|
||||||
snprintf(epstr, TSDB_EP_LEN, "%s:%u", pDnodeEp->ep.fqdn, pDnodeEp->ep.port);
|
snprintf(epstr, TSDB_EP_LEN, "%s:%u", pDnodeEp->ep.fqdn, pDnodeEp->ep.port);
|
||||||
changed = strcmp(ep, epstr) != 0;
|
changed = (strcmp(ep, epstr) != 0);
|
||||||
|
if (changed) {
|
||||||
|
dError("localEp %s different from %s", ep, epstr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
taosRUnLockLatch(&pDnode->data.latch);
|
taosRUnLockLatch(&pDnode->data.latch);
|
||||||
|
|
Loading…
Reference in New Issue