This commit is contained in:
Shengliang Guan 2022-03-20 11:59:35 +08:00
parent 4cb813a920
commit 08c9fc40f4
3 changed files with 20 additions and 2 deletions

View File

@ -1,3 +1,18 @@
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define _DEFAULT_SOURCE
#include "dndInt.h"

View File

@ -28,7 +28,10 @@ static struct {
static void dndSigintHandle(int signum, void *info, void *ctx) {
dInfo("signal:%d is received", signum);
dndHandleEvent(global.pDnode, DND_EVENT_STOP);
SDnode *pDnode = atomic_val_compare_exchange_ptr(&global.pDnode, 0, global.pDnode);
if (pDnode != NULL) {
dndHandleEvent(pDnode, DND_EVENT_STOP);
}
}
static void dndSetSignalHandle() {

View File

@ -58,7 +58,7 @@ static void mmBuildOptionForDeploy(SMnodeMgmt *pMgmt, SMnodeOpt *pOption) {
SReplica *pReplica = &pOption->replicas[0];
pReplica->id = 1;
pReplica->port = pDnode->serverPort;
memcpy(pReplica->fqdn, pDnode->localFqdn, TSDB_FQDN_LEN);
tstrncpy(pReplica->fqdn, pDnode->localFqdn, TSDB_FQDN_LEN);
pMgmt->selfIndex = pOption->selfIndex;
pMgmt->replica = pOption->replica;