提交 aba0e02d 编写于 作者: S Shengliang Guan

TD-2111

上级 79cf4d60
...@@ -327,5 +327,5 @@ static void taosStopPoolThread(SThreadObj *pThread) { ...@@ -327,5 +327,5 @@ static void taosStopPoolThread(SThreadObj *pThread) {
} }
pthread_join(thread, NULL); pthread_join(thread, NULL);
if (fd >= 0) taosClose(fd); taosClose(fd);
} }
...@@ -58,7 +58,7 @@ typedef struct { ...@@ -58,7 +58,7 @@ typedef struct {
char *rootDir; char *rootDir;
tsem_t sem; tsem_t sem;
int8_t dropped; int8_t dropped;
char db[TSDB_DB_NAME_LEN]; char db[TSDB_ACCT_LEN + TSDB_DB_NAME_LEN];
} SVnodeObj; } SVnodeObj;
void vnodeInitWriteFp(void); void vnodeInitWriteFp(void);
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include "vnodeCfg.h" #include "vnodeCfg.h"
static void vnodeLoadCfg(SVnodeObj *pVnode, SCreateVnodeMsg* vnodeMsg) { static void vnodeLoadCfg(SVnodeObj *pVnode, SCreateVnodeMsg* vnodeMsg) {
strcpy(pVnode->db, vnodeMsg->db); tstrncpy(pVnode->db, vnodeMsg->db, sizeof(pVnode->db));
pVnode->cfgVersion = vnodeMsg->cfg.cfgVersion; pVnode->cfgVersion = vnodeMsg->cfg.cfgVersion;
pVnode->tsdbCfg.cacheBlockSize = vnodeMsg->cfg.cacheBlockSize; pVnode->tsdbCfg.cacheBlockSize = vnodeMsg->cfg.cacheBlockSize;
pVnode->tsdbCfg.totalBlocks = vnodeMsg->cfg.totalBlocks; pVnode->tsdbCfg.totalBlocks = vnodeMsg->cfg.totalBlocks;
...@@ -97,7 +97,7 @@ int32_t vnodeReadCfg(SVnodeObj *pVnode) { ...@@ -97,7 +97,7 @@ int32_t vnodeReadCfg(SVnodeObj *pVnode) {
vError("vgId:%d, failed to read %s, db not found", pVnode->vgId, file); vError("vgId:%d, failed to read %s, db not found", pVnode->vgId, file);
goto PARSE_VCFG_ERROR; goto PARSE_VCFG_ERROR;
} }
strcpy(vnodeMsg.db, db->valuestring); tstrncpy(vnodeMsg.db, db->valuestring, sizeof(vnodeMsg.db));
cJSON *cfgVersion = cJSON_GetObjectItem(root, "cfgVersion"); cJSON *cfgVersion = cJSON_GetObjectItem(root, "cfgVersion");
if (!cfgVersion || cfgVersion->type != cJSON_Number) { if (!cfgVersion || cfgVersion->type != cJSON_Number) {
......
...@@ -37,7 +37,7 @@ extern int32_t wDebugFlag; ...@@ -37,7 +37,7 @@ extern int32_t wDebugFlag;
#define WAL_MAX_SIZE (TSDB_MAX_WAL_SIZE + sizeof(SWalHead) + 16) #define WAL_MAX_SIZE (TSDB_MAX_WAL_SIZE + sizeof(SWalHead) + 16)
#define WAL_SIGNATURE ((uint32_t)(0xFAFBFDFE)) #define WAL_SIGNATURE ((uint32_t)(0xFAFBFDFE))
#define WAL_PATH_LEN (TSDB_FILENAME_LEN + 12) #define WAL_PATH_LEN (TSDB_FILENAME_LEN + 12)
#define WAL_FILE_LEN (TSDB_FILENAME_LEN + 32) #define WAL_FILE_LEN (WAL_PATH_LEN + 32)
#define WAL_FILE_NUM 3 #define WAL_FILE_NUM 3
typedef struct { typedef struct {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册