[TD-3963]fix alter db bug when there is no vgroup case
This commit is contained in:
parent
ee334d6f78
commit
3cc8280846
|
@ -45,8 +45,6 @@ int64_t tsDbRid = -1;
|
||||||
void * tsDbSdb = NULL;
|
void * tsDbSdb = NULL;
|
||||||
static int32_t tsDbUpdateSize;
|
static int32_t tsDbUpdateSize;
|
||||||
|
|
||||||
#define ALTER_CDB_RETRY_TIMES 3
|
|
||||||
|
|
||||||
static int32_t mnodeCreateDb(SAcctObj *pAcct, SCreateDbMsg *pCreate, SMnodeMsg *pMsg);
|
static int32_t mnodeCreateDb(SAcctObj *pAcct, SCreateDbMsg *pCreate, SMnodeMsg *pMsg);
|
||||||
static int32_t mnodeDropDb(SMnodeMsg *newMsg);
|
static int32_t mnodeDropDb(SMnodeMsg *newMsg);
|
||||||
static int32_t mnodeSetDbDropping(SDbObj *pDb);
|
static int32_t mnodeSetDbDropping(SDbObj *pDb);
|
||||||
|
@ -1088,6 +1086,10 @@ static int32_t mnodeAlterDbFp(SMnodeMsg *pMsg) {
|
||||||
}
|
}
|
||||||
mnodeDecVgroupRef(pVgroup);
|
mnodeDecVgroupRef(pVgroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mDebug("db:%s, all vgroups is altered", pDb->name);
|
||||||
|
mLInfo("db:%s, is alterd by %s", pDb->name, mnodeGetUserFromMsg(pMsg));
|
||||||
|
|
||||||
// in case there is no vnode(no db in vnode)
|
// in case there is no vnode(no db in vnode)
|
||||||
if (pMsg->expected == 0) {
|
if (pMsg->expected == 0) {
|
||||||
SSdbRow row = {
|
SSdbRow row = {
|
||||||
|
@ -1099,8 +1101,6 @@ static int32_t mnodeAlterDbFp(SMnodeMsg *pMsg) {
|
||||||
|
|
||||||
return sdbUpdateRow(&row);
|
return sdbUpdateRow(&row);
|
||||||
}
|
}
|
||||||
mDebug("db:%s, all vgroups is altered", pDb->name);
|
|
||||||
mLInfo("db:%s, is alterd by %s", pDb->name, mnodeGetUserFromMsg(pMsg));
|
|
||||||
|
|
||||||
//bnNotify();
|
//bnNotify();
|
||||||
|
|
||||||
|
@ -1146,7 +1146,7 @@ static int32_t mnodeAlterDb(SDbObj *pDb, SAlterDbMsg *pAlter, void *pMsg) {
|
||||||
if (code != TSDB_CODE_SUCCESS && code != TSDB_CODE_MND_ACTION_IN_PROGRESS) {
|
if (code != TSDB_CODE_SUCCESS && code != TSDB_CODE_MND_ACTION_IN_PROGRESS) {
|
||||||
mError("db:%s, failed to alter, reason:%s", pDb->name, tstrerror(code));
|
mError("db:%s, failed to alter, reason:%s", pDb->name, tstrerror(code));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue