fix crash while drop databases

This commit is contained in:
slguan 2020-04-08 23:27:10 +08:00
parent 3e1811b0e6
commit 8f54cb6768
2 changed files with 4 additions and 4 deletions

View File

@ -36,7 +36,7 @@ static int vnodeWALCallback(void *arg);
static int32_t vnodeSaveCfg(SMDCreateVnodeMsg *pVnodeCfg);
static int32_t vnodeReadCfg(SVnodeObj *pVnode);
static int tsOpennedVnodes;
static int32_t tsOpennedVnodes;
static pthread_once_t vnodeModuleInit = PTHREAD_ONCE_INIT;
static void vnodeInit() {
@ -104,8 +104,7 @@ int32_t vnodeCreate(SMDCreateVnodeMsg *pVnodeCfg) {
}
int32_t vnodeDrop(int32_t vgId) {
SVnodeObj *pVnode = (SVnodeObj *) taosGetIntHashData(tsDnodeVnodesHash, vgId);
SVnodeObj *pVnode = *(SVnodeObj **)taosGetIntHashData(tsDnodeVnodesHash, vgId);
if (pVnode == NULL) {
dTrace("vgId:%d, failed to drop, vgId not exist", vgId);
return TSDB_CODE_INVALID_VGROUP_ID;

View File

@ -80,7 +80,8 @@ void *walOpen(char *path, int max, int level) {
}
void walClose(void *handle) {
if (handle == NULL) return;
SWal *pWal = (SWal *)handle;
close(pWal->fd);