提交 1414e2ee 编写于 作者: S slguan

[TBASE-1221]

上级 862e8ee0
...@@ -594,7 +594,12 @@ typedef struct { ...@@ -594,7 +594,12 @@ typedef struct {
// NOTE: sizeof(SVnodeCfg) < TSDB_FILE_HEADER_LEN/4 // NOTE: sizeof(SVnodeCfg) < TSDB_FILE_HEADER_LEN/4
typedef struct { typedef struct {
char acct[TSDB_USER_LEN]; char acct[TSDB_USER_LEN];
char db[TSDB_METER_ID_LEN+2]; // 8bytes align /*
* the message is too large, so it may will overwrite the cfg information in meterobj.v*
* recover to origin codes
*/
//char db[TSDB_METER_ID_LEN+2]; // 8bytes align
char db[TSDB_DB_NAME_LEN];
uint32_t vgId; uint32_t vgId;
int32_t maxSessions; int32_t maxSessions;
int32_t cacheBlockSize; int32_t cacheBlockSize;
......
...@@ -112,7 +112,7 @@ FILE *vnodeOpenMeterObjFile(int vnode) { ...@@ -112,7 +112,7 @@ FILE *vnodeOpenMeterObjFile(int vnode) {
fp = fopen(fileName, "r+"); fp = fopen(fileName, "r+");
if (fp != NULL) { if (fp != NULL) {
if (vnodeCheckFileIntegrity(fp) < 0) { if (vnodeCheckFileIntegrity(fp) < 0) {
dError("file:%s is corrupted, need to restore it first", fileName); dError("file:%s is corrupted, need to restore it first, exit program", fileName);
fclose(fp); fclose(fp);
// todo: how to recover // todo: how to recover
...@@ -376,7 +376,11 @@ int vnodeOpenMetersVnode(int vnode) { ...@@ -376,7 +376,11 @@ int vnodeOpenMetersVnode(int vnode) {
fseek(fp, TSDB_FILE_HEADER_LEN * 2 / 4, SEEK_SET); fseek(fp, TSDB_FILE_HEADER_LEN * 2 / 4, SEEK_SET);
fread(&pVnode->cfg, sizeof(SVnodeCfg), 1, fp); fread(&pVnode->cfg, sizeof(SVnodeCfg), 1, fp);
if (vnodeIsValidVnodeCfg(&pVnode->cfg) == false) { if (vnodeIsValidVnodeCfg(&pVnode->cfg) == false) {
dError("vid:%d, maxSessions:%d cacheBlockSize:%d replications:%d daysPerFile:%d daysToKeep:%d invalid, clear it",
vnode, pVnode->cfg.maxSessions, pVnode->cfg.cacheBlockSize, pVnode->cfg.replications,
pVnode->cfg.daysPerFile, pVnode->cfg.daysToKeep);
pVnode->cfg.maxSessions = 0; // error in vnode file pVnode->cfg.maxSessions = 0; // error in vnode file
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册