[TBASE-1221]
This commit is contained in:
parent
862e8ee00b
commit
1414e2ee10
|
@ -594,7 +594,12 @@ typedef struct {
|
|||
// NOTE: sizeof(SVnodeCfg) < TSDB_FILE_HEADER_LEN/4
|
||||
typedef struct {
|
||||
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;
|
||||
int32_t maxSessions;
|
||||
int32_t cacheBlockSize;
|
||||
|
|
|
@ -112,7 +112,7 @@ FILE *vnodeOpenMeterObjFile(int vnode) {
|
|||
fp = fopen(fileName, "r+");
|
||||
if (fp != NULL) {
|
||||
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);
|
||||
|
||||
// todo: how to recover
|
||||
|
@ -376,7 +376,11 @@ int vnodeOpenMetersVnode(int vnode) {
|
|||
|
||||
fseek(fp, TSDB_FILE_HEADER_LEN * 2 / 4, SEEK_SET);
|
||||
fread(&pVnode->cfg, sizeof(SVnodeCfg), 1, fp);
|
||||
|
||||
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
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue