fix: crash if db not exist while process status msg
This commit is contained in:
parent
5a5d2c448b
commit
0183fe6e73
|
@ -389,7 +389,7 @@ static int32_t mndProcessStatusReq(SRpcMsg *pReq) {
|
||||||
}
|
}
|
||||||
if (roleChanged) {
|
if (roleChanged) {
|
||||||
SDbObj *pDb = mndAcquireDb(pMnode, pVgroup->dbName);
|
SDbObj *pDb = mndAcquireDb(pMnode, pVgroup->dbName);
|
||||||
if (pDb->stateTs != curMs) {
|
if (pDb != NULL && pDb->stateTs != curMs) {
|
||||||
mInfo("db:%s, stateTs changed by status msg, old stateTs:%" PRId64 " new stateTs:%" PRId64, pDb->name, pDb->stateTs, curMs);
|
mInfo("db:%s, stateTs changed by status msg, old stateTs:%" PRId64 " new stateTs:%" PRId64, pDb->name, pDb->stateTs, curMs);
|
||||||
pDb->stateTs = curMs;
|
pDb->stateTs = curMs;
|
||||||
}
|
}
|
||||||
|
|
|
@ -164,7 +164,7 @@ static void mndSetVgroupOffline(SMnode *pMnode, int32_t dnodeId, int64_t curMs)
|
||||||
|
|
||||||
if (roleChanged) {
|
if (roleChanged) {
|
||||||
SDbObj *pDb = mndAcquireDb(pMnode, pVgroup->dbName);
|
SDbObj *pDb = mndAcquireDb(pMnode, pVgroup->dbName);
|
||||||
if (pDb->stateTs != curMs) {
|
if (pDb != NULL && pDb->stateTs != curMs) {
|
||||||
mInfo("db:%s, stateTs changed by offline check, old newTs:%" PRId64 " newTs:%" PRId64, pDb->name, pDb->stateTs,
|
mInfo("db:%s, stateTs changed by offline check, old newTs:%" PRId64 " newTs:%" PRId64, pDb->name, pDb->stateTs,
|
||||||
curMs);
|
curMs);
|
||||||
pDb->stateTs = curMs;
|
pDb->stateTs = curMs;
|
||||||
|
|
Loading…
Reference in New Issue