add table name to tsdb log
This commit is contained in:
parent
4e6b6ec0c1
commit
f617394f4d
|
@ -841,8 +841,8 @@ static int32_t tdInsertRowToTable(STsdbRepo *pRepo, SDataRow row, STable *pTable
|
|||
|
||||
pTable->mem->numOfPoints = tSkipListGetSize(pTable->mem->pData);
|
||||
|
||||
tsdbTrace("vgId:%d, tid:%d, uid:%" PRId64 ", a row is inserted to table! key:%" PRId64,
|
||||
pRepo->config.tsdbId, pTable->tableId.tid, pTable->tableId.uid, dataRowKey(row));
|
||||
tsdbTrace("vgId:%d, tid:%d, uid:%" PRId64 ", table:%s a row is inserted to table! key:%" PRId64, pRepo->config.tsdbId,
|
||||
pTable->tableId.tid, pTable->tableId.uid, varDataVal(pTable->name), dataRowKey(row));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -867,9 +867,9 @@ static int32_t tsdbInsertDataToTable(TsdbRepoT *repo, SSubmitBlk *pBlock, TSKEY
|
|||
tsdbInitSubmitBlkIter(pBlock, &blkIter);
|
||||
while ((row = tsdbGetSubmitBlkNext(&blkIter)) != NULL) {
|
||||
if (dataRowKey(row) < minKey || dataRowKey(row) > maxKey) {
|
||||
tsdbError("vgId:%d, table tid:%d, talbe uid:%ld timestamp is out of range. now:" PRId64 ", maxKey:" PRId64
|
||||
tsdbError("vgId:%d, table:%s, tid:%d, talbe uid:%ld timestamp is out of range. now:" PRId64 ", maxKey:" PRId64
|
||||
", minKey:" PRId64,
|
||||
pRepo->config.tsdbId, pTable->tableId.tid, pTable->tableId.uid, now, minKey, maxKey);
|
||||
pRepo->config.tsdbId, varDataVal(pTable->name), pTable->tableId.tid, pTable->tableId.uid, now, minKey, maxKey);
|
||||
return TSDB_CODE_TIMESTAMP_OUT_OF_RANGE;
|
||||
}
|
||||
|
||||
|
|
|
@ -310,7 +310,7 @@ int tsdbCreateTable(TsdbRepoT *repo, STableCfg *pCfg) {
|
|||
|
||||
// todo refactor extract method
|
||||
size_t size = strnlen(pCfg->sname, TSDB_TABLE_NAME_LEN);
|
||||
super->name = malloc(size + VARSTR_HEADER_SIZE);
|
||||
super->name = calloc(1, size + VARSTR_HEADER_SIZE + 1);
|
||||
STR_WITH_SIZE_TO_VARSTR(super->name, pCfg->sname, size);
|
||||
|
||||
// index the first tag column
|
||||
|
@ -339,7 +339,7 @@ int tsdbCreateTable(TsdbRepoT *repo, STableCfg *pCfg) {
|
|||
table->tableId = pCfg->tableId;
|
||||
|
||||
size_t size = strnlen(pCfg->name, TSDB_TABLE_NAME_LEN);
|
||||
table->name = malloc(size + VARSTR_HEADER_SIZE);
|
||||
table->name = calloc(1, size + VARSTR_HEADER_SIZE + 1);
|
||||
STR_WITH_SIZE_TO_VARSTR(table->name, pCfg->name, size);
|
||||
|
||||
table->lastKey = 0;
|
||||
|
@ -356,12 +356,12 @@ int tsdbCreateTable(TsdbRepoT *repo, STableCfg *pCfg) {
|
|||
// Register to meta
|
||||
if (newSuper) {
|
||||
tsdbAddTableToMeta(pMeta, super, true);
|
||||
tsdbTrace("vgId:%d, super table is created! uid:%" PRId64, pRepo->config.tsdbId,
|
||||
tsdbTrace("vgId:%d, super table %s is created! uid:%" PRId64, pRepo->config.tsdbId, varDataVal(super->name),
|
||||
super->tableId.uid);
|
||||
}
|
||||
tsdbAddTableToMeta(pMeta, table, true);
|
||||
tsdbTrace("vgId:%d, table is created! tid:%d, uid:%" PRId64, pRepo->config.tsdbId, table->tableId.tid,
|
||||
table->tableId.uid);
|
||||
tsdbTrace("vgId:%d, table %s is created! tid:%d, uid:%" PRId64, pRepo->config.tsdbId, varDataVal(table->name),
|
||||
table->tableId.tid, table->tableId.uid);
|
||||
|
||||
// Write to meta file
|
||||
int bufLen = 0;
|
||||
|
@ -409,7 +409,8 @@ int tsdbDropTable(TsdbRepoT *repo, STableId tableId) {
|
|||
return -1;
|
||||
}
|
||||
|
||||
tsdbTrace("vgId:%d, table is dropped! tid:%d, uid:%" PRId64, pRepo->config.tsdbId, tableId.tid, tableId.uid);
|
||||
tsdbTrace("vgId:%d, table %s is dropped! tid:%d, uid:%" PRId64, pRepo->config.tsdbId, varDataVal(pTable->name),
|
||||
tableId.tid, tableId.uid);
|
||||
if (tsdbRemoveTableFromMeta(pMeta, pTable) < 0) return -1;
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue