opti: get meta logic for schemaless
This commit is contained in:
parent
c79c2a19c4
commit
e07823c55a
|
@ -467,6 +467,13 @@ static int32_t smlModifyDBSchemas(SSmlHandle *info) {
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
info->cost.numOfCreateSTables++;
|
info->cost.numOfCreateSTables++;
|
||||||
|
taosMemoryFreeClear(pTableMeta);
|
||||||
|
|
||||||
|
code = catalogGetSTableMeta(info->pCatalog, &conn, &pName, &pTableMeta);
|
||||||
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
|
uError("SML:0x%" PRIx64 " catalogGetSTableMeta failed. super table name %s", info->id, pName.tname);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
} else if (code == TSDB_CODE_SUCCESS) {
|
} else if (code == TSDB_CODE_SUCCESS) {
|
||||||
hashTmp = taosHashInit(pTableMeta->tableInfo.numOfTags, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true,
|
hashTmp = taosHashInit(pTableMeta->tableInfo.numOfTags, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true,
|
||||||
HASH_NO_LOCK);
|
HASH_NO_LOCK);
|
||||||
|
@ -505,16 +512,16 @@ static int32_t smlModifyDBSchemas(SSmlHandle *info) {
|
||||||
uError("SML:0x%" PRIx64 " smlSendMetaMsg failed. can not create %s", info->id, pName.tname);
|
uError("SML:0x%" PRIx64 " smlSendMetaMsg failed. can not create %s", info->id, pName.tname);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
taosMemoryFreeClear(pTableMeta);
|
taosMemoryFreeClear(pTableMeta);
|
||||||
code = catalogRefreshTableMeta(info->pCatalog, &conn, &pName, -1);
|
code = catalogRefreshTableMeta(info->pCatalog, &conn, &pName, -1);
|
||||||
if (code != TSDB_CODE_SUCCESS) {
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
code = catalogGetSTableMeta(info->pCatalog, &conn, &pName, &pTableMeta);
|
code = catalogGetSTableMeta(info->pCatalog, &conn, &pName, &pTableMeta);
|
||||||
if (code != TSDB_CODE_SUCCESS) {
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
goto end;
|
goto end;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
taosHashClear(hashTmp);
|
taosHashClear(hashTmp);
|
||||||
|
@ -552,12 +559,13 @@ static int32_t smlModifyDBSchemas(SSmlHandle *info) {
|
||||||
uError("SML:0x%" PRIx64 " smlSendMetaMsg failed. can not create %s", info->id, pName.tname);
|
uError("SML:0x%" PRIx64 " smlSendMetaMsg failed. can not create %s", info->id, pName.tname);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
code = catalogRefreshTableMeta(info->pCatalog, &conn, &pName, -1);
|
||||||
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
code = catalogRefreshTableMeta(info->pCatalog, &conn, &pName, -1);
|
|
||||||
if (code != TSDB_CODE_SUCCESS) {
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
needCheckMeta = true;
|
needCheckMeta = true;
|
||||||
taosHashCleanup(hashTmp);
|
taosHashCleanup(hashTmp);
|
||||||
hashTmp = NULL;
|
hashTmp = NULL;
|
||||||
|
@ -565,13 +573,6 @@ static int32_t smlModifyDBSchemas(SSmlHandle *info) {
|
||||||
uError("SML:0x%" PRIx64 " load table meta error: %s", info->id, tstrerror(code));
|
uError("SML:0x%" PRIx64 " load table meta error: %s", info->id, tstrerror(code));
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
taosMemoryFreeClear(pTableMeta);
|
|
||||||
|
|
||||||
code = catalogGetSTableMeta(info->pCatalog, &conn, &pName, &pTableMeta);
|
|
||||||
if (code != TSDB_CODE_SUCCESS) {
|
|
||||||
uError("SML:0x%" PRIx64 " catalogGetSTableMeta failed. super table name %s", info->id, pName.tname);
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (needCheckMeta) {
|
if (needCheckMeta) {
|
||||||
code = smlCheckMeta(&(pTableMeta->schema[pTableMeta->tableInfo.numOfColumns]), pTableMeta->tableInfo.numOfTags,
|
code = smlCheckMeta(&(pTableMeta->schema[pTableMeta->tableInfo.numOfColumns]), pTableMeta->tableInfo.numOfTags,
|
||||||
|
@ -596,7 +597,7 @@ static int32_t smlModifyDBSchemas(SSmlHandle *info) {
|
||||||
end:
|
end:
|
||||||
taosHashCleanup(hashTmp);
|
taosHashCleanup(hashTmp);
|
||||||
taosMemoryFreeClear(pTableMeta);
|
taosMemoryFreeClear(pTableMeta);
|
||||||
catalogRefreshTableMeta(info->pCatalog, &conn, &pName, 1);
|
// catalogRefreshTableMeta(info->pCatalog, &conn, &pName, 1);
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue