Revert "refact: adjust some assert cases"
This commit is contained in:
parent
297ba7f7d4
commit
6d94afe48f
|
@ -112,10 +112,10 @@ static FORCE_INLINE bool colDataIsNull(const SColumnInfoData* pColumnInfoData, u
|
|||
|
||||
if (pColAgg != NULL) {
|
||||
if (pColAgg->numOfNull == totalRows) {
|
||||
tAssert(pColumnInfoData->nullbitmap == NULL);
|
||||
ASSERT(pColumnInfoData->nullbitmap == NULL);
|
||||
return true;
|
||||
} else if (pColAgg->numOfNull == 0) {
|
||||
tAssert(pColumnInfoData->nullbitmap == NULL);
|
||||
ASSERT(pColumnInfoData->nullbitmap == NULL);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -157,40 +157,40 @@ static FORCE_INLINE void colDataAppendNNULL(SColumnInfoData* pColumnInfoData, ui
|
|||
}
|
||||
|
||||
static FORCE_INLINE void colDataAppendInt8(SColumnInfoData* pColumnInfoData, uint32_t currentRow, int8_t* v) {
|
||||
tAssert(pColumnInfoData->info.type == TSDB_DATA_TYPE_TINYINT ||
|
||||
ASSERT(pColumnInfoData->info.type == TSDB_DATA_TYPE_TINYINT ||
|
||||
pColumnInfoData->info.type == TSDB_DATA_TYPE_UTINYINT || pColumnInfoData->info.type == TSDB_DATA_TYPE_BOOL);
|
||||
char* p = pColumnInfoData->pData + pColumnInfoData->info.bytes * currentRow;
|
||||
*(int8_t*)p = *(int8_t*)v;
|
||||
}
|
||||
|
||||
static FORCE_INLINE void colDataAppendInt16(SColumnInfoData* pColumnInfoData, uint32_t currentRow, int16_t* v) {
|
||||
tAssert(pColumnInfoData->info.type == TSDB_DATA_TYPE_SMALLINT ||
|
||||
ASSERT(pColumnInfoData->info.type == TSDB_DATA_TYPE_SMALLINT ||
|
||||
pColumnInfoData->info.type == TSDB_DATA_TYPE_USMALLINT);
|
||||
char* p = pColumnInfoData->pData + pColumnInfoData->info.bytes * currentRow;
|
||||
*(int16_t*)p = *(int16_t*)v;
|
||||
}
|
||||
|
||||
static FORCE_INLINE void colDataAppendInt32(SColumnInfoData* pColumnInfoData, uint32_t currentRow, int32_t* v) {
|
||||
tAssert(pColumnInfoData->info.type == TSDB_DATA_TYPE_INT || pColumnInfoData->info.type == TSDB_DATA_TYPE_UINT);
|
||||
ASSERT(pColumnInfoData->info.type == TSDB_DATA_TYPE_INT || pColumnInfoData->info.type == TSDB_DATA_TYPE_UINT);
|
||||
char* p = pColumnInfoData->pData + pColumnInfoData->info.bytes * currentRow;
|
||||
*(int32_t*)p = *(int32_t*)v;
|
||||
}
|
||||
|
||||
static FORCE_INLINE void colDataAppendInt64(SColumnInfoData* pColumnInfoData, uint32_t currentRow, int64_t* v) {
|
||||
int32_t type = pColumnInfoData->info.type;
|
||||
tAssert(type == TSDB_DATA_TYPE_BIGINT || type == TSDB_DATA_TYPE_UBIGINT || type == TSDB_DATA_TYPE_TIMESTAMP);
|
||||
ASSERT(type == TSDB_DATA_TYPE_BIGINT || type == TSDB_DATA_TYPE_UBIGINT || type == TSDB_DATA_TYPE_TIMESTAMP);
|
||||
char* p = pColumnInfoData->pData + pColumnInfoData->info.bytes * currentRow;
|
||||
*(int64_t*)p = *(int64_t*)v;
|
||||
}
|
||||
|
||||
static FORCE_INLINE void colDataAppendFloat(SColumnInfoData* pColumnInfoData, uint32_t currentRow, float* v) {
|
||||
tAssert(pColumnInfoData->info.type == TSDB_DATA_TYPE_FLOAT);
|
||||
ASSERT(pColumnInfoData->info.type == TSDB_DATA_TYPE_FLOAT);
|
||||
char* p = pColumnInfoData->pData + pColumnInfoData->info.bytes * currentRow;
|
||||
*(float*)p = *(float*)v;
|
||||
}
|
||||
|
||||
static FORCE_INLINE void colDataAppendDouble(SColumnInfoData* pColumnInfoData, uint32_t currentRow, double* v) {
|
||||
tAssert(pColumnInfoData->info.type == TSDB_DATA_TYPE_DOUBLE);
|
||||
ASSERT(pColumnInfoData->info.type == TSDB_DATA_TYPE_DOUBLE);
|
||||
char* p = pColumnInfoData->pData + pColumnInfoData->info.bytes * currentRow;
|
||||
*(double*)p = *(double*)v;
|
||||
}
|
||||
|
|
|
@ -214,7 +214,7 @@ static FORCE_INLINE SKvRowIdx *tdKvRowColIdxAt(STSRow *pRow, col_id_t idx) {
|
|||
}
|
||||
|
||||
static FORCE_INLINE int16_t tdKvRowColIdAt(STSRow *pRow, col_id_t idx) {
|
||||
tAssert(idx >= 0);
|
||||
ASSERT(idx >= 0);
|
||||
if (idx == 0) {
|
||||
return PRIMARYKEY_TIMESTAMP_COL_ID;
|
||||
}
|
||||
|
|
|
@ -90,8 +90,8 @@ typedef struct STbVerInfo {
|
|||
} STbVerInfo;
|
||||
|
||||
/*
|
||||
* tAssert(sizeof(SCTableMeta) == 24)
|
||||
* tAssert(tableType == TSDB_CHILD_TABLE)
|
||||
* ASSERT(sizeof(SCTableMeta) == 24)
|
||||
* ASSERT(tableType == TSDB_CHILD_TABLE)
|
||||
* The cached child table meta info. For each child table, 24 bytes are required to keep the essential table info.
|
||||
*/
|
||||
typedef struct SCTableMeta {
|
||||
|
|
|
@ -188,13 +188,13 @@ SStreamQueue* streamQueueOpen();
|
|||
void streamQueueClose(SStreamQueue* queue);
|
||||
|
||||
static FORCE_INLINE void streamQueueProcessSuccess(SStreamQueue* queue) {
|
||||
tAssert(atomic_load_8(&queue->status) == STREAM_QUEUE__PROCESSING);
|
||||
ASSERT(atomic_load_8(&queue->status) == STREAM_QUEUE__PROCESSING);
|
||||
queue->qItem = NULL;
|
||||
atomic_store_8(&queue->status, STREAM_QUEUE__SUCESS);
|
||||
}
|
||||
|
||||
static FORCE_INLINE void streamQueueProcessFail(SStreamQueue* queue) {
|
||||
tAssert(atomic_load_8(&queue->status) == STREAM_QUEUE__PROCESSING);
|
||||
ASSERT(atomic_load_8(&queue->status) == STREAM_QUEUE__PROCESSING);
|
||||
atomic_store_8(&queue->status, STREAM_QUEUE__FAILED);
|
||||
}
|
||||
|
||||
|
@ -206,7 +206,7 @@ static FORCE_INLINE void* streamQueueCurItem(SStreamQueue* queue) {
|
|||
static FORCE_INLINE void* streamQueueNextItem(SStreamQueue* queue) {
|
||||
int8_t dequeueFlag = atomic_exchange_8(&queue->status, STREAM_QUEUE__PROCESSING);
|
||||
if (dequeueFlag == STREAM_QUEUE__FAILED) {
|
||||
tAssert(queue->qItem != NULL);
|
||||
ASSERT(queue->qItem != NULL);
|
||||
return streamQueueCurItem(queue);
|
||||
} else {
|
||||
queue->qItem = NULL;
|
||||
|
|
|
@ -27,7 +27,6 @@ extern "C" {
|
|||
|
||||
#if !defined(WINDOWS)
|
||||
#include <dirent.h>
|
||||
#include <execinfo.h>
|
||||
#include <libgen.h>
|
||||
#include <sched.h>
|
||||
#include <unistd.h>
|
||||
|
|
|
@ -120,6 +120,12 @@ void syslog(int unused, const char *format, ...);
|
|||
#define POINTER_SHIFT(p, b) ((void *)((char *)(p) + (b)))
|
||||
#define POINTER_DISTANCE(p1, p2) ((char *)(p1) - (char *)(p2))
|
||||
|
||||
#ifndef NDEBUG
|
||||
#define ASSERT(x) assert(x)
|
||||
#else
|
||||
#define ASSERT(x)
|
||||
#endif
|
||||
|
||||
#ifndef UNUSED
|
||||
#define UNUSED(x) ((void)(x))
|
||||
#endif
|
||||
|
|
|
@ -62,7 +62,7 @@ typedef int32_t TdUcs4;
|
|||
int32_t taosUcs4len(TdUcs4 *ucs4);
|
||||
int64_t taosStr2int64(const char *str);
|
||||
|
||||
int32_t taosConvInit();
|
||||
void taosConvInit(void);
|
||||
void taosConvDestroy();
|
||||
int32_t taosUcs4ToMbs(TdUcs4 *ucs4, int32_t ucs4_max_len, char *mbs);
|
||||
bool taosMbsToUcs4(const char *mbs, size_t mbs_len, TdUcs4 *ucs4, int32_t ucs4_max_len, int32_t *len);
|
||||
|
|
|
@ -46,26 +46,6 @@ void taosSetTerminalMode();
|
|||
int32_t taosGetOldTerminalMode();
|
||||
void taosResetTerminalMode();
|
||||
|
||||
#if !defined(WINDOWS)
|
||||
#define taosPrintTrace(flags, level, dflag) \
|
||||
{ \
|
||||
void* array[100]; \
|
||||
int32_t size = backtrace(array, 100); \
|
||||
char** strings = backtrace_symbols(array, size); \
|
||||
if (strings != NULL) { \
|
||||
taosPrintLog(flags, level, dflag, "obtained %d stack frames", size); \
|
||||
for (int32_t i = 0; i < size; i++) { \
|
||||
taosPrintLog(flags, level, dflag, "frame:%d, %s", i, strings[i]); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
taosMemoryFree(strings); \
|
||||
}
|
||||
#else
|
||||
#define taosPrintTrace(flags, level, dflag) \
|
||||
{}
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -18,8 +18,6 @@
|
|||
|
||||
#include "os.h"
|
||||
|
||||
#include "tlog.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
@ -214,7 +212,7 @@ static FORCE_INLINE int32_t taosEncodeVariantU16(void **buf, uint16_t value) {
|
|||
if (buf != NULL) ((uint8_t *)(*buf))[i] = (uint8_t)(value | ENCODE_LIMIT);
|
||||
value >>= 7;
|
||||
i++;
|
||||
tAssert(i < 3);
|
||||
ASSERT(i < 3);
|
||||
}
|
||||
|
||||
if (buf != NULL) {
|
||||
|
@ -262,7 +260,7 @@ static FORCE_INLINE int32_t taosEncodeVariantU32(void **buf, uint32_t value) {
|
|||
if (buf != NULL) ((uint8_t *)(*buf))[i] = (value | ENCODE_LIMIT);
|
||||
value >>= 7;
|
||||
i++;
|
||||
tAssert(i < 5);
|
||||
ASSERT(i < 5);
|
||||
}
|
||||
|
||||
if (buf != NULL) {
|
||||
|
@ -310,7 +308,7 @@ static FORCE_INLINE int32_t taosEncodeVariantU64(void **buf, uint64_t value) {
|
|||
if (buf != NULL) ((uint8_t *)(*buf))[i] = (uint8_t)(value | ENCODE_LIMIT);
|
||||
value >>= 7;
|
||||
i++;
|
||||
tAssert(i < 10);
|
||||
ASSERT(i < 10);
|
||||
}
|
||||
|
||||
if (buf != NULL) {
|
||||
|
|
|
@ -38,7 +38,6 @@ typedef void (*LogFp)(int64_t ts, ELogLevel level, const char *content);
|
|||
|
||||
extern bool tsLogEmbedded;
|
||||
extern bool tsAsyncLog;
|
||||
extern bool tsAssert;
|
||||
extern int32_t tsNumOfLogLines;
|
||||
extern int32_t tsLogKeepDays;
|
||||
extern LogFp tsLogFp;
|
||||
|
@ -83,10 +82,6 @@ void taosPrintLongString(const char *flags, ELogLevel level, int32_t dflag, cons
|
|||
#endif
|
||||
;
|
||||
|
||||
bool taosAssertLog(bool condition, const char *file, int32_t line, const char *format, ...);
|
||||
#define tAssertS(condition, ...) taosAssertLog(condition, __FILE__, __LINE__, __VA_ARGS__)
|
||||
#define tAssert(condition) tAssertS(condition, "assert info not provided")
|
||||
|
||||
// clang-format off
|
||||
#define uFatal(...) { if (uDebugFlag & DEBUG_FATAL) { taosPrintLog("UTL FATAL", DEBUG_FATAL, tsLogEmbedded ? 255 : uDebugFlag, __VA_ARGS__); }}
|
||||
#define uError(...) { if (uDebugFlag & DEBUG_ERROR) { taosPrintLog("UTL ERROR ", DEBUG_ERROR, tsLogEmbedded ? 255 : uDebugFlag, __VA_ARGS__); }}
|
||||
|
|
|
@ -407,9 +407,7 @@ void taos_init_imp(void) {
|
|||
|
||||
initQueryModuleMsgHandle();
|
||||
|
||||
if (taosConvInit() != 0) {
|
||||
tAssertS(0, "failed to init conv");
|
||||
}
|
||||
taosConvInit();
|
||||
|
||||
rpcInit();
|
||||
|
||||
|
|
|
@ -376,7 +376,7 @@ int32_t hbBuildQueryDesc(SQueryHbReqBasic *hbBasic, STscObj *pObj) {
|
|||
desc.subPlanNum = 0;
|
||||
}
|
||||
desc.subPlanNum = taosArrayGetSize(desc.subDesc);
|
||||
tAssert(desc.subPlanNum == taosArrayGetSize(desc.subDesc));
|
||||
ASSERT(desc.subPlanNum == taosArrayGetSize(desc.subDesc));
|
||||
} else {
|
||||
desc.subDesc = NULL;
|
||||
}
|
||||
|
|
|
@ -446,7 +446,7 @@ int32_t getPlan(SRequestObj* pRequest, SQuery* pQuery, SQueryPlan** pPlan, SArra
|
|||
}
|
||||
|
||||
void setResSchemaInfo(SReqResultInfo* pResInfo, const SSchema* pSchema, int32_t numOfCols) {
|
||||
tAssert(pSchema != NULL && numOfCols > 0);
|
||||
ASSERT(pSchema != NULL && numOfCols > 0);
|
||||
|
||||
pResInfo->numOfCols = numOfCols;
|
||||
if (pResInfo->fields != NULL) {
|
||||
|
@ -457,7 +457,7 @@ void setResSchemaInfo(SReqResultInfo* pResInfo, const SSchema* pSchema, int32_t
|
|||
}
|
||||
pResInfo->fields = taosMemoryCalloc(numOfCols, sizeof(TAOS_FIELD));
|
||||
pResInfo->userFields = taosMemoryCalloc(numOfCols, sizeof(TAOS_FIELD));
|
||||
tAssert(numOfCols == pResInfo->numOfCols);
|
||||
ASSERT(numOfCols == pResInfo->numOfCols);
|
||||
|
||||
for (int32_t i = 0; i < pResInfo->numOfCols; ++i) {
|
||||
pResInfo->fields[i].bytes = pSchema[i].bytes;
|
||||
|
@ -1617,8 +1617,8 @@ static int32_t doConvertUCS4(SReqResultInfo* pResultInfo, int32_t numOfRows, int
|
|||
char* pStart = pCol->offset[j] + pCol->pData;
|
||||
|
||||
int32_t len = taosUcs4ToMbs((TdUcs4*)varDataVal(pStart), varDataLen(pStart), varDataVal(p));
|
||||
tAssert(len <= bytes);
|
||||
tAssert((p + len) < (pResultInfo->convertBuf[i] + colLength[i]));
|
||||
ASSERT(len <= bytes);
|
||||
ASSERT((p + len) < (pResultInfo->convertBuf[i] + colLength[i]));
|
||||
|
||||
varDataSetLen(p, len);
|
||||
pCol->offset[j] = (p - pResultInfo->convertBuf[i]);
|
||||
|
@ -1636,7 +1636,7 @@ static int32_t doConvertUCS4(SReqResultInfo* pResultInfo, int32_t numOfRows, int
|
|||
|
||||
int32_t getVersion1BlockMetaSize(const char* p, int32_t numOfCols) {
|
||||
int32_t cols = *(int32_t*)(p + sizeof(int32_t) * 3);
|
||||
tAssert(numOfCols == cols);
|
||||
ASSERT(numOfCols == cols);
|
||||
|
||||
return sizeof(int32_t) + sizeof(int32_t) + sizeof(int32_t) * 3 + sizeof(uint64_t) +
|
||||
numOfCols * (sizeof(int8_t) + sizeof(int32_t));
|
||||
|
@ -1679,7 +1679,7 @@ static int32_t estimateJsonLen(SReqResultInfo* pResultInfo, int32_t numOfCols, i
|
|||
} else if (jsonInnerType == TSDB_DATA_TYPE_BOOL) {
|
||||
len += (VARSTR_HEADER_SIZE + 5);
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
}
|
||||
} else if (IS_VAR_DATA_TYPE(pResultInfo->fields[i].type)) {
|
||||
|
@ -1739,7 +1739,7 @@ static int32_t doConvertJson(SReqResultInfo* pResultInfo, int32_t numOfCols, int
|
|||
for (int32_t i = 0; i < numOfCols; ++i) {
|
||||
int32_t colLen = htonl(colLength[i]);
|
||||
int32_t colLen1 = htonl(colLength1[i]);
|
||||
tAssert(colLen < dataLen);
|
||||
ASSERT(colLen < dataLen);
|
||||
|
||||
if (pResultInfo->fields[i].type == TSDB_DATA_TYPE_JSON) {
|
||||
int32_t* offset = (int32_t*)pStart;
|
||||
|
@ -1785,7 +1785,7 @@ static int32_t doConvertJson(SReqResultInfo* pResultInfo, int32_t numOfCols, int
|
|||
sprintf(varDataVal(dst), "%s", (*((char*)jsonInnerData) == 1) ? "true" : "false");
|
||||
varDataSetLen(dst, strlen(varDataVal(dst)));
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
offset1[j] = len;
|
||||
|
@ -1852,7 +1852,7 @@ int32_t setResultDataPtr(SReqResultInfo* pResultInfo, TAOS_FIELD* pFields, int32
|
|||
int32_t cols = *(int32_t*)p;
|
||||
p += sizeof(int32_t);
|
||||
|
||||
tAssert(rows == numOfRows && cols == numOfCols);
|
||||
ASSERT(rows == numOfRows && cols == numOfCols);
|
||||
|
||||
int32_t hasColumnSeg = *(int32_t*)p;
|
||||
p += sizeof(int32_t);
|
||||
|
@ -1868,7 +1868,7 @@ int32_t setResultDataPtr(SReqResultInfo* pResultInfo, TAOS_FIELD* pFields, int32
|
|||
int32_t bytes = *(int32_t*)p;
|
||||
p += sizeof(int32_t);
|
||||
|
||||
/*tAssert(type == pFields[i].type && bytes == pFields[i].bytes);*/
|
||||
/*ASSERT(type == pFields[i].type && bytes == pFields[i].bytes);*/
|
||||
}
|
||||
|
||||
int32_t* colLength = (int32_t*)p;
|
||||
|
@ -1879,7 +1879,7 @@ int32_t setResultDataPtr(SReqResultInfo* pResultInfo, TAOS_FIELD* pFields, int32
|
|||
colLength[i] = htonl(colLength[i]);
|
||||
if (colLength[i] >= dataLen) {
|
||||
tscError("invalid colLength %d, dataLen %d", colLength[i], dataLen);
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
if (IS_VAR_DATA_TYPE(pResultInfo->fields[i].type)) {
|
||||
|
|
|
@ -575,7 +575,7 @@ int taos_fetch_block_s(TAOS_RES *res, int *numOfRows, TAOS_ROW *rows) {
|
|||
(*numOfRows) = pResultInfo->numOfRows;
|
||||
return 0;
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
@ -982,8 +982,8 @@ static void fetchCallback(void *pResult, void *param, int32_t code) {
|
|||
}
|
||||
|
||||
void taos_fetch_rows_a(TAOS_RES *res, __taos_async_fn_t fp, void *param) {
|
||||
tAssert(res != NULL && fp != NULL);
|
||||
tAssert(TD_RES_QUERY(res));
|
||||
ASSERT(res != NULL && fp != NULL);
|
||||
ASSERT(TD_RES_QUERY(res));
|
||||
|
||||
SRequestObj *pRequest = res;
|
||||
pRequest->body.fetchFp = fp;
|
||||
|
@ -1026,8 +1026,8 @@ void taos_fetch_rows_a(TAOS_RES *res, __taos_async_fn_t fp, void *param) {
|
|||
}
|
||||
|
||||
void taos_fetch_raw_block_a(TAOS_RES *res, __taos_async_fn_t fp, void *param) {
|
||||
tAssert(res != NULL && fp != NULL);
|
||||
tAssert(TD_RES_QUERY(res));
|
||||
ASSERT(res != NULL && fp != NULL);
|
||||
ASSERT(TD_RES_QUERY(res));
|
||||
|
||||
SRequestObj *pRequest = res;
|
||||
SReqResultInfo *pResultInfo = &pRequest->body.resInfo;
|
||||
|
@ -1040,8 +1040,8 @@ void taos_fetch_raw_block_a(TAOS_RES *res, __taos_async_fn_t fp, void *param) {
|
|||
}
|
||||
|
||||
const void *taos_get_raw_block(TAOS_RES *res) {
|
||||
tAssert(res != NULL);
|
||||
tAssert(TD_RES_QUERY(res));
|
||||
ASSERT(res != NULL);
|
||||
ASSERT(TD_RES_QUERY(res));
|
||||
SRequestObj *pRequest = res;
|
||||
|
||||
return pRequest->body.resInfo.pData;
|
||||
|
|
|
@ -454,7 +454,7 @@ static int32_t buildShowVariablesRsp(SArray* pVars, SRetrieveTableRsp** pRsp) {
|
|||
(*pRsp)->numOfCols = htonl(SHOW_VARIABLES_RESULT_COLS);
|
||||
|
||||
int32_t len = blockEncode(pBlock, (*pRsp)->data, SHOW_VARIABLES_RESULT_COLS);
|
||||
tAssert(len == rspSize - sizeof(SRetrieveTableRsp));
|
||||
ASSERT(len == rspSize - sizeof(SRetrieveTableRsp));
|
||||
|
||||
blockDataDestroy(pBlock);
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
|
|
@ -373,7 +373,7 @@ _exit:
|
|||
}
|
||||
|
||||
static char* processAutoCreateTable(STaosxRsp* rsp) {
|
||||
tAssert(rsp->createTableNum != 0);
|
||||
ASSERT(rsp->createTableNum != 0);
|
||||
|
||||
SDecoder* decoder = taosMemoryCalloc(rsp->createTableNum, sizeof(SDecoder));
|
||||
SVCreateTbReq* pCreateReq = taosMemoryCalloc(rsp->createTableNum, sizeof(SVCreateTbReq));
|
||||
|
@ -389,7 +389,7 @@ static char* processAutoCreateTable(STaosxRsp* rsp) {
|
|||
goto _exit;
|
||||
}
|
||||
|
||||
tAssert(pCreateReq[iReq].type == TSDB_CHILD_TABLE);
|
||||
ASSERT(pCreateReq[iReq].type == TSDB_CHILD_TABLE);
|
||||
}
|
||||
string = buildCreateCTableJson(pCreateReq, rsp->createTableNum);
|
||||
|
||||
|
@ -494,7 +494,7 @@ static char* processAlterTable(SMqMetaRsp* metaRsp) {
|
|||
char* buf = NULL;
|
||||
|
||||
if (vAlterTbReq.tagType == TSDB_DATA_TYPE_JSON) {
|
||||
tAssert(tTagIsJson(vAlterTbReq.pTagVal) == true);
|
||||
ASSERT(tTagIsJson(vAlterTbReq.pTagVal) == true);
|
||||
buf = parseTagDatatoJson(vAlterTbReq.pTagVal);
|
||||
} else {
|
||||
buf = taosMemoryCalloc(vAlterTbReq.nTagVal + 1, 1);
|
||||
|
@ -1750,7 +1750,7 @@ static int32_t tmqWriteRawDataImpl(TAOS* taos, void* data, int32_t dataLen) {
|
|||
}
|
||||
|
||||
// pSW->pSchema should be same as pTableMeta->schema
|
||||
// tAssert(pSW->nCols == pTableMeta->tableInfo.numOfColumns);
|
||||
// ASSERT(pSW->nCols == pTableMeta->tableInfo.numOfColumns);
|
||||
uint64_t suid = (TSDB_NORMAL_TABLE == pTableMeta->tableType ? 0 : pTableMeta->suid);
|
||||
uint64_t uid = pTableMeta->uid;
|
||||
int16_t sver = pTableMeta->sversion;
|
||||
|
@ -1975,7 +1975,7 @@ static int32_t tmqWriteRawMetaDataImpl(TAOS* taos, void* data, int32_t dataLen)
|
|||
goto end;
|
||||
}
|
||||
|
||||
tAssert(pCreateReq.type == TSDB_CHILD_TABLE);
|
||||
ASSERT(pCreateReq.type == TSDB_CHILD_TABLE);
|
||||
if (strcmp(tbName, pCreateReq.name) == 0) {
|
||||
schemaLen = *lenTmp;
|
||||
schemaData = *dataTmp;
|
||||
|
@ -2053,7 +2053,7 @@ static int32_t tmqWriteRawMetaDataImpl(TAOS* taos, void* data, int32_t dataLen)
|
|||
}
|
||||
|
||||
// pSW->pSchema should be same as pTableMeta->schema
|
||||
// tAssert(pSW->nCols == pTableMeta->tableInfo.numOfColumns);
|
||||
// ASSERT(pSW->nCols == pTableMeta->tableInfo.numOfColumns);
|
||||
uint64_t suid = (TSDB_NORMAL_TABLE == pTableMeta->tableType ? 0 : pTableMeta->suid);
|
||||
uint64_t uid = pTableMeta->uid;
|
||||
int16_t sver = pTableMeta->sversion;
|
||||
|
|
|
@ -785,7 +785,7 @@ static int64_t smlGetTimeValue(const char *value, int32_t len, int8_t type) {
|
|||
case TSDB_TIME_PRECISION_NANO:
|
||||
break;
|
||||
default:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
if (ts >= (double)INT64_MAX || ts < 0) {
|
||||
return -1;
|
||||
|
@ -873,7 +873,7 @@ static int32_t smlParseTS(SSmlHandle *info, const char *data, int32_t len, SArra
|
|||
} else if (info->protocol == TSDB_SML_TELNET_PROTOCOL) {
|
||||
ts = smlParseOpenTsdbTime(info, data, len);
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
uDebug("SML:0x%" PRIx64 " smlParseTS:%" PRId64, info->id, ts);
|
||||
|
||||
|
@ -1287,7 +1287,7 @@ static int32_t smlUpdateMeta(SHashObj *metaHash, SArray *metaArray, SArray *cols
|
|||
}
|
||||
} else {
|
||||
size_t tmp = taosArrayGetSize(metaArray);
|
||||
tAssert(tmp <= INT16_MAX);
|
||||
ASSERT(tmp <= INT16_MAX);
|
||||
int16_t size = tmp;
|
||||
taosArrayPush(metaArray, &kv);
|
||||
taosHashPut(metaHash, kv->key, kv->keyLen, &size, SHORT_BYTES);
|
||||
|
@ -1364,8 +1364,8 @@ static int32_t smlKvTimeArrayCompare(const void *key1, const void *key2) {
|
|||
SArray *s2 = *(SArray **)key2;
|
||||
SSmlKv *kv1 = (SSmlKv *)taosArrayGetP(s1, 0);
|
||||
SSmlKv *kv2 = (SSmlKv *)taosArrayGetP(s2, 0);
|
||||
tAssert(kv1->type == TSDB_DATA_TYPE_TIMESTAMP);
|
||||
tAssert(kv2->type == TSDB_DATA_TYPE_TIMESTAMP);
|
||||
ASSERT(kv1->type == TSDB_DATA_TYPE_TIMESTAMP);
|
||||
ASSERT(kv2->type == TSDB_DATA_TYPE_TIMESTAMP);
|
||||
if (kv1->i < kv2->i) {
|
||||
return -1;
|
||||
} else if (kv1->i > kv2->i) {
|
||||
|
@ -2206,7 +2206,7 @@ static int32_t smlParseTelnetLine(SSmlHandle *info, void *data, const int len) {
|
|||
} else if (info->protocol == TSDB_SML_JSON_PROTOCOL) {
|
||||
ret = smlParseJSONString(info, (cJSON *)data, tinfo, cols);
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
if (ret != TSDB_CODE_SUCCESS) {
|
||||
uError("SML:0x%" PRIx64 " smlParseTelnetLine failed", info->id);
|
||||
|
@ -2331,7 +2331,7 @@ static int32_t smlInsertData(SSmlHandle *info) {
|
|||
|
||||
SSmlSTableMeta **pMeta =
|
||||
(SSmlSTableMeta **)taosHashGet(info->superTables, tableData->sTableName, tableData->sTableNameLen);
|
||||
tAssert(NULL != pMeta && NULL != *pMeta);
|
||||
ASSERT(NULL != pMeta && NULL != *pMeta);
|
||||
|
||||
// use tablemeta of stable to save vgid and uid of child table
|
||||
(*pMeta)->tableMeta->vgId = vg.vgId;
|
||||
|
@ -2421,7 +2421,7 @@ static int32_t smlParseLine(SSmlHandle *info, char *lines[], char *rawLine, char
|
|||
} else if (info->protocol == TSDB_SML_TELNET_PROTOCOL) {
|
||||
code = smlParseTelnetLine(info, tmp, len);
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
uError("SML:0x%" PRIx64 " smlParseLine failed. line %d : %s", info->id, i, tmp);
|
||||
|
|
|
@ -389,7 +389,7 @@ int32_t stmtGetFromCache(STscStmt* pStmt) {
|
|||
|
||||
if (NULL == pStmt->sql.pTableCache || taosHashGetSize(pStmt->sql.pTableCache) <= 0) {
|
||||
if (pStmt->bInfo.inExecCache) {
|
||||
tAssert(taosHashGetSize(pStmt->exec.pBlockHash) == 1);
|
||||
ASSERT(taosHashGetSize(pStmt->exec.pBlockHash) == 1);
|
||||
pStmt->bInfo.needParse = false;
|
||||
tscDebug("reuse stmt block for tb %s in execBlock", pStmt->bInfo.tbFName);
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
|
|
@ -418,7 +418,7 @@ int32_t tmqCommitDone(SMqCommitCbParamSet* pParamSet) {
|
|||
|
||||
static void tmqCommitRspCountDown(SMqCommitCbParamSet* pParamSet) {
|
||||
int32_t waitingRspNum = atomic_sub_fetch_32(&pParamSet->waitingRspNum, 1);
|
||||
tAssert(waitingRspNum >= 0);
|
||||
ASSERT(waitingRspNum >= 0);
|
||||
if (waitingRspNum == 0) {
|
||||
tmqCommitDone(pParamSet);
|
||||
}
|
||||
|
@ -529,7 +529,7 @@ static int32_t tmqSendCommitReq(tmq_t* tmq, SMqClientVg* pVg, SMqClientTopic* pT
|
|||
int32_t tmqCommitMsgImpl(tmq_t* tmq, const TAOS_RES* msg, int8_t async, tmq_commit_cb* userCb, void* userParam) {
|
||||
char* topic;
|
||||
int32_t vgId;
|
||||
tAssert(msg != NULL);
|
||||
ASSERT(msg != NULL);
|
||||
if (TD_RES_TMQ(msg)) {
|
||||
SMqRspObj* pRspObj = (SMqRspObj*)msg;
|
||||
topic = pRspObj->topic;
|
||||
|
@ -806,7 +806,7 @@ int32_t tmqHandleAllDelayedTask(tmq_t* tmq) {
|
|||
taosTmrReset(tmqAssignDelayedCommitTask, tmq->autoCommitInterval, pRefId, tmqMgmt.timer, &tmq->commitTimer);
|
||||
} else if (*pTaskType == TMQ_DELAYED_TASK__REPORT) {
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
taosFreeQitem(pTaskType);
|
||||
}
|
||||
|
@ -916,9 +916,9 @@ tmq_t* tmq_consumer_new(tmq_conf_t* conf, char* errstr, int32_t errstrLen) {
|
|||
const char* user = conf->user == NULL ? TSDB_DEFAULT_USER : conf->user;
|
||||
const char* pass = conf->pass == NULL ? TSDB_DEFAULT_PASS : conf->pass;
|
||||
|
||||
tAssert(user);
|
||||
tAssert(pass);
|
||||
tAssert(conf->groupId[0]);
|
||||
ASSERT(user);
|
||||
ASSERT(pass);
|
||||
ASSERT(conf->groupId[0]);
|
||||
|
||||
pTmq->clientTopics = taosArrayInit(0, sizeof(SMqClientTopic));
|
||||
pTmq->mqueue = taosOpenQueue();
|
||||
|
@ -1209,7 +1209,7 @@ int32_t tmqPollCb(void* param, SDataBuf* pMsg, int32_t code) {
|
|||
tDecoderClear(&decoder);
|
||||
memcpy(&pRspWrapper->taosxRsp, pMsg->pData, sizeof(SMqRspHead));
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
taosMemoryFree(pMsg->pData);
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#define MALLOC_ALIGN_BYTES 256
|
||||
|
||||
int32_t colDataGetLength(const SColumnInfoData* pColumnInfoData, int32_t numOfRows) {
|
||||
tAssert(pColumnInfoData != NULL);
|
||||
ASSERT(pColumnInfoData != NULL);
|
||||
if (IS_VAR_DATA_TYPE(pColumnInfoData->info.type)) {
|
||||
return pColumnInfoData->varmeta.length;
|
||||
} else {
|
||||
|
@ -59,13 +59,13 @@ int32_t getJsonValueLen(const char* data) {
|
|||
} else if (tTagIsJson(data)) { // json string
|
||||
dataLen = ((STag*)(data))->len;
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
return dataLen;
|
||||
}
|
||||
|
||||
int32_t colDataAppend(SColumnInfoData* pColumnInfoData, uint32_t currentRow, const char* pData, bool isNull) {
|
||||
tAssert(pColumnInfoData != NULL);
|
||||
ASSERT(pColumnInfoData != NULL);
|
||||
|
||||
if (isNull) {
|
||||
// There is a placehold for each NULL value of binary or nchar type.
|
||||
|
@ -144,7 +144,7 @@ int32_t colDataReserve(SColumnInfoData* pColumnInfoData, size_t newSize) {
|
|||
|
||||
static void doCopyNItems(struct SColumnInfoData* pColumnInfoData, int32_t currentRow, const char* pData,
|
||||
int32_t itemLen, int32_t numOfRows) {
|
||||
tAssert(pColumnInfoData->info.bytes >= itemLen);
|
||||
ASSERT(pColumnInfoData->info.bytes >= itemLen);
|
||||
size_t start = 1;
|
||||
|
||||
// the first item
|
||||
|
@ -177,7 +177,7 @@ static void doCopyNItems(struct SColumnInfoData* pColumnInfoData, int32_t curren
|
|||
|
||||
int32_t colDataAppendNItems(SColumnInfoData* pColumnInfoData, uint32_t currentRow, const char* pData,
|
||||
uint32_t numOfRows) {
|
||||
tAssert(pData != NULL && pColumnInfoData != NULL);
|
||||
ASSERT(pData != NULL && pColumnInfoData != NULL);
|
||||
|
||||
int32_t len = pColumnInfoData->info.bytes;
|
||||
if (IS_VAR_DATA_TYPE(pColumnInfoData->info.type)) {
|
||||
|
@ -236,7 +236,7 @@ static void doBitmapMerge(SColumnInfoData* pColumnInfoData, int32_t numOfRow1, c
|
|||
|
||||
int32_t colDataMergeCol(SColumnInfoData* pColumnInfoData, int32_t numOfRow1, int32_t* capacity,
|
||||
const SColumnInfoData* pSource, int32_t numOfRow2) {
|
||||
tAssert(pColumnInfoData != NULL && pSource != NULL && pColumnInfoData->info.type == pSource->info.type);
|
||||
ASSERT(pColumnInfoData != NULL && pSource != NULL && pColumnInfoData->info.type == pSource->info.type);
|
||||
if (numOfRow2 == 0) {
|
||||
return numOfRow1;
|
||||
}
|
||||
|
@ -316,13 +316,13 @@ int32_t colDataMergeCol(SColumnInfoData* pColumnInfoData, int32_t numOfRow1, int
|
|||
|
||||
int32_t colDataAssign(SColumnInfoData* pColumnInfoData, const SColumnInfoData* pSource, int32_t numOfRows,
|
||||
const SDataBlockInfo* pBlockInfo) {
|
||||
tAssert(pColumnInfoData != NULL && pSource != NULL && pColumnInfoData->info.type == pSource->info.type);
|
||||
ASSERT(pColumnInfoData != NULL && pSource != NULL && pColumnInfoData->info.type == pSource->info.type);
|
||||
if (numOfRows <= 0) {
|
||||
return numOfRows;
|
||||
}
|
||||
|
||||
if (pBlockInfo != NULL) {
|
||||
tAssert(pBlockInfo->capacity >= numOfRows);
|
||||
ASSERT(pBlockInfo->capacity >= numOfRows);
|
||||
}
|
||||
|
||||
if (IS_VAR_DATA_TYPE(pColumnInfoData->info.type)) {
|
||||
|
@ -418,7 +418,7 @@ size_t blockDataGetSize(const SSDataBlock* pBlock) {
|
|||
// Actual data rows pluses the corresponding meta data must fit in one memory buffer of the given page size.
|
||||
int32_t blockDataSplitRows(SSDataBlock* pBlock, bool hasVarCol, int32_t startIndex, int32_t* stopIndex,
|
||||
int32_t pageSize) {
|
||||
tAssert(pBlock != NULL && stopIndex != NULL);
|
||||
ASSERT(pBlock != NULL && stopIndex != NULL);
|
||||
|
||||
size_t numOfCols = taosArrayGetSize(pBlock->pDataBlock);
|
||||
int32_t numOfRows = pBlock->info.rows;
|
||||
|
@ -433,7 +433,7 @@ int32_t blockDataSplitRows(SSDataBlock* pBlock, bool hasVarCol, int32_t startInd
|
|||
if (!hasVarCol) {
|
||||
size_t rowSize = blockDataGetRowSize(pBlock);
|
||||
int32_t capacity = payloadSize / (rowSize + numOfCols * bitmapChar / 8.0);
|
||||
tAssert(capacity > 0);
|
||||
ASSERT(capacity > 0);
|
||||
|
||||
*stopIndex = startIndex + capacity - 1;
|
||||
if (*stopIndex >= numOfRows) {
|
||||
|
@ -465,7 +465,7 @@ int32_t blockDataSplitRows(SSDataBlock* pBlock, bool hasVarCol, int32_t startInd
|
|||
|
||||
if (size > pageSize) { // pageSize must be able to hold one row
|
||||
*stopIndex = j - 1;
|
||||
tAssert(*stopIndex >= startIndex);
|
||||
ASSERT(*stopIndex >= startIndex);
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
@ -536,7 +536,7 @@ SSDataBlock* blockDataExtractBlock(SSDataBlock* pBlock, int32_t startIndex, int3
|
|||
* @return
|
||||
*/
|
||||
int32_t blockDataToBuf(char* buf, const SSDataBlock* pBlock) {
|
||||
tAssert(pBlock != NULL);
|
||||
ASSERT(pBlock != NULL);
|
||||
|
||||
// write the number of rows
|
||||
*(uint32_t*)buf = pBlock->info.rows;
|
||||
|
@ -608,7 +608,7 @@ int32_t blockDataFromBuf(SSDataBlock* pBlock, const char* buf) {
|
|||
}
|
||||
|
||||
pCol->varmeta.length = colLength;
|
||||
tAssert(pCol->varmeta.length <= pCol->varmeta.allocLen);
|
||||
ASSERT(pCol->varmeta.length <= pCol->varmeta.allocLen);
|
||||
}
|
||||
|
||||
memcpy(pCol->pData, pStart, colLength);
|
||||
|
@ -655,7 +655,7 @@ int32_t blockDataFromBuf1(SSDataBlock* pBlock, const char* buf, size_t capacity)
|
|||
}
|
||||
|
||||
pCol->varmeta.length = colLength;
|
||||
tAssert(pCol->varmeta.length <= pCol->varmeta.allocLen);
|
||||
ASSERT(pCol->varmeta.length <= pCol->varmeta.allocLen);
|
||||
}
|
||||
|
||||
if (!colDataIsNNull_s(pCol, 0, pBlock->info.rows)) {
|
||||
|
@ -669,7 +669,7 @@ int32_t blockDataFromBuf1(SSDataBlock* pBlock, const char* buf, size_t capacity)
|
|||
}
|
||||
|
||||
size_t blockDataGetRowSize(SSDataBlock* pBlock) {
|
||||
tAssert(pBlock != NULL);
|
||||
ASSERT(pBlock != NULL);
|
||||
if (pBlock->info.rowSize == 0) {
|
||||
size_t rowSize = 0;
|
||||
|
||||
|
@ -698,7 +698,7 @@ size_t blockDataGetSerialMetaSize(uint32_t numOfCols) {
|
|||
}
|
||||
|
||||
double blockDataGetSerialRowSize(const SSDataBlock* pBlock) {
|
||||
tAssert(pBlock != NULL);
|
||||
ASSERT(pBlock != NULL);
|
||||
double rowSize = 0;
|
||||
|
||||
size_t numOfCols = taosArrayGetSize(pBlock->pDataBlock);
|
||||
|
@ -901,7 +901,7 @@ static int32_t* createTupleIndex(size_t rows) {
|
|||
static void destroyTupleIndex(int32_t* index) { taosMemoryFreeClear(index); }
|
||||
|
||||
int32_t blockDataSort(SSDataBlock* pDataBlock, SArray* pOrderInfo) {
|
||||
tAssert(pDataBlock != NULL && pOrderInfo != NULL);
|
||||
ASSERT(pDataBlock != NULL && pOrderInfo != NULL);
|
||||
if (pDataBlock->info.rows <= 1) {
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
@ -1145,7 +1145,7 @@ void blockDataCleanup(SSDataBlock* pDataBlock) {
|
|||
|
||||
void blockDataEmpty(SSDataBlock* pDataBlock) {
|
||||
SDataBlockInfo* pInfo = &pDataBlock->info;
|
||||
tAssert(pInfo->rows <= pDataBlock->info.capacity);
|
||||
ASSERT(pInfo->rows <= pDataBlock->info.capacity);
|
||||
if (pInfo->capacity == 0) {
|
||||
return;
|
||||
}
|
||||
|
@ -1163,13 +1163,13 @@ void blockDataEmpty(SSDataBlock* pDataBlock) {
|
|||
|
||||
// todo temporarily disable it
|
||||
static int32_t doEnsureCapacity(SColumnInfoData* pColumn, const SDataBlockInfo* pBlockInfo, uint32_t numOfRows, bool clearPayload) {
|
||||
tAssert(numOfRows > 0 /*&& pBlockInfo->capacity >= pBlockInfo->rows*/);
|
||||
ASSERT(numOfRows > 0 /*&& pBlockInfo->capacity >= pBlockInfo->rows*/);
|
||||
if (numOfRows <= pBlockInfo->capacity) {
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
// todo temp disable it
|
||||
// tAssert(pColumn->info.bytes != 0);
|
||||
// ASSERT(pColumn->info.bytes != 0);
|
||||
|
||||
int32_t existedRows = pBlockInfo->rows;
|
||||
|
||||
|
@ -1191,7 +1191,7 @@ static int32_t doEnsureCapacity(SColumnInfoData* pColumn, const SDataBlockInfo*
|
|||
int32_t oldLen = BitmapLen(existedRows);
|
||||
pColumn->nullbitmap = tmp;
|
||||
memset(&pColumn->nullbitmap[oldLen], 0, BitmapLen(numOfRows) - oldLen);
|
||||
tAssert(pColumn->info.bytes);
|
||||
ASSERT(pColumn->info.bytes);
|
||||
|
||||
// make sure the allocated memory is MALLOC_ALIGN_BYTES aligned
|
||||
tmp = taosMemoryMallocAlign(MALLOC_ALIGN_BYTES, numOfRows * pColumn->info.bytes);
|
||||
|
@ -1209,7 +1209,7 @@ static int32_t doEnsureCapacity(SColumnInfoData* pColumn, const SDataBlockInfo*
|
|||
|
||||
// todo remove it soon
|
||||
#if defined LINUX
|
||||
tAssert((((uint64_t)pColumn->pData) & (MALLOC_ALIGN_BYTES - 1)) == 0x0);
|
||||
ASSERT((((uint64_t)pColumn->pData) & (MALLOC_ALIGN_BYTES - 1)) == 0x0);
|
||||
#endif
|
||||
|
||||
if (clearPayload) {
|
||||
|
@ -1303,7 +1303,7 @@ void* blockDataDestroy(SSDataBlock* pBlock) {
|
|||
}
|
||||
|
||||
int32_t assignOneDataBlock(SSDataBlock* dst, const SSDataBlock* src) {
|
||||
tAssert(src != NULL);
|
||||
ASSERT(src != NULL);
|
||||
|
||||
dst->info = src->info;
|
||||
dst->info.rows = 0;
|
||||
|
@ -1339,7 +1339,7 @@ int32_t assignOneDataBlock(SSDataBlock* dst, const SSDataBlock* src) {
|
|||
}
|
||||
|
||||
int32_t copyDataBlock(SSDataBlock* dst, const SSDataBlock* src) {
|
||||
tAssert(src != NULL && dst != NULL);
|
||||
ASSERT(src != NULL && dst != NULL);
|
||||
|
||||
blockDataCleanup(dst);
|
||||
int32_t code = blockDataEnsureCapacity(dst, src->info.rows);
|
||||
|
@ -1496,7 +1496,7 @@ SSDataBlock* createDataBlock() {
|
|||
}
|
||||
|
||||
int32_t blockDataAppendColInfo(SSDataBlock* pBlock, SColumnInfoData* pColInfoData) {
|
||||
tAssert(pBlock != NULL && pColInfoData != NULL);
|
||||
ASSERT(pBlock != NULL && pColInfoData != NULL);
|
||||
if (pBlock->pDataBlock == NULL) {
|
||||
pBlock->pDataBlock = taosArrayInit(4, sizeof(SColumnInfoData));
|
||||
if (pBlock->pDataBlock == NULL) {
|
||||
|
@ -1512,7 +1512,7 @@ int32_t blockDataAppendColInfo(SSDataBlock* pBlock, SColumnInfoData* pColInfoDat
|
|||
}
|
||||
|
||||
// todo disable it temporarily
|
||||
// tAssert(pColInfoData->info.type != 0);
|
||||
// ASSERT(pColInfoData->info.type != 0);
|
||||
if (IS_VAR_DATA_TYPE(pColInfoData->info.type)) {
|
||||
pBlock->info.hasVarCol = true;
|
||||
}
|
||||
|
@ -1531,7 +1531,7 @@ SColumnInfoData createColumnInfoData(int16_t type, int32_t bytes, int16_t colId)
|
|||
}
|
||||
|
||||
SColumnInfoData* bdGetColumnInfoData(const SSDataBlock* pBlock, int32_t index) {
|
||||
tAssert(pBlock != NULL);
|
||||
ASSERT(pBlock != NULL);
|
||||
if (index >= taosArrayGetSize(pBlock->pDataBlock)) {
|
||||
return NULL;
|
||||
}
|
||||
|
@ -1545,7 +1545,7 @@ size_t blockDataGetCapacityInRow(const SSDataBlock* pBlock, size_t pageSize) {
|
|||
int32_t payloadSize = pageSize - blockDataGetSerialMetaSize(numOfCols);
|
||||
int32_t rowSize = pBlock->info.rowSize;
|
||||
int32_t nRows = payloadSize / rowSize;
|
||||
tAssert(nRows >= 1);
|
||||
ASSERT(nRows >= 1);
|
||||
|
||||
// the true value must be less than the value of nRows
|
||||
int32_t additional = 0;
|
||||
|
@ -1559,7 +1559,7 @@ size_t blockDataGetCapacityInRow(const SSDataBlock* pBlock, size_t pageSize) {
|
|||
}
|
||||
|
||||
int32_t newRows = (payloadSize - additional) / rowSize;
|
||||
tAssert(newRows <= nRows && newRows >= 1);
|
||||
ASSERT(newRows <= nRows && newRows >= 1);
|
||||
|
||||
return newRows;
|
||||
}
|
||||
|
@ -2137,7 +2137,7 @@ int32_t buildSubmitReqFromDataBlock(SSubmitReq** pReq, const SSDataBlock* pDataB
|
|||
case TSDB_DATA_TYPE_JSON:
|
||||
case TSDB_DATA_TYPE_MEDIUMBLOB:
|
||||
uError("the column type %" PRIi16 " is defined but not implemented yet", pColInfoData->info.type);
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
break;
|
||||
default:
|
||||
if (pColInfoData->info.type < TSDB_DATA_TYPE_MAX && pColInfoData->info.type > TSDB_DATA_TYPE_NULL) {
|
||||
|
@ -2171,7 +2171,7 @@ int32_t buildSubmitReqFromDataBlock(SSubmitReq** pReq, const SSDataBlock* pDataB
|
|||
}
|
||||
} else {
|
||||
uError("the column type %" PRIi16 " is undefined\n", pColInfoData->info.type);
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -2217,7 +2217,7 @@ int32_t buildSubmitReqFromDataBlock(SSubmitReq** pReq, const SSDataBlock* pDataB
|
|||
}
|
||||
|
||||
char* buildCtbNameByGroupId(const char* stbFullName, uint64_t groupId) {
|
||||
tAssert(stbFullName[0] != 0);
|
||||
ASSERT(stbFullName[0] != 0);
|
||||
SArray* tags = taosArrayInit(0, sizeof(void*));
|
||||
if (tags == NULL) {
|
||||
return NULL;
|
||||
|
@ -2255,7 +2255,7 @@ char* buildCtbNameByGroupId(const char* stbFullName, uint64_t groupId) {
|
|||
taosMemoryFree(pTag);
|
||||
taosArrayDestroy(tags);
|
||||
|
||||
tAssert(rname.ctbShortName && rname.ctbShortName[0]);
|
||||
ASSERT(rname.ctbShortName && rname.ctbShortName[0]);
|
||||
return rname.ctbShortName;
|
||||
}
|
||||
|
||||
|
@ -2273,7 +2273,7 @@ int32_t blockEncode(const SSDataBlock* pBlock, char* data, int32_t numOfCols) {
|
|||
int32_t* rows = (int32_t*)data;
|
||||
*rows = pBlock->info.rows;
|
||||
data += sizeof(int32_t);
|
||||
tAssert(*rows > 0);
|
||||
ASSERT(*rows > 0);
|
||||
|
||||
int32_t* cols = (int32_t*)data;
|
||||
*cols = numOfCols;
|
||||
|
@ -2333,7 +2333,7 @@ int32_t blockEncode(const SSDataBlock* pBlock, char* data, int32_t numOfCols) {
|
|||
|
||||
*actualLen = dataLen;
|
||||
*groupId = pBlock->info.id.groupId;
|
||||
tAssert(dataLen > 0);
|
||||
ASSERT(dataLen > 0);
|
||||
|
||||
uDebug("build data block, actualLen:%d, rows:%d, cols:%d", dataLen, *rows, *cols);
|
||||
|
||||
|
@ -2345,7 +2345,7 @@ const char* blockDecode(SSDataBlock* pBlock, const char* pData) {
|
|||
|
||||
int32_t version = *(int32_t*)pStart;
|
||||
pStart += sizeof(int32_t);
|
||||
tAssert(version == 1);
|
||||
ASSERT(version == 1);
|
||||
|
||||
// total length sizeof(int32_t)
|
||||
int32_t dataLen = *(int32_t*)pStart;
|
||||
|
@ -2393,7 +2393,7 @@ const char* blockDecode(SSDataBlock* pBlock, const char* pData) {
|
|||
|
||||
for (int32_t i = 0; i < numOfCols; ++i) {
|
||||
colLen[i] = htonl(colLen[i]);
|
||||
tAssert(colLen[i] >= 0);
|
||||
ASSERT(colLen[i] >= 0);
|
||||
|
||||
SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, i);
|
||||
if (IS_VAR_DATA_TYPE(pColInfoData->info.type)) {
|
||||
|
@ -2428,6 +2428,6 @@ const char* blockDecode(SSDataBlock* pBlock, const char* pData) {
|
|||
}
|
||||
|
||||
pBlock->info.rows = numOfRows;
|
||||
tAssert(pStart - pData == dataLen);
|
||||
ASSERT(pStart - pData == dataLen);
|
||||
return pStart;
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ typedef struct {
|
|||
SET_BIT2(PB, IDX, VAL); \
|
||||
break; \
|
||||
default: \
|
||||
tAssert(0); \
|
||||
ASSERT(0); \
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
|
@ -98,9 +98,9 @@ typedef struct {
|
|||
int32_t tRowBuild(SArray *aColVal, STSchema *pTSchema, SBuffer *pBuffer) {
|
||||
int32_t code = 0;
|
||||
|
||||
tAssert(taosArrayGetSize(aColVal) > 0);
|
||||
tAssert(((SColVal *)aColVal->pData)[0].cid == PRIMARYKEY_TIMESTAMP_COL_ID);
|
||||
tAssert(((SColVal *)aColVal->pData)[0].type == TSDB_DATA_TYPE_TIMESTAMP);
|
||||
ASSERT(taosArrayGetSize(aColVal) > 0);
|
||||
ASSERT(((SColVal *)aColVal->pData)[0].cid == PRIMARYKEY_TIMESTAMP_COL_ID);
|
||||
ASSERT(((SColVal *)aColVal->pData)[0].type == TSDB_DATA_TYPE_TIMESTAMP);
|
||||
|
||||
// scan ---------------
|
||||
uint8_t flag = 0;
|
||||
|
@ -135,7 +135,7 @@ int32_t tRowBuild(SArray *aColVal, STSchema *pTSchema, SBuffer *pBuffer) {
|
|||
nkv += tPutI16v(NULL, -pTColumn->colId);
|
||||
nIdx++;
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
pTColumn = (++iTColumn < pTSchema->numOfCols) ? pTSchema->columns + iTColumn : NULL;
|
||||
|
@ -174,7 +174,7 @@ int32_t tRowBuild(SArray *aColVal, STSchema *pTSchema, SBuffer *pBuffer) {
|
|||
ntp = sizeof(SRow) + BIT2_SIZE(pTSchema->numOfCols - 1) + ntp;
|
||||
break;
|
||||
default:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
break;
|
||||
}
|
||||
if (maxIdx <= UINT8_MAX) {
|
||||
|
@ -302,7 +302,7 @@ int32_t tRowBuild(SArray *aColVal, STSchema *pTSchema, SBuffer *pBuffer) {
|
|||
pv = pf + pTSchema->flen;
|
||||
break;
|
||||
default:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -353,8 +353,8 @@ _exit:
|
|||
}
|
||||
|
||||
void tRowGet(SRow *pRow, STSchema *pTSchema, int32_t iCol, SColVal *pColVal) {
|
||||
tAssert(iCol < pTSchema->numOfCols);
|
||||
tAssert(pRow->sver == pTSchema->version);
|
||||
ASSERT(iCol < pTSchema->numOfCols);
|
||||
ASSERT(pRow->sver == pTSchema->version);
|
||||
|
||||
STColumn *pTColumn = pTSchema->columns + iCol;
|
||||
|
||||
|
@ -512,7 +512,7 @@ struct SRowIter {
|
|||
};
|
||||
|
||||
int32_t tRowIterOpen(SRow *pRow, STSchema *pTSchema, SRowIter **ppIter) {
|
||||
tAssert(pRow->sver == pTSchema->version);
|
||||
ASSERT(pRow->sver == pTSchema->version);
|
||||
|
||||
int32_t code = 0;
|
||||
|
||||
|
@ -559,7 +559,7 @@ int32_t tRowIterOpen(SRow *pRow, STSchema *pTSchema, SRowIter **ppIter) {
|
|||
pIter->pv = pIter->pf + pTSchema->flen;
|
||||
break;
|
||||
default:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -649,7 +649,7 @@ SColVal *tRowIterNext(SRowIter *pIter) {
|
|||
pIter->cv = COL_VAL_NONE(pTColumn->colId, pTColumn->type);
|
||||
goto _exit;
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
} else {
|
||||
pIter->cv = COL_VAL_NONE(pTColumn->colId, pTColumn->type);
|
||||
|
@ -673,7 +673,7 @@ SColVal *tRowIterNext(SRowIter *pIter) {
|
|||
bv = GET_BIT2(pIter->pb, pIter->iTColumn - 1);
|
||||
break;
|
||||
default:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -773,7 +773,7 @@ static void debugPrintTagVal(int8_t type, const void *val, int32_t vlen, const c
|
|||
printf("%s:%d type:%d vlen:%d, val:%" PRIi8 "\n", tag, ln, (int32_t)type, vlen, *(int8_t *)val);
|
||||
break;
|
||||
default:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -897,7 +897,7 @@ int32_t tTagNew(SArray *pArray, int32_t version, int8_t isJson, STag **ppTag) {
|
|||
isLarge = 1;
|
||||
}
|
||||
|
||||
tAssert(szTag <= INT16_MAX);
|
||||
ASSERT(szTag <= INT16_MAX);
|
||||
|
||||
// build tag
|
||||
(*ppTag) = (STag *)taosMemoryCalloc(szTag, 1);
|
||||
|
@ -1142,7 +1142,7 @@ int32_t tdAddColToSchema(STSchemaBuilder *pBuilder, int8_t type, int8_t flags, c
|
|||
|
||||
pBuilder->nCols++;
|
||||
|
||||
tAssert(pCol->offset < pBuilder->flen);
|
||||
ASSERT(pCol->offset < pBuilder->flen);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1179,8 +1179,8 @@ STSchema *tBuildTSchema(SSchema *aSchema, int32_t numOfCols, int32_t version) {
|
|||
pTSchema->version = version;
|
||||
|
||||
// timestamp column
|
||||
tAssert(aSchema[0].type == TSDB_DATA_TYPE_TIMESTAMP);
|
||||
tAssert(aSchema[0].colId == PRIMARYKEY_TIMESTAMP_COL_ID);
|
||||
ASSERT(aSchema[0].type == TSDB_DATA_TYPE_TIMESTAMP);
|
||||
ASSERT(aSchema[0].colId == PRIMARYKEY_TIMESTAMP_COL_ID);
|
||||
pTSchema->columns[0].colId = aSchema[0].colId;
|
||||
pTSchema->columns[0].type = aSchema[0].type;
|
||||
pTSchema->columns[0].flags = aSchema[0].flags;
|
||||
|
@ -1245,7 +1245,7 @@ static FORCE_INLINE int32_t tColDataPutValue(SColData *pColData, SColVal *pColVa
|
|||
pColData->nData += pColVal->value.nData;
|
||||
}
|
||||
} else {
|
||||
tAssert(pColData->nData == tDataTypes[pColData->type].bytes * pColData->nVal);
|
||||
ASSERT(pColData->nData == tDataTypes[pColData->type].bytes * pColData->nVal);
|
||||
code = tRealloc(&pColData->pData, pColData->nData + tDataTypes[pColData->type].bytes);
|
||||
if (code) goto _exit;
|
||||
memcpy(pColData->pData + pColData->nData, &pColVal->value.val, tDataTypes[pColData->type].bytes);
|
||||
|
@ -1562,7 +1562,7 @@ static int32_t (*tColDataAppendValueImpl[8][3])(SColData *pColData, SColVal *pCo
|
|||
{tColDataAppendValue70, tColDataAppendValue71, tColDataAppendValue72}, // HAS_VALUE|HAS_NULL|HAS_NONE
|
||||
};
|
||||
int32_t tColDataAppendValue(SColData *pColData, SColVal *pColVal) {
|
||||
tAssert(pColData->cid == pColVal->cid && pColData->type == pColVal->type);
|
||||
ASSERT(pColData->cid == pColVal->cid && pColData->type == pColVal->type);
|
||||
return tColDataAppendValueImpl[pColData->flag][pColVal->flag](pColData, pColVal);
|
||||
}
|
||||
|
||||
|
@ -1581,7 +1581,7 @@ static FORCE_INLINE void tColDataGetValue3(SColData *pColData, int32_t iVal, SCo
|
|||
*pColVal = COL_VAL_NULL(pColData->cid, pColData->type);
|
||||
break;
|
||||
default:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
}
|
||||
static FORCE_INLINE void tColDataGetValue4(SColData *pColData, int32_t iVal, SColVal *pColVal) { // HAS_VALUE
|
||||
|
@ -1608,7 +1608,7 @@ static FORCE_INLINE void tColDataGetValue5(SColData *pColData, int32_t iVal,
|
|||
tColDataGetValue4(pColData, iVal, pColVal);
|
||||
break;
|
||||
default:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
}
|
||||
static FORCE_INLINE void tColDataGetValue6(SColData *pColData, int32_t iVal,
|
||||
|
@ -1621,7 +1621,7 @@ static FORCE_INLINE void tColDataGetValue6(SColData *pColData, int32_t iVal,
|
|||
tColDataGetValue4(pColData, iVal, pColVal);
|
||||
break;
|
||||
default:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
}
|
||||
static FORCE_INLINE void tColDataGetValue7(SColData *pColData, int32_t iVal,
|
||||
|
@ -1637,7 +1637,7 @@ static FORCE_INLINE void tColDataGetValue7(SColData *pColData, int32_t iVal,
|
|||
tColDataGetValue4(pColData, iVal, pColVal);
|
||||
break;
|
||||
default:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
}
|
||||
static void (*tColDataGetValueImpl[])(SColData *pColData, int32_t iVal, SColVal *pColVal) = {
|
||||
|
@ -1651,7 +1651,7 @@ static void (*tColDataGetValueImpl[])(SColData *pColData, int32_t iVal, SColVal
|
|||
tColDataGetValue7 // HAS_VALUE | HAS_NULL | HAS_NONE
|
||||
};
|
||||
void tColDataGetValue(SColData *pColData, int32_t iVal, SColVal *pColVal) {
|
||||
tAssert(iVal >= 0 && iVal < pColData->nVal && pColData->flag);
|
||||
ASSERT(iVal >= 0 && iVal < pColData->nVal && pColData->flag);
|
||||
tColDataGetValueImpl[pColData->flag](pColData, iVal, pColVal);
|
||||
}
|
||||
|
||||
|
@ -1681,7 +1681,7 @@ uint8_t tColDataGetBitValue(const SColData *pColData, int32_t iVal) {
|
|||
v = GET_BIT2(pColData->pBitMap, iVal);
|
||||
break;
|
||||
default:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
break;
|
||||
}
|
||||
return v;
|
||||
|
@ -1691,9 +1691,9 @@ int32_t tColDataCopy(SColData *pColDataSrc, SColData *pColDataDest) {
|
|||
int32_t code = 0;
|
||||
int32_t size;
|
||||
|
||||
tAssert(pColDataSrc->nVal > 0);
|
||||
tAssert(pColDataDest->cid == pColDataSrc->cid);
|
||||
tAssert(pColDataDest->type == pColDataSrc->type);
|
||||
ASSERT(pColDataSrc->nVal > 0);
|
||||
ASSERT(pColDataDest->cid == pColDataSrc->cid);
|
||||
ASSERT(pColDataDest->type == pColDataSrc->type);
|
||||
|
||||
pColDataDest->smaOn = pColDataSrc->smaOn;
|
||||
pColDataDest->nVal = pColDataSrc->nVal;
|
||||
|
@ -1759,7 +1759,7 @@ static FORCE_INLINE void tColDataCalcSMABool(SColData *pColData, int64_t *sum, i
|
|||
CALC_SUM_MAX_MIN(*sum, *max, *min, val);
|
||||
break;
|
||||
default:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1791,7 +1791,7 @@ static FORCE_INLINE void tColDataCalcSMATinyInt(SColData *pColData, int64_t *sum
|
|||
CALC_SUM_MAX_MIN(*sum, *max, *min, val);
|
||||
break;
|
||||
default:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1823,7 +1823,7 @@ static FORCE_INLINE void tColDataCalcSMATinySmallInt(SColData *pColData, int64_t
|
|||
CALC_SUM_MAX_MIN(*sum, *max, *min, val);
|
||||
break;
|
||||
default:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1855,7 +1855,7 @@ static FORCE_INLINE void tColDataCalcSMAInt(SColData *pColData, int64_t *sum, in
|
|||
CALC_SUM_MAX_MIN(*sum, *max, *min, val);
|
||||
break;
|
||||
default:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1887,7 +1887,7 @@ static FORCE_INLINE void tColDataCalcSMABigInt(SColData *pColData, int64_t *sum,
|
|||
CALC_SUM_MAX_MIN(*sum, *max, *min, val);
|
||||
break;
|
||||
default:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1919,7 +1919,7 @@ static FORCE_INLINE void tColDataCalcSMAFloat(SColData *pColData, int64_t *sum,
|
|||
CALC_SUM_MAX_MIN(*(double *)sum, *(double *)max, *(double *)min, val);
|
||||
break;
|
||||
default:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1951,7 +1951,7 @@ static FORCE_INLINE void tColDataCalcSMADouble(SColData *pColData, int64_t *sum,
|
|||
CALC_SUM_MAX_MIN(*(double *)sum, *(double *)max, *(double *)min, val);
|
||||
break;
|
||||
default:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1983,7 +1983,7 @@ static FORCE_INLINE void tColDataCalcSMAUTinyInt(SColData *pColData, int64_t *su
|
|||
CALC_SUM_MAX_MIN(*(uint64_t *)sum, *(uint64_t *)max, *(uint64_t *)min, val);
|
||||
break;
|
||||
default:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -2015,7 +2015,7 @@ static FORCE_INLINE void tColDataCalcSMATinyUSmallInt(SColData *pColData, int64_
|
|||
CALC_SUM_MAX_MIN(*(uint64_t *)sum, *(uint64_t *)max, *(uint64_t *)min, val);
|
||||
break;
|
||||
default:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -2047,7 +2047,7 @@ static FORCE_INLINE void tColDataCalcSMAUInt(SColData *pColData, int64_t *sum, i
|
|||
CALC_SUM_MAX_MIN(*(uint64_t *)sum, *(uint64_t *)max, *(uint64_t *)min, val);
|
||||
break;
|
||||
default:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -2079,7 +2079,7 @@ static FORCE_INLINE void tColDataCalcSMAUBigInt(SColData *pColData, int64_t *sum
|
|||
CALC_SUM_MAX_MIN(*(uint64_t *)sum, *(uint64_t *)max, *(uint64_t *)min, val);
|
||||
break;
|
||||
default:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -334,7 +334,6 @@ static int32_t taosAddSystemCfg(SConfig *pCfg) {
|
|||
if (cfgAddLocale(pCfg, "locale", tsLocale) != 0) return -1;
|
||||
if (cfgAddCharset(pCfg, "charset", tsCharset) != 0) return -1;
|
||||
if (cfgAddBool(pCfg, "enableCoreFile", 1, 1) != 0) return -1;
|
||||
if (cfgAddBool(pCfg, "assert", 1, 1) != 0) return -1;
|
||||
if (cfgAddFloat(pCfg, "numOfCores", tsNumOfCores, 1, 100000, 1) != 0) return -1;
|
||||
|
||||
if (cfgAddBool(pCfg, "SSE42", tsSSE42Enable, 0) != 0) return -1;
|
||||
|
@ -694,8 +693,6 @@ static void taosSetSystemCfg(SConfig *pCfg) {
|
|||
bool enableCore = cfgGetItem(pCfg, "enableCoreFile")->bval;
|
||||
taosSetCoreDump(enableCore);
|
||||
|
||||
tsAssert = cfgGetItem(pCfg, "assert")->bval;
|
||||
|
||||
// todo
|
||||
tsVersion = 30000000;
|
||||
}
|
||||
|
@ -791,9 +788,7 @@ int32_t taosSetCfg(SConfig *pCfg, char *name) {
|
|||
case 'a': {
|
||||
if (strcasecmp("asyncLog", name) == 0) {
|
||||
tsAsyncLog = cfgGetItem(pCfg, "asyncLog")->bval;
|
||||
} else if (strcasecmp("assert", name) == 0) {
|
||||
tsAssert = cfgGetItem(pCfg, "assert")->bval;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'c': {
|
||||
|
|
|
@ -28,8 +28,6 @@
|
|||
#undef TD_MSG_SEG_CODE_
|
||||
#include "tmsgdef.h"
|
||||
|
||||
#include "tlog.h"
|
||||
|
||||
int32_t tInitSubmitMsgIter(const SSubmitReq *pMsg, SSubmitMsgIter *pIter) {
|
||||
if (pMsg == NULL) {
|
||||
terrno = TSDB_CODE_TDB_SUBMIT_MSG_MSSED_UP;
|
||||
|
@ -38,7 +36,7 @@ int32_t tInitSubmitMsgIter(const SSubmitReq *pMsg, SSubmitMsgIter *pIter) {
|
|||
|
||||
pIter->totalLen = htonl(pMsg->length);
|
||||
pIter->numOfBlocks = htonl(pMsg->numOfBlocks);
|
||||
tAssert(pIter->totalLen > 0);
|
||||
ASSERT(pIter->totalLen > 0);
|
||||
pIter->len = 0;
|
||||
pIter->pMsg = pMsg;
|
||||
if (pIter->totalLen <= sizeof(SSubmitReq)) {
|
||||
|
@ -50,17 +48,17 @@ int32_t tInitSubmitMsgIter(const SSubmitReq *pMsg, SSubmitMsgIter *pIter) {
|
|||
}
|
||||
|
||||
int32_t tGetSubmitMsgNext(SSubmitMsgIter *pIter, SSubmitBlk **pPBlock) {
|
||||
tAssert(pIter->len >= 0);
|
||||
ASSERT(pIter->len >= 0);
|
||||
|
||||
if (pIter->len == 0) {
|
||||
pIter->len += sizeof(SSubmitReq);
|
||||
} else {
|
||||
if (pIter->len >= pIter->totalLen) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
pIter->len += (sizeof(SSubmitBlk) + pIter->dataLen + pIter->schemaLen);
|
||||
tAssert(pIter->len > 0);
|
||||
ASSERT(pIter->len > 0);
|
||||
}
|
||||
|
||||
if (pIter->len > pIter->totalLen) {
|
||||
|
@ -308,7 +306,7 @@ static int32_t tDeserializeSClientHbReq(SDecoder *pDecoder, SClientHbReq *pReq)
|
|||
}
|
||||
}
|
||||
|
||||
tAssert(desc.subPlanNum == taosArrayGetSize(desc.subDesc));
|
||||
ASSERT(desc.subPlanNum == taosArrayGetSize(desc.subDesc));
|
||||
|
||||
taosArrayPush(pReq->query->queryDesc, &desc);
|
||||
}
|
||||
|
@ -5679,7 +5677,7 @@ int tEncodeSVCreateTbReq(SEncoder *pCoder, const SVCreateTbReq *pReq) {
|
|||
} else if (pReq->type == TSDB_NORMAL_TABLE) {
|
||||
if (tEncodeSSchemaWrapper(pCoder, &pReq->ntb.schemaRow) < 0) return -1;
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
tEndEncode(pCoder);
|
||||
|
@ -5721,7 +5719,7 @@ int tDecodeSVCreateTbReq(SDecoder *pCoder, SVCreateTbReq *pReq) {
|
|||
} else if (pReq->type == TSDB_NORMAL_TABLE) {
|
||||
if (tDecodeSSchemaWrapperEx(pCoder, &pReq->ntb.schemaRow) < 0) return -1;
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
tEndDecode(pCoder);
|
||||
|
@ -6349,7 +6347,7 @@ int32_t tEncodeSTqOffsetVal(SEncoder *pEncoder, const STqOffsetVal *pOffsetVal)
|
|||
} else if (pOffsetVal->type < 0) {
|
||||
// do nothing
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -6364,7 +6362,7 @@ int32_t tDecodeSTqOffsetVal(SDecoder *pDecoder, STqOffsetVal *pOffsetVal) {
|
|||
} else if (pOffsetVal->type < 0) {
|
||||
// do nothing
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -6381,7 +6379,7 @@ int32_t tFormatOffset(char *buf, int32_t maxLen, const STqOffsetVal *pVal) {
|
|||
} else if (pVal->type == TMQ_OFFSET__SNAPSHOT_DATA || pVal->type == TMQ_OFFSET__SNAPSHOT_META) {
|
||||
snprintf(buf, maxLen, "offset(ss data) uid:%" PRId64 ", ts:%" PRId64, pVal->uid, pVal->ts);
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -6395,8 +6393,8 @@ bool tOffsetEqual(const STqOffsetVal *pLeft, const STqOffsetVal *pRight) {
|
|||
} else if (pLeft->type == TMQ_OFFSET__SNAPSHOT_META) {
|
||||
return pLeft->uid == pRight->uid;
|
||||
} else {
|
||||
tAssert(0);
|
||||
/*tAssert(pLeft->type == TMQ_OFFSET__RESET_NONE || pLeft->type == TMQ_OFFSET__RESET_EARLIEAST ||*/
|
||||
ASSERT(0);
|
||||
/*ASSERT(pLeft->type == TMQ_OFFSET__RESET_NONE || pLeft->type == TMQ_OFFSET__RESET_EARLIEAST ||*/
|
||||
/*pLeft->type == TMQ_OFFSET__RESET_LATEST);*/
|
||||
/*return true;*/
|
||||
}
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
|
||||
#define _DEFAULT_SOURCE
|
||||
#include "trow.h"
|
||||
#include "tlog.h"
|
||||
|
||||
const uint8_t tdVTypeByte[2][3] = {{
|
||||
// 2 bits
|
||||
|
@ -61,7 +60,7 @@ void tdSRowPrint(STSRow *row, STSchema *pSchema, const char *tag) {
|
|||
if (!tdSTSRowIterNext(&iter, &sVal)) {
|
||||
break;
|
||||
}
|
||||
tAssert(sVal.valType == 0 || sVal.valType == 1 || sVal.valType == 2);
|
||||
ASSERT(sVal.valType == 0 || sVal.valType == 1 || sVal.valType == 2);
|
||||
tdSCellValPrint(&sVal, cols[iter.colIdx - 1].type);
|
||||
}
|
||||
printf("\n");
|
||||
|
@ -76,7 +75,7 @@ void tdSCellValPrint(SCellVal *pVal, int8_t colType) {
|
|||
return;
|
||||
}
|
||||
if (!pVal->val) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
printf("BadVal ");
|
||||
return;
|
||||
}
|
||||
|
@ -249,7 +248,7 @@ bool tdSTSRowIterNext(STSRowIter *pIter, SCellVal *pVal) {
|
|||
} else if (TD_IS_KV_ROW(pIter->pRow)) {
|
||||
tdSTSRowIterGetKvVal(pIter, pCol->colId, &pIter->kvIdx, pVal);
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
++pIter->colIdx;
|
||||
|
||||
|
@ -331,7 +330,7 @@ int32_t tdSTSRowNew(SArray *pArray, STSchema *pTSchema, STSRow **ppRow) {
|
|||
void *varBuf = NULL;
|
||||
bool isAlloc = false;
|
||||
|
||||
tAssert(nColVal > 1);
|
||||
ASSERT(nColVal > 1);
|
||||
|
||||
for (int32_t iColumn = 0; iColumn < pTSchema->numOfCols; ++iColumn) {
|
||||
pTColumn = &pTSchema->columns[iColumn];
|
||||
|
@ -342,9 +341,9 @@ int32_t tdSTSRowNew(SArray *pArray, STSchema *pTSchema, STSRow **ppRow) {
|
|||
}
|
||||
|
||||
if (iColumn == 0) {
|
||||
tAssert(pColVal->cid == pTColumn->colId);
|
||||
tAssert(pTColumn->type == TSDB_DATA_TYPE_TIMESTAMP);
|
||||
tAssert(pTColumn->colId == PRIMARYKEY_TIMESTAMP_COL_ID);
|
||||
ASSERT(pColVal->cid == pTColumn->colId);
|
||||
ASSERT(pTColumn->type == TSDB_DATA_TYPE_TIMESTAMP);
|
||||
ASSERT(pTColumn->colId == PRIMARYKEY_TIMESTAMP_COL_ID);
|
||||
} else {
|
||||
if (IS_VAR_DATA_TYPE(pTColumn->type)) {
|
||||
if (pColVal && COL_VAL_IS_VALUE(pColVal)) {
|
||||
|
@ -490,7 +489,7 @@ bool tdSTSRowGetVal(STSRowIter *pIter, col_id_t colId, col_type_t colType, SCell
|
|||
|
||||
int32_t tdGetBitmapValTypeII(const void *pBitmap, int16_t colIdx, TDRowValT *pValType) {
|
||||
if (!pBitmap || colIdx < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
terrno = TSDB_CODE_INVALID_PARA;
|
||||
return terrno;
|
||||
}
|
||||
|
@ -512,7 +511,7 @@ int32_t tdGetBitmapValTypeII(const void *pBitmap, int16_t colIdx, TDRowValT *pVa
|
|||
*pValType = ((*pDestByte) & 0x03);
|
||||
break;
|
||||
default:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
terrno = TSDB_CODE_INVALID_PARA;
|
||||
return terrno;
|
||||
}
|
||||
|
@ -521,7 +520,7 @@ int32_t tdGetBitmapValTypeII(const void *pBitmap, int16_t colIdx, TDRowValT *pVa
|
|||
|
||||
int32_t tdGetBitmapValTypeI(const void *pBitmap, int16_t colIdx, TDRowValT *pValType) {
|
||||
if (!pBitmap || colIdx < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
terrno = TSDB_CODE_INVALID_PARA;
|
||||
return terrno;
|
||||
}
|
||||
|
@ -555,7 +554,7 @@ int32_t tdGetBitmapValTypeI(const void *pBitmap, int16_t colIdx, TDRowValT *pVal
|
|||
*pValType = ((*pDestByte) & 0x01);
|
||||
break;
|
||||
default:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
terrno = TSDB_CODE_INVALID_PARA;
|
||||
return terrno;
|
||||
}
|
||||
|
@ -564,7 +563,7 @@ int32_t tdGetBitmapValTypeI(const void *pBitmap, int16_t colIdx, TDRowValT *pVal
|
|||
|
||||
int32_t tdSetBitmapValTypeI(void *pBitmap, int16_t colIdx, TDRowValT valType) {
|
||||
if (!pBitmap || colIdx < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
terrno = TSDB_CODE_INVALID_PARA;
|
||||
return terrno;
|
||||
}
|
||||
|
@ -607,7 +606,7 @@ int32_t tdSetBitmapValTypeI(void *pBitmap, int16_t colIdx, TDRowValT valType) {
|
|||
// *pDestByte |= (valType);
|
||||
break;
|
||||
default:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
terrno = TSDB_CODE_INVALID_PARA;
|
||||
return terrno;
|
||||
}
|
||||
|
@ -616,7 +615,7 @@ int32_t tdSetBitmapValTypeI(void *pBitmap, int16_t colIdx, TDRowValT valType) {
|
|||
|
||||
int32_t tdGetKvRowValOfCol(SCellVal *output, STSRow *pRow, void *pBitmap, int32_t offset, int16_t colIdx) {
|
||||
#ifdef TD_SUPPORT_BITMAP
|
||||
tAssert(colIdx < tdRowGetNCols(pRow) - 1);
|
||||
ASSERT(colIdx < tdRowGetNCols(pRow) - 1);
|
||||
if (tdGetBitmapValType(pBitmap, colIdx, &output->valType, 0) != TSDB_CODE_SUCCESS) {
|
||||
output->valType = TD_VTYPE_NONE;
|
||||
return terrno;
|
||||
|
@ -630,7 +629,7 @@ int32_t tdGetKvRowValOfCol(SCellVal *output, STSRow *pRow, void *pBitmap, int32_
|
|||
output->val = POINTER_SHIFT(pRow, offset);
|
||||
}
|
||||
#else
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
if (offset < 0) {
|
||||
terrno = TSDB_CODE_INVALID_PARA;
|
||||
output->valType = TD_VTYPE_NONE;
|
||||
|
@ -680,7 +679,7 @@ int32_t tdAppendColValToRow(SRowBuilder *pBuilder, col_id_t colId, int8_t colTyp
|
|||
return terrno;
|
||||
}
|
||||
#else
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
terrno = TSDB_CODE_INVALID_PARA;
|
||||
return terrno;
|
||||
#endif
|
||||
|
@ -707,7 +706,7 @@ int32_t tdAppendColValToRow(SRowBuilder *pBuilder, col_id_t colId, int8_t colTyp
|
|||
if (!pBuilder->hasNone) pBuilder->hasNone = true;
|
||||
return TSDB_CODE_SUCCESS;
|
||||
default:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -722,7 +721,7 @@ int32_t tdAppendColValToRow(SRowBuilder *pBuilder, col_id_t colId, int8_t colTyp
|
|||
int32_t tdAppendColValToKvRow(SRowBuilder *pBuilder, TDRowValT valType, const void *val, bool isCopyVarData,
|
||||
int8_t colType, int16_t colIdx, int32_t offset, col_id_t colId) {
|
||||
if ((offset < (int32_t)sizeof(SKvRowIdx)) || (colIdx < 1)) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
terrno = TSDB_CODE_INVALID_PARA;
|
||||
return terrno;
|
||||
}
|
||||
|
@ -810,7 +809,7 @@ int32_t tdSRowSetExtendedInfo(SRowBuilder *pBuilder, int32_t nCols, int32_t nBou
|
|||
pBuilder->nCols = nCols;
|
||||
pBuilder->nBoundCols = nBoundCols;
|
||||
if (pBuilder->flen <= 0 || pBuilder->nCols <= 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
terrno = TSDB_CODE_INVALID_PARA;
|
||||
return terrno;
|
||||
}
|
||||
|
@ -832,7 +831,7 @@ int32_t tdSRowSetExtendedInfo(SRowBuilder *pBuilder, int32_t nCols, int32_t nBou
|
|||
int32_t tdSRowResetBuf(SRowBuilder *pBuilder, void *pBuf) {
|
||||
pBuilder->pBuf = (STSRow *)pBuf;
|
||||
if (!pBuilder->pBuf) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
terrno = TSDB_CODE_INVALID_PARA;
|
||||
return terrno;
|
||||
}
|
||||
|
@ -843,7 +842,7 @@ int32_t tdSRowResetBuf(SRowBuilder *pBuilder, void *pBuf) {
|
|||
TD_ROW_SET_INFO(pBuilder->pBuf, 0);
|
||||
TD_ROW_SET_TYPE(pBuilder->pBuf, pBuilder->rowType);
|
||||
|
||||
tAssert(pBuilder->nBitmaps > 0 && pBuilder->flen > 0);
|
||||
ASSERT(pBuilder->nBitmaps > 0 && pBuilder->flen > 0);
|
||||
|
||||
uint32_t len = 0;
|
||||
switch (pBuilder->rowType) {
|
||||
|
@ -869,7 +868,7 @@ int32_t tdSRowResetBuf(SRowBuilder *pBuilder, void *pBuf) {
|
|||
TD_ROW_SET_NCOLS(pBuilder->pBuf, pBuilder->nBoundCols);
|
||||
break;
|
||||
default:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
terrno = TSDB_CODE_INVALID_PARA;
|
||||
return terrno;
|
||||
}
|
||||
|
@ -880,12 +879,12 @@ int32_t tdSRowResetBuf(SRowBuilder *pBuilder, void *pBuf) {
|
|||
int32_t tdSRowGetBuf(SRowBuilder *pBuilder, void *pBuf) {
|
||||
pBuilder->pBuf = (STSRow *)pBuf;
|
||||
if (!pBuilder->pBuf) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
terrno = TSDB_CODE_INVALID_PARA;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
tAssert(pBuilder->nBitmaps > 0 && pBuilder->flen > 0);
|
||||
ASSERT(pBuilder->nBitmaps > 0 && pBuilder->flen > 0);
|
||||
|
||||
uint32_t len = 0;
|
||||
switch (pBuilder->rowType) {
|
||||
|
@ -900,7 +899,7 @@ int32_t tdSRowGetBuf(SRowBuilder *pBuilder, void *pBuf) {
|
|||
#endif
|
||||
break;
|
||||
default:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
terrno = TSDB_CODE_INVALID_PARA;
|
||||
return terrno;
|
||||
}
|
||||
|
@ -920,7 +919,7 @@ int32_t tdSRowSetTpInfo(SRowBuilder *pBuilder, int32_t nCols, int32_t flen) {
|
|||
pBuilder->flen = flen;
|
||||
pBuilder->nCols = nCols;
|
||||
if (pBuilder->flen <= 0 || pBuilder->nCols <= 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
terrno = TSDB_CODE_INVALID_PARA;
|
||||
return terrno;
|
||||
}
|
||||
|
@ -939,7 +938,7 @@ int32_t tdSRowSetInfo(SRowBuilder *pBuilder, int32_t nCols, int32_t nBoundCols,
|
|||
pBuilder->nCols = nCols;
|
||||
pBuilder->nBoundCols = nBoundCols;
|
||||
if (pBuilder->flen <= 0 || pBuilder->nCols <= 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
terrno = TSDB_CODE_INVALID_PARA;
|
||||
return terrno;
|
||||
}
|
||||
|
@ -968,7 +967,7 @@ int32_t tdGetBitmapValType(const void *pBitmap, int16_t colIdx, TDRowValT *pValT
|
|||
tdGetBitmapValTypeI(pBitmap, colIdx, pValType);
|
||||
break;
|
||||
default:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
terrno = TSDB_CODE_INVALID_PARA;
|
||||
return TSDB_CODE_FAILED;
|
||||
}
|
||||
|
@ -987,7 +986,7 @@ bool tdIsBitmapValTypeNorm(const void *pBitmap, int16_t idx, int8_t bitmapMode)
|
|||
|
||||
int32_t tdSetBitmapValTypeII(void *pBitmap, int16_t colIdx, TDRowValT valType) {
|
||||
if (!pBitmap || colIdx < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
terrno = TSDB_CODE_INVALID_PARA;
|
||||
return terrno;
|
||||
}
|
||||
|
@ -1014,7 +1013,7 @@ int32_t tdSetBitmapValTypeII(void *pBitmap, int16_t colIdx, TDRowValT valType) {
|
|||
// *pDestByte |= (valType);
|
||||
break;
|
||||
default:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
terrno = TSDB_CODE_INVALID_PARA;
|
||||
return terrno;
|
||||
}
|
||||
|
@ -1031,7 +1030,7 @@ int32_t tdSetBitmapValType(void *pBitmap, int16_t colIdx, TDRowValT valType, int
|
|||
tdSetBitmapValTypeI(pBitmap, colIdx, valType);
|
||||
break;
|
||||
default:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
terrno = TSDB_CODE_INVALID_PARA;
|
||||
return TSDB_CODE_FAILED;
|
||||
}
|
||||
|
@ -1070,14 +1069,14 @@ void tTSRowGetVal(STSRow *pRow, STSchema *pTSchema, int16_t iCol, SColVal *pColV
|
|||
SCellVal cv = {0};
|
||||
SValue value = {0};
|
||||
|
||||
tAssert((pTColumn->colId == PRIMARYKEY_TIMESTAMP_COL_ID) || (iCol > 0));
|
||||
ASSERT((pTColumn->colId == PRIMARYKEY_TIMESTAMP_COL_ID) || (iCol > 0));
|
||||
|
||||
if (TD_IS_TP_ROW(pRow)) {
|
||||
tdSTpRowGetVal(pRow, pTColumn->colId, pTColumn->type, pTSchema->flen, pTColumn->offset, iCol - 1, &cv);
|
||||
} else if (TD_IS_KV_ROW(pRow)) {
|
||||
tdSKvRowGetVal(pRow, pTColumn->colId, iCol - 1, &cv);
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
if (tdValTypeIsNone(cv.valType)) {
|
||||
|
|
|
@ -23,8 +23,6 @@
|
|||
#define _DEFAULT_SOURCE
|
||||
#include "ttime.h"
|
||||
|
||||
#include "tlog.h"
|
||||
|
||||
/*
|
||||
* mktime64 - Converts date to seconds.
|
||||
* Converts Gregorian date to seconds since 1970-01-01 00:00:00.
|
||||
|
@ -433,9 +431,9 @@ char getPrecisionUnit(int32_t precision) {
|
|||
}
|
||||
|
||||
int64_t convertTimePrecision(int64_t utime, int32_t fromPrecision, int32_t toPrecision) {
|
||||
tAssert(fromPrecision == TSDB_TIME_PRECISION_MILLI || fromPrecision == TSDB_TIME_PRECISION_MICRO ||
|
||||
ASSERT(fromPrecision == TSDB_TIME_PRECISION_MILLI || fromPrecision == TSDB_TIME_PRECISION_MICRO ||
|
||||
fromPrecision == TSDB_TIME_PRECISION_NANO);
|
||||
tAssert(toPrecision == TSDB_TIME_PRECISION_MILLI || toPrecision == TSDB_TIME_PRECISION_MICRO ||
|
||||
ASSERT(toPrecision == TSDB_TIME_PRECISION_MILLI || toPrecision == TSDB_TIME_PRECISION_MICRO ||
|
||||
toPrecision == TSDB_TIME_PRECISION_NANO);
|
||||
|
||||
switch (fromPrecision) {
|
||||
|
@ -454,7 +452,7 @@ int64_t convertTimePrecision(int64_t utime, int32_t fromPrecision, int32_t toPre
|
|||
}
|
||||
return utime * 1000000;
|
||||
default:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
return utime;
|
||||
}
|
||||
} // end from milli
|
||||
|
@ -470,7 +468,7 @@ int64_t convertTimePrecision(int64_t utime, int32_t fromPrecision, int32_t toPre
|
|||
}
|
||||
return utime * 1000;
|
||||
default:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
return utime;
|
||||
}
|
||||
} // end from micro
|
||||
|
@ -483,12 +481,12 @@ int64_t convertTimePrecision(int64_t utime, int32_t fromPrecision, int32_t toPre
|
|||
case TSDB_TIME_PRECISION_NANO:
|
||||
return utime;
|
||||
default:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
return utime;
|
||||
}
|
||||
} // end from nano
|
||||
default: {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
return utime; // only to pass windows compilation
|
||||
}
|
||||
} // end switch fromPrecision
|
||||
|
@ -830,7 +828,7 @@ int64_t taosTimeTruncate(int64_t t, const SInterval* pInterval, int32_t precisio
|
|||
}
|
||||
}
|
||||
|
||||
tAssert(pInterval->offset >= 0);
|
||||
ASSERT(pInterval->offset >= 0);
|
||||
|
||||
if (pInterval->offset > 0) {
|
||||
start = taosTimeAdd(start, pInterval->offset, pInterval->offsetUnit, precision);
|
||||
|
|
|
@ -111,7 +111,7 @@ STSchema *genSTSchema(int16_t nCols) {
|
|||
} break;
|
||||
|
||||
default:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -197,7 +197,7 @@ static int32_t genTestData(const char **data, int16_t nCols, SArray **pArray) {
|
|||
sscanf(data[i], "%" PRIu64, &colVal.value.u64);
|
||||
} break;
|
||||
default:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
taosArrayPush(*pArray, &colVal);
|
||||
}
|
||||
|
@ -297,7 +297,7 @@ void debugPrintTSRow(STSRow2 *row, STSchema *pTSchema, const char *tags, int32_t
|
|||
}
|
||||
|
||||
static int32_t checkSColVal(const char *rawVal, SColVal *cv, int8_t type) {
|
||||
tAssert(rawVal);
|
||||
ASSERT(rawVal);
|
||||
|
||||
if (COL_VAL_IS_NONE(cv)) {
|
||||
EXPECT_STRCASEEQ(rawVal, NONE_CSTR);
|
||||
|
|
|
@ -201,12 +201,7 @@ int mainWindows(int argc, char **argv) {
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (taosConvInit() != 0) {
|
||||
dError("failed to init conv");
|
||||
taosCloseLog();
|
||||
taosCleanupArgs();
|
||||
return -1;
|
||||
}
|
||||
taosConvInit();
|
||||
|
||||
if (global.dumpConfig) {
|
||||
dmDumpCfg();
|
||||
|
|
|
@ -139,7 +139,7 @@ int32_t smPutMsgToQueue(SSnodeMgmt *pMgmt, EQueueType qtype, SRpcMsg *pRpc) {
|
|||
|
||||
SSnode *pSnode = pMgmt->pSnode;
|
||||
if (pSnode == NULL) {
|
||||
dError("msg:%p failed to put into snode queue since %s, type:%s qtype:%d", pMsg, terrstr(),
|
||||
dError("snode: msg:%p failed to put into vnode queue since %s, type:%s qtype:%d", pMsg, terrstr(),
|
||||
TMSG_INFO(pMsg->msgType), qtype);
|
||||
taosFreeQitem(pMsg);
|
||||
rpcFreeCont(pRpc->pCont);
|
||||
|
@ -161,8 +161,7 @@ int32_t smPutMsgToQueue(SSnodeMgmt *pMgmt, EQueueType qtype, SRpcMsg *pRpc) {
|
|||
smPutNodeMsgToWriteQueue(pMgmt, pMsg);
|
||||
break;
|
||||
default:
|
||||
tAssertS(0, "msg:%p failed to put into snode queue since %s, type:%s qtype:%d", pMsg, terrstr(),
|
||||
TMSG_INFO(pMsg->msgType), qtype);
|
||||
ASSERT(0);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ void TestClient::DoInit() {
|
|||
// rpcInit.spi = 1;
|
||||
|
||||
clientRpc = rpcOpen(&rpcInit);
|
||||
tAssert(clientRpc);
|
||||
ASSERT(clientRpc);
|
||||
tsem_init(&this->sem, 0, 0);
|
||||
}
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ int32_t Testbase::SendShowReq(int8_t showType, const char* tb, const char* db) {
|
|||
tSerializeSRetrieveTableReq(pReq, contLen, &retrieveReq);
|
||||
|
||||
SRpcMsg* pRsp = SendReq(TDMT_MND_SYSTABLE_RETRIEVE, pReq, contLen);
|
||||
tAssert(pRsp->pCont != nullptr);
|
||||
ASSERT(pRsp->pCont != nullptr);
|
||||
|
||||
if (pRsp->contLen == 0) return -1;
|
||||
if (pRsp->code != 0) return -1;
|
||||
|
|
|
@ -133,9 +133,7 @@ static int32_t mndProcessConsumerRecoverMsg(SRpcMsg *pMsg) {
|
|||
SMnode *pMnode = pMsg->info.node;
|
||||
SMqConsumerRecoverMsg *pRecoverMsg = pMsg->pCont;
|
||||
SMqConsumerObj *pConsumer = mndAcquireConsumer(pMnode, pRecoverMsg->consumerId);
|
||||
|
||||
tAssertS(pConsumer != NULL, "receive consumer recover msg, consumer id %" PRId64 ", status %s",
|
||||
pRecoverMsg->consumerId, mndConsumerStatusName(pConsumer->status));
|
||||
ASSERT(pConsumer);
|
||||
|
||||
mInfo("receive consumer recover msg, consumer id %" PRId64 ", status %s", pRecoverMsg->consumerId,
|
||||
mndConsumerStatusName(pConsumer->status));
|
||||
|
@ -383,8 +381,7 @@ static int32_t mndProcessAskEpReq(SRpcMsg *pMsg) {
|
|||
return -1;
|
||||
}
|
||||
|
||||
tAssertS(strcmp(req.cgroup, pConsumer->cgroup) == 0, "cgroup:%s not match consumer:%s", req.cgroup,
|
||||
pConsumer->cgroup);
|
||||
ASSERT(strcmp(req.cgroup, pConsumer->cgroup) == 0);
|
||||
|
||||
atomic_store_32(&pConsumer->hbStatus, 0);
|
||||
|
||||
|
@ -433,7 +430,7 @@ static int32_t mndProcessAskEpReq(SRpcMsg *pMsg) {
|
|||
SMqSubscribeObj *pSub = mndAcquireSubscribe(pMnode, pConsumer->cgroup, topic);
|
||||
|
||||
// txn guarantees pSub is created
|
||||
tAssert(pSub != NULL);
|
||||
ASSERT(pSub);
|
||||
taosRLockLatch(&pSub->lock);
|
||||
|
||||
SMqSubTopicEp topicEp = {0};
|
||||
|
@ -441,7 +438,7 @@ static int32_t mndProcessAskEpReq(SRpcMsg *pMsg) {
|
|||
|
||||
// 2.1 fetch topic schema
|
||||
SMqTopicObj *pTopic = mndAcquireTopic(pMnode, topic);
|
||||
tAssertS(pTopic != NULL, "failed to acquire topic:%s", topic);
|
||||
ASSERT(pTopic);
|
||||
taosRLockLatch(&pTopic->lock);
|
||||
tstrncpy(topicEp.db, pTopic->db, TSDB_DB_FNAME_LEN);
|
||||
topicEp.schema.nCols = pTopic->schema.nCols;
|
||||
|
@ -777,8 +774,8 @@ static int32_t mndConsumerActionUpdate(SSdb *pSdb, SMqConsumerObj *pOldConsumer,
|
|||
taosWLockLatch(&pOldConsumer->lock);
|
||||
|
||||
if (pNewConsumer->updateType == CONSUMER_UPDATE__MODIFY) {
|
||||
tAssert(taosArrayGetSize(pOldConsumer->rebNewTopics) == 0);
|
||||
tAssert(taosArrayGetSize(pOldConsumer->rebRemovedTopics) == 0);
|
||||
ASSERT(taosArrayGetSize(pOldConsumer->rebNewTopics) == 0);
|
||||
ASSERT(taosArrayGetSize(pOldConsumer->rebRemovedTopics) == 0);
|
||||
|
||||
if (taosArrayGetSize(pNewConsumer->rebNewTopics) == 0 && taosArrayGetSize(pNewConsumer->rebRemovedTopics) == 0) {
|
||||
pOldConsumer->status = MQ_CONSUMER_STATUS__READY;
|
||||
|
@ -800,8 +797,8 @@ static int32_t mndConsumerActionUpdate(SSdb *pSdb, SMqConsumerObj *pOldConsumer,
|
|||
pOldConsumer->status = MQ_CONSUMER_STATUS__MODIFY;
|
||||
}
|
||||
} else if (pNewConsumer->updateType == CONSUMER_UPDATE__LOST) {
|
||||
tAssert(taosArrayGetSize(pOldConsumer->rebNewTopics) == 0);
|
||||
tAssert(taosArrayGetSize(pOldConsumer->rebRemovedTopics) == 0);
|
||||
ASSERT(taosArrayGetSize(pOldConsumer->rebNewTopics) == 0);
|
||||
ASSERT(taosArrayGetSize(pOldConsumer->rebRemovedTopics) == 0);
|
||||
|
||||
int32_t sz = taosArrayGetSize(pOldConsumer->currentTopics);
|
||||
/*pOldConsumer->rebRemovedTopics = taosArrayInit(sz, sizeof(void *));*/
|
||||
|
@ -814,8 +811,8 @@ static int32_t mndConsumerActionUpdate(SSdb *pSdb, SMqConsumerObj *pOldConsumer,
|
|||
|
||||
pOldConsumer->status = MQ_CONSUMER_STATUS__LOST;
|
||||
} else if (pNewConsumer->updateType == CONSUMER_UPDATE__RECOVER) {
|
||||
tAssert(taosArrayGetSize(pOldConsumer->currentTopics) == 0);
|
||||
tAssert(taosArrayGetSize(pOldConsumer->rebNewTopics) == 0);
|
||||
ASSERT(taosArrayGetSize(pOldConsumer->currentTopics) == 0);
|
||||
ASSERT(taosArrayGetSize(pOldConsumer->rebNewTopics) == 0);
|
||||
|
||||
int32_t sz = taosArrayGetSize(pOldConsumer->assignedTopics);
|
||||
for (int32_t i = 0; i < sz; i++) {
|
||||
|
@ -832,15 +829,15 @@ static int32_t mndConsumerActionUpdate(SSdb *pSdb, SMqConsumerObj *pOldConsumer,
|
|||
pOldConsumer->rebalanceTime = pNewConsumer->upTime;
|
||||
|
||||
} else if (pNewConsumer->updateType == CONSUMER_UPDATE__ADD) {
|
||||
tAssert(taosArrayGetSize(pNewConsumer->rebNewTopics) == 1);
|
||||
tAssert(taosArrayGetSize(pNewConsumer->rebRemovedTopics) == 0);
|
||||
ASSERT(taosArrayGetSize(pNewConsumer->rebNewTopics) == 1);
|
||||
ASSERT(taosArrayGetSize(pNewConsumer->rebRemovedTopics) == 0);
|
||||
|
||||
char *addedTopic = strdup(taosArrayGetP(pNewConsumer->rebNewTopics, 0));
|
||||
// not exist in current topic
|
||||
#if 1
|
||||
for (int32_t i = 0; i < taosArrayGetSize(pOldConsumer->currentTopics); i++) {
|
||||
char *topic = taosArrayGetP(pOldConsumer->currentTopics, i);
|
||||
tAssert(strcmp(topic, addedTopic) != 0);
|
||||
ASSERT(strcmp(topic, addedTopic) != 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -881,15 +878,15 @@ static int32_t mndConsumerActionUpdate(SSdb *pSdb, SMqConsumerObj *pOldConsumer,
|
|||
|
||||
atomic_add_fetch_32(&pOldConsumer->epoch, 1);
|
||||
} else if (pNewConsumer->updateType == CONSUMER_UPDATE__REMOVE) {
|
||||
tAssert(taosArrayGetSize(pNewConsumer->rebNewTopics) == 0);
|
||||
tAssert(taosArrayGetSize(pNewConsumer->rebRemovedTopics) == 1);
|
||||
ASSERT(taosArrayGetSize(pNewConsumer->rebNewTopics) == 0);
|
||||
ASSERT(taosArrayGetSize(pNewConsumer->rebRemovedTopics) == 1);
|
||||
char *removedTopic = taosArrayGetP(pNewConsumer->rebRemovedTopics, 0);
|
||||
|
||||
// not exist in new topic
|
||||
#if 1
|
||||
for (int32_t i = 0; i < taosArrayGetSize(pOldConsumer->rebNewTopics); i++) {
|
||||
char *topic = taosArrayGetP(pOldConsumer->rebNewTopics, i);
|
||||
tAssert(strcmp(topic, removedTopic) != 0);
|
||||
ASSERT(strcmp(topic, removedTopic) != 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -915,7 +912,7 @@ static int32_t mndConsumerActionUpdate(SSdb *pSdb, SMqConsumerObj *pOldConsumer,
|
|||
}
|
||||
}
|
||||
// must find the topic
|
||||
tAssert(i < sz);
|
||||
ASSERT(i < sz);
|
||||
|
||||
// set status
|
||||
if (taosArrayGetSize(pOldConsumer->rebNewTopics) == 0 && taosArrayGetSize(pOldConsumer->rebRemovedTopics) == 0) {
|
||||
|
|
|
@ -112,11 +112,7 @@ static SSdbRaw *mndDbActionEncode(SDbObj *pDb) {
|
|||
SDB_SET_INT8(pRaw, dataPos, pDb->cfg.hashMethod, _OVER)
|
||||
SDB_SET_INT32(pRaw, dataPos, pDb->cfg.numOfRetensions, _OVER)
|
||||
for (int32_t i = 0; i < pDb->cfg.numOfRetensions; ++i) {
|
||||
if (tAssertS(taosArrayGetSize(pDb->cfg.pRetensions) == pDb->cfg.numOfRetensions,
|
||||
"db:%s, numOfRetensions:%d not matched with %d", pDb->name, pDb->cfg.numOfRetensions,
|
||||
taosArrayGetSize(pDb->cfg.pRetensions))) {
|
||||
pDb->cfg.numOfRetensions = taosArrayGetSize(pDb->cfg.pRetensions);
|
||||
}
|
||||
ASSERT(taosArrayGetSize(pDb->cfg.pRetensions) == pDb->cfg.numOfRetensions);
|
||||
SRetention *pRetension = taosArrayGet(pDb->cfg.pRetensions, i);
|
||||
SDB_SET_INT64(pRaw, dataPos, pRetension->freq, _OVER)
|
||||
SDB_SET_INT64(pRaw, dataPos, pRetension->keep, _OVER)
|
||||
|
@ -802,7 +798,7 @@ static int32_t mndProcessAlterDbReq(SRpcMsg *pReq) {
|
|||
terrno = TSDB_CODE_INVALID_MSG;
|
||||
goto _OVER;
|
||||
}
|
||||
mInfo("====>1");
|
||||
|
||||
mInfo("db:%s, start to alter", alterReq.db);
|
||||
|
||||
pDb = mndAcquireDb(pMnode, alterReq.db);
|
||||
|
@ -829,13 +825,7 @@ static int32_t mndProcessAlterDbReq(SRpcMsg *pReq) {
|
|||
dbObj.cfgVersion++;
|
||||
dbObj.updateTime = taosGetTimestampMs();
|
||||
code = mndAlterDb(pMnode, pReq, pDb, &dbObj);
|
||||
|
||||
if (dbObj.cfg.replications != pDb->cfg.replications) {
|
||||
// return quickly, operation executed asynchronously
|
||||
mInfo("db:%s, alter db replica from %d to %d", pDb->name, pDb->cfg.replications, dbObj.cfg.replications);
|
||||
} else {
|
||||
if (code == 0) code = TSDB_CODE_ACTION_IN_PROGRESS;
|
||||
}
|
||||
if (code == 0) code = TSDB_CODE_ACTION_IN_PROGRESS;
|
||||
|
||||
_OVER:
|
||||
if (code != 0 && code != TSDB_CODE_ACTION_IN_PROGRESS) {
|
||||
|
|
|
@ -489,7 +489,7 @@ int32_t tEncodeSubscribeObj(void **buf, const SMqSubscribeObj *pSub) {
|
|||
tlen += tEncodeSMqConsumerEp(buf, pConsumerEp);
|
||||
cnt++;
|
||||
}
|
||||
tAssert(cnt == sz);
|
||||
ASSERT(cnt == sz);
|
||||
tlen += taosEncodeArray(buf, pSub->unassignedVgs, (FEncode)tEncodeSMqVgEp);
|
||||
tlen += taosEncodeString(buf, pSub->dbName);
|
||||
return tlen;
|
||||
|
|
|
@ -755,6 +755,7 @@ static void mndReloadSyncConfig(SMnode *pMnode) {
|
|||
mInfo("vgId:1, mnode sync not reconfig since readyMnodes:%d updatingMnodes:%d", readyMnodes, updatingMnodes);
|
||||
return;
|
||||
}
|
||||
// ASSERT(0);
|
||||
|
||||
if (cfg.myIndex == -1) {
|
||||
#if 1
|
||||
|
|
|
@ -115,13 +115,13 @@ int32_t mndAddDispatcherToInnerTask(SMnode* pMnode, SStreamObj* pStream, SStream
|
|||
|
||||
if (pStream->fixedSinkVgId == 0) {
|
||||
SDbObj* pDb = mndAcquireDb(pMnode, pStream->targetDb);
|
||||
tAssert(pDb != NULL);
|
||||
ASSERT(pDb);
|
||||
if (pDb->cfg.numOfVgroups > 1) {
|
||||
isShuffle = true;
|
||||
pTask->outputType = TASK_OUTPUT__SHUFFLE_DISPATCH;
|
||||
pTask->dispatchMsgType = TDMT_STREAM_TASK_DISPATCH;
|
||||
if (mndExtractDbInfo(pMnode, pDb, &pTask->shuffleDispatcher.dbInfo, NULL) < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
@ -140,9 +140,9 @@ int32_t mndAddDispatcherToInnerTask(SMnode* pMnode, SStreamObj* pStream, SStream
|
|||
for (int32_t j = 0; j < sinkLvSize; j++) {
|
||||
SStreamTask* pLastLevelTask = taosArrayGetP(sinkLv, j);
|
||||
if (pLastLevelTask->nodeId == pVgInfo->vgId) {
|
||||
tAssert(pVgInfo->vgId > 0);
|
||||
ASSERT(pVgInfo->vgId > 0);
|
||||
pVgInfo->taskId = pLastLevelTask->taskId;
|
||||
tAssert(pVgInfo->taskId != 0);
|
||||
ASSERT(pVgInfo->taskId != 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -152,7 +152,7 @@ int32_t mndAddDispatcherToInnerTask(SMnode* pMnode, SStreamObj* pStream, SStream
|
|||
pTask->dispatchMsgType = TDMT_STREAM_TASK_DISPATCH;
|
||||
SArray* pArray = taosArrayGetP(pStream->tasks, 0);
|
||||
// one sink only
|
||||
tAssert(taosArrayGetSize(pArray) == 1);
|
||||
ASSERT(taosArrayGetSize(pArray) == 1);
|
||||
SStreamTask* lastLevelTask = taosArrayGetP(pArray, 0);
|
||||
pTask->fixedEpDispatcher.taskId = lastLevelTask->taskId;
|
||||
pTask->fixedEpDispatcher.nodeId = lastLevelTask->nodeId;
|
||||
|
@ -170,7 +170,7 @@ int32_t mndAssignTaskToVg(SMnode* pMnode, SStreamTask* pTask, SSubplan* plan, co
|
|||
plan->execNode.epSet = pTask->epSet;
|
||||
|
||||
if (qSubPlanToString(plan, &pTask->exec.qmsg, &msgLen) < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
terrno = TSDB_CODE_QRY_INVALID_INPUT;
|
||||
return -1;
|
||||
}
|
||||
|
@ -195,7 +195,7 @@ int32_t mndAssignTaskToSnode(SMnode* pMnode, SStreamTask* pTask, SSubplan* plan,
|
|||
plan->execNode.epSet = pTask->epSet;
|
||||
|
||||
if (qSubPlanToString(plan, &pTask->exec.qmsg, &msgLen) < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
terrno = TSDB_CODE_QRY_INVALID_INPUT;
|
||||
return -1;
|
||||
}
|
||||
|
@ -222,7 +222,7 @@ int32_t mndAddShuffleSinkTasksToStream(SMnode* pMnode, SStreamObj* pStream) {
|
|||
void* pIter = NULL;
|
||||
SArray* tasks = taosArrayGetP(pStream->tasks, 0);
|
||||
|
||||
tAssert(taosArrayGetSize(pStream->tasks) == 1);
|
||||
ASSERT(taosArrayGetSize(pStream->tasks) == 1);
|
||||
|
||||
while (1) {
|
||||
SVgObj* pVgroup = NULL;
|
||||
|
@ -257,7 +257,7 @@ int32_t mndAddShuffleSinkTasksToStream(SMnode* pMnode, SStreamObj* pStream) {
|
|||
pTask->tbSink.stbUid = pStream->targetStbUid;
|
||||
memcpy(pTask->tbSink.stbFullName, pStream->targetSTbName, TSDB_TABLE_FNAME_LEN);
|
||||
pTask->tbSink.pSchemaWrapper = tCloneSSchemaWrapper(&pStream->outputSchema);
|
||||
tAssert(pTask->tbSink.pSchemaWrapper);
|
||||
ASSERT(pTask->tbSink.pSchemaWrapper);
|
||||
}
|
||||
sdbRelease(pSdb, pVgroup);
|
||||
}
|
||||
|
@ -265,7 +265,7 @@ int32_t mndAddShuffleSinkTasksToStream(SMnode* pMnode, SStreamObj* pStream) {
|
|||
}
|
||||
|
||||
int32_t mndAddFixedSinkTaskToStream(SMnode* pMnode, SStreamObj* pStream) {
|
||||
tAssert(pStream->fixedSinkVgId != 0);
|
||||
ASSERT(pStream->fixedSinkVgId != 0);
|
||||
SArray* tasks = taosArrayGetP(pStream->tasks, 0);
|
||||
SStreamTask* pTask = tNewSStreamTask(pStream->uid);
|
||||
if (pTask == NULL) {
|
||||
|
@ -275,7 +275,7 @@ int32_t mndAddFixedSinkTaskToStream(SMnode* pMnode, SStreamObj* pStream) {
|
|||
pTask->fillHistory = pStream->fillHistory;
|
||||
mndAddTaskToTaskSet(tasks, pTask);
|
||||
|
||||
tAssert(pStream->fixedSinkVg.vgId == pStream->fixedSinkVgId);
|
||||
ASSERT(pStream->fixedSinkVg.vgId == pStream->fixedSinkVgId);
|
||||
|
||||
pTask->nodeId = pStream->fixedSinkVgId;
|
||||
#if 0
|
||||
|
@ -311,13 +311,13 @@ int32_t mndScheduleStream(SMnode* pMnode, SStreamObj* pStream) {
|
|||
return -1;
|
||||
}
|
||||
int32_t planTotLevel = LIST_LENGTH(pPlan->pSubplans);
|
||||
tAssert(planTotLevel <= 2);
|
||||
ASSERT(planTotLevel <= 2);
|
||||
pStream->tasks = taosArrayInit(planTotLevel, sizeof(void*));
|
||||
|
||||
bool hasExtraSink = false;
|
||||
bool externalTargetDB = strcmp(pStream->sourceDb, pStream->targetDb) != 0;
|
||||
SDbObj* pDbObj = mndAcquireDb(pMnode, pStream->targetDb);
|
||||
tAssert(pDbObj != NULL);
|
||||
ASSERT(pDbObj != NULL);
|
||||
|
||||
bool multiTarget = pDbObj->cfg.numOfVgroups > 1;
|
||||
sdbRelease(pSdb, pDbObj);
|
||||
|
@ -351,7 +351,7 @@ int32_t mndScheduleStream(SMnode* pMnode, SStreamObj* pStream) {
|
|||
|
||||
SNodeListNode* inner = (SNodeListNode*)nodesListGetNode(pPlan->pSubplans, 0);
|
||||
SSubplan* plan = (SSubplan*)nodesListGetNode(inner->pNodeList, 0);
|
||||
tAssert(plan->subplanType == SUBPLAN_TYPE_MERGE);
|
||||
ASSERT(plan->subplanType == SUBPLAN_TYPE_MERGE);
|
||||
|
||||
pInnerTask = tNewSStreamTask(pStream->uid);
|
||||
if (pInnerTask == NULL) {
|
||||
|
@ -409,7 +409,7 @@ int32_t mndScheduleStream(SMnode* pMnode, SStreamObj* pStream) {
|
|||
|
||||
SNodeListNode* inner = (SNodeListNode*)nodesListGetNode(pPlan->pSubplans, 1);
|
||||
SSubplan* plan = (SSubplan*)nodesListGetNode(inner->pNodeList, 0);
|
||||
tAssert(plan->subplanType == SUBPLAN_TYPE_SCAN);
|
||||
ASSERT(plan->subplanType == SUBPLAN_TYPE_SCAN);
|
||||
|
||||
void* pIter = NULL;
|
||||
while (1) {
|
||||
|
@ -471,9 +471,9 @@ int32_t mndScheduleStream(SMnode* pMnode, SStreamObj* pStream) {
|
|||
taosArrayPush(pStream->tasks, &taskOneLevel);
|
||||
|
||||
SNodeListNode* inner = (SNodeListNode*)nodesListGetNode(pPlan->pSubplans, 0);
|
||||
tAssert(LIST_LENGTH(inner->pNodeList) == 1);
|
||||
ASSERT(LIST_LENGTH(inner->pNodeList) == 1);
|
||||
SSubplan* plan = (SSubplan*)nodesListGetNode(inner->pNodeList, 0);
|
||||
tAssert(plan->subplanType == SUBPLAN_TYPE_SCAN);
|
||||
ASSERT(plan->subplanType == SUBPLAN_TYPE_SCAN);
|
||||
|
||||
void* pIter = NULL;
|
||||
while (1) {
|
||||
|
@ -550,8 +550,8 @@ int32_t mndSchedInitSubEp(SMnode* pMnode, const SMqTopicObj* pTopic, SMqSubscrib
|
|||
plan = (SSubplan*)nodesListGetNode(inner->pNodeList, 0);
|
||||
}
|
||||
|
||||
tAssert(pSub->unassignedVgs);
|
||||
tAssert(taosHashGetSize(pSub->consumerHash) == 0);
|
||||
ASSERT(pSub->unassignedVgs);
|
||||
ASSERT(taosHashGetSize(pSub->consumerHash) == 0);
|
||||
|
||||
void* pIter = NULL;
|
||||
while (1) {
|
||||
|
@ -590,9 +590,9 @@ int32_t mndSchedInitSubEp(SMnode* pMnode, const SMqTopicObj* pTopic, SMqSubscrib
|
|||
sdbRelease(pSdb, pVgroup);
|
||||
}
|
||||
|
||||
tAssert(pSub->unassignedVgs->size > 0);
|
||||
ASSERT(pSub->unassignedVgs->size > 0);
|
||||
|
||||
tAssert(taosHashGetSize(pSub->consumerHash) == 0);
|
||||
ASSERT(taosHashGetSize(pSub->consumerHash) == 0);
|
||||
|
||||
qDestroyQueryPlan(pPlan);
|
||||
|
||||
|
|
|
@ -111,6 +111,7 @@ static int32_t convertToRetrieveType(char *name, int32_t len) {
|
|||
} else if (strncasecmp(name, TSDB_INS_TABLE_USER_PRIVILEGES, len) == 0) {
|
||||
type = TSDB_MGMT_TABLE_PRIVILEGES;
|
||||
} else {
|
||||
// ASSERT(0);
|
||||
}
|
||||
|
||||
return type;
|
||||
|
|
|
@ -488,7 +488,7 @@ static int32_t mndCreateSma(SMnode *pMnode, SRpcMsg *pReq, SMCreateSmaReq *pCrea
|
|||
memcpy(smaObj.db, pDb->name, TSDB_DB_FNAME_LEN);
|
||||
smaObj.createdTime = taosGetTimestampMs();
|
||||
smaObj.uid = mndGenerateUid(pCreate->name, TSDB_TABLE_FNAME_LEN);
|
||||
tAssert(smaObj.uid != 0);
|
||||
ASSERT(smaObj.uid != 0);
|
||||
char resultTbName[TSDB_TABLE_FNAME_LEN + 16] = {0};
|
||||
snprintf(resultTbName, TSDB_TABLE_FNAME_LEN + 16, "%s_td_tsma_rst_tb", pCreate->name);
|
||||
memcpy(smaObj.dstTbName, resultTbName, TSDB_TABLE_FNAME_LEN);
|
||||
|
@ -558,13 +558,13 @@ static int32_t mndCreateSma(SMnode *pMnode, SRpcMsg *pReq, SMCreateSmaReq *pCrea
|
|||
|
||||
SNode *pAst = NULL;
|
||||
if (nodesStringToNode(streamObj.ast, &pAst) < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
return -1;
|
||||
}
|
||||
|
||||
// extract output schema from ast
|
||||
if (qExtractResultSchema(pAst, (int32_t *)&streamObj.outputSchema.nCols, &streamObj.outputSchema.pSchema) != 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -579,13 +579,13 @@ static int32_t mndCreateSma(SMnode *pMnode, SRpcMsg *pReq, SMCreateSmaReq *pCrea
|
|||
};
|
||||
|
||||
if (qCreateQueryPlan(&cxt, &pPlan, NULL) < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
return -1;
|
||||
}
|
||||
|
||||
// save physcial plan
|
||||
if (nodesNodeToString((SNode *)pPlan, false, &streamObj.physicalPlan, NULL) != 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
return -1;
|
||||
}
|
||||
if (pAst != NULL) nodesDestroyNode(pAst);
|
||||
|
@ -822,14 +822,14 @@ static int32_t mndDropSma(SMnode *pMnode, SRpcMsg *pReq, SDbObj *pDb, SSmaObj *p
|
|||
if (mndDropStreamTasks(pMnode, pTrans, pStream) < 0) {
|
||||
mError("stream:%s, failed to drop task since %s", pStream->name, terrstr());
|
||||
sdbRelease(pMnode->pSdb, pStream);
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
goto _OVER;
|
||||
}
|
||||
|
||||
// drop stream
|
||||
if (mndPersistDropStreamLog(pMnode, pTrans, pStream) < 0) {
|
||||
sdbRelease(pMnode->pSdb, pStream);
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
goto _OVER;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1176,7 +1176,7 @@ static int32_t mndCheckAlterColForTopic(SMnode *pMnode, const char *stbFullName,
|
|||
|
||||
SNode *pAst = NULL;
|
||||
if (nodesStringToNode(pTopic->ast, &pAst) != 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -1221,7 +1221,7 @@ static int32_t mndCheckAlterColForStream(SMnode *pMnode, const char *stbFullName
|
|||
|
||||
SNode *pAst = NULL;
|
||||
if (nodesStringToNode(pStream->ast, &pAst) != 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -2091,7 +2091,7 @@ static int32_t mndCheckDropStbForTopic(SMnode *pMnode, const char *stbFullName,
|
|||
|
||||
SNode *pAst = NULL;
|
||||
if (nodesStringToNode(pTopic->ast, &pAst) != 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -2138,7 +2138,7 @@ static int32_t mndCheckDropStbForStream(SMnode *pMnode, const char *stbFullName,
|
|||
|
||||
SNode *pAst = NULL;
|
||||
if (nodesStringToNode(pStream->ast, &pAst) != 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -325,13 +325,13 @@ static int32_t mndBuildStreamObjFromCreateReq(SMnode *pMnode, SStreamObj *pObj,
|
|||
|
||||
// deserialize ast
|
||||
if (nodesStringToNode(pObj->ast, &pAst) < 0) {
|
||||
/*tAssert(0);*/
|
||||
/*ASSERT(0);*/
|
||||
goto FAIL;
|
||||
}
|
||||
|
||||
// extract output schema from ast
|
||||
if (qExtractResultSchema(pAst, (int32_t *)&pObj->outputSchema.nCols, &pObj->outputSchema.pSchema) != 0) {
|
||||
/*tAssert(0);*/
|
||||
/*ASSERT(0);*/
|
||||
goto FAIL;
|
||||
}
|
||||
|
||||
|
@ -346,13 +346,13 @@ static int32_t mndBuildStreamObjFromCreateReq(SMnode *pMnode, SStreamObj *pObj,
|
|||
|
||||
// using ast and param to build physical plan
|
||||
if (qCreateQueryPlan(&cxt, &pPlan, NULL) < 0) {
|
||||
/*tAssert(0);*/
|
||||
/*ASSERT(0);*/
|
||||
goto FAIL;
|
||||
}
|
||||
|
||||
// save physcial plan
|
||||
if (nodesNodeToString((SNode *)pPlan, false, &pObj->physicalPlan, NULL) != 0) {
|
||||
/*tAssert(0);*/
|
||||
/*ASSERT(0);*/
|
||||
goto FAIL;
|
||||
}
|
||||
|
||||
|
@ -360,7 +360,7 @@ static int32_t mndBuildStreamObjFromCreateReq(SMnode *pMnode, SStreamObj *pObj,
|
|||
if (pCreate->numOfTags) {
|
||||
pObj->tagSchema.pSchema = taosMemoryCalloc(pCreate->numOfTags, sizeof(SSchema));
|
||||
}
|
||||
tAssert(pCreate->numOfTags == taosArrayGetSize(pCreate->pTags));
|
||||
ASSERT(pCreate->numOfTags == taosArrayGetSize(pCreate->pTags));
|
||||
for (int32_t i = 0; i < pCreate->numOfTags; i++) {
|
||||
SField *pField = taosArrayGet(pCreate->pTags, i);
|
||||
pObj->tagSchema.pSchema[i].colId = pObj->outputSchema.nCols + i + 1;
|
||||
|
@ -378,7 +378,7 @@ FAIL:
|
|||
|
||||
int32_t mndPersistTaskDeployReq(STrans *pTrans, const SStreamTask *pTask) {
|
||||
if (pTask->taskLevel == TASK_LEVEL__AGG) {
|
||||
tAssert(taosArrayGetSize(pTask->childEpInfo) != 0);
|
||||
ASSERT(taosArrayGetSize(pTask->childEpInfo) != 0);
|
||||
}
|
||||
SEncoder encoder;
|
||||
tEncoderInit(&encoder, NULL, 0);
|
||||
|
@ -544,7 +544,7 @@ _OVER:
|
|||
}
|
||||
|
||||
static int32_t mndPersistTaskDropReq(STrans *pTrans, SStreamTask *pTask) {
|
||||
tAssert(pTask->nodeId != 0);
|
||||
ASSERT(pTask->nodeId != 0);
|
||||
|
||||
// vnode
|
||||
/*if (pTask->nodeId > 0) {*/
|
||||
|
@ -790,10 +790,10 @@ static int32_t mndProcessStreamDoCheckpoint(SRpcMsg *pReq) {
|
|||
int32_t sz = taosArrayGetSize(pLevel);
|
||||
for (int32_t j = 0; j < sz; j++) {
|
||||
SStreamTask *pTask = taosArrayGetP(pLevel, j);
|
||||
tAssert(pTask->nodeId > 0);
|
||||
ASSERT(pTask->nodeId > 0);
|
||||
SVgObj *pVgObj = mndAcquireVgroup(pMnode, pTask->nodeId);
|
||||
if (pVgObj == NULL) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
taosRUnLockLatch(&pStream->lock);
|
||||
mndReleaseStream(pMnode, pStream);
|
||||
mndTransDrop(pTrans);
|
||||
|
@ -853,7 +853,7 @@ static int32_t mndProcessDropStreamReq(SRpcMsg *pReq) {
|
|||
|
||||
SMDropStreamReq dropReq = {0};
|
||||
if (tDeserializeSMDropStreamReq(pReq->pCont, pReq->contLen, &dropReq) < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
terrno = TSDB_CODE_INVALID_MSG;
|
||||
return -1;
|
||||
}
|
||||
|
|
|
@ -96,8 +96,8 @@ static SMqSubscribeObj *mndCreateSub(SMnode *pMnode, const SMqTopicObj *pTopic,
|
|||
pSub->subType = pTopic->subType;
|
||||
pSub->withMeta = pTopic->withMeta;
|
||||
|
||||
tAssert(pSub->unassignedVgs->size == 0);
|
||||
tAssert(taosHashGetSize(pSub->consumerHash) == 0);
|
||||
ASSERT(pSub->unassignedVgs->size == 0);
|
||||
ASSERT(taosHashGetSize(pSub->consumerHash) == 0);
|
||||
|
||||
if (mndSchedInitSubEp(pMnode, pTopic, pSub) < 0) {
|
||||
tDeleteSubscribeObj(pSub);
|
||||
|
@ -105,8 +105,8 @@ static SMqSubscribeObj *mndCreateSub(SMnode *pMnode, const SMqTopicObj *pTopic,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
tAssert(pSub->unassignedVgs->size > 0);
|
||||
tAssert(taosHashGetSize(pSub->consumerHash) == 0);
|
||||
ASSERT(pSub->unassignedVgs->size > 0);
|
||||
ASSERT(taosHashGetSize(pSub->consumerHash) == 0);
|
||||
|
||||
return pSub;
|
||||
}
|
||||
|
@ -144,7 +144,7 @@ static int32_t mndBuildSubChangeReq(void **pBuf, int32_t *pLen, const SMqSubscri
|
|||
|
||||
static int32_t mndPersistSubChangeVgReq(SMnode *pMnode, STrans *pTrans, const SMqSubscribeObj *pSub,
|
||||
const SMqRebOutputVg *pRebVg) {
|
||||
tAssert(pRebVg->oldConsumerId != pRebVg->newConsumerId);
|
||||
ASSERT(pRebVg->oldConsumerId != pRebVg->newConsumerId);
|
||||
|
||||
void *buf;
|
||||
int32_t tlen;
|
||||
|
@ -155,7 +155,7 @@ static int32_t mndPersistSubChangeVgReq(SMnode *pMnode, STrans *pTrans, const SM
|
|||
int32_t vgId = pRebVg->pVgEp->vgId;
|
||||
SVgObj *pVgObj = mndAcquireVgroup(pMnode, vgId);
|
||||
if (pVgObj == NULL) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
taosMemoryFree(buf);
|
||||
return -1;
|
||||
}
|
||||
|
@ -218,11 +218,11 @@ static int32_t mndDoRebalance(SMnode *pMnode, const SMqRebInputObj *pInput, SMqR
|
|||
int32_t actualRemoved = 0;
|
||||
for (int32_t i = 0; i < removedNum; i++) {
|
||||
int64_t consumerId = *(int64_t *)taosArrayGet(pInput->pRebInfo->removedConsumers, i);
|
||||
tAssert(consumerId > 0);
|
||||
ASSERT(consumerId > 0);
|
||||
SMqConsumerEp *pConsumerEp = taosHashGet(pOutput->pSub->consumerHash, &consumerId, sizeof(int64_t));
|
||||
tAssert(pConsumerEp);
|
||||
ASSERT(pConsumerEp);
|
||||
if (pConsumerEp) {
|
||||
tAssert(consumerId == pConsumerEp->consumerId);
|
||||
ASSERT(consumerId == pConsumerEp->consumerId);
|
||||
actualRemoved++;
|
||||
int32_t consumerVgNum = taosArrayGetSize(pConsumerEp->vgs);
|
||||
for (int32_t j = 0; j < consumerVgNum; j++) {
|
||||
|
@ -241,7 +241,7 @@ static int32_t mndDoRebalance(SMnode *pMnode, const SMqRebInputObj *pInput, SMqR
|
|||
taosArrayPush(pOutput->removedConsumers, &consumerId);
|
||||
}
|
||||
}
|
||||
tAssert(removedNum == actualRemoved);
|
||||
ASSERT(removedNum == actualRemoved);
|
||||
|
||||
// if previously no consumer, there are vgs not assigned
|
||||
{
|
||||
|
@ -278,7 +278,7 @@ static int32_t mndDoRebalance(SMnode *pMnode, const SMqRebInputObj *pInput, SMqR
|
|||
pIter = taosHashIterate(pOutput->pSub->consumerHash, pIter);
|
||||
if (pIter == NULL) break;
|
||||
SMqConsumerEp *pConsumerEp = (SMqConsumerEp *)pIter;
|
||||
tAssert(pConsumerEp->consumerId > 0);
|
||||
ASSERT(pConsumerEp->consumerId > 0);
|
||||
int32_t consumerVgNum = taosArrayGetSize(pConsumerEp->vgs);
|
||||
// all old consumers still existing are touched
|
||||
// TODO optimize: touch only consumer whose vgs changed
|
||||
|
@ -325,7 +325,7 @@ static int32_t mndDoRebalance(SMnode *pMnode, const SMqRebInputObj *pInput, SMqR
|
|||
int32_t consumerNum = taosArrayGetSize(pInput->pRebInfo->newConsumers);
|
||||
for (int32_t i = 0; i < consumerNum; i++) {
|
||||
int64_t consumerId = *(int64_t *)taosArrayGet(pInput->pRebInfo->newConsumers, i);
|
||||
tAssert(consumerId > 0);
|
||||
ASSERT(consumerId > 0);
|
||||
SMqConsumerEp newConsumerEp;
|
||||
newConsumerEp.consumerId = consumerId;
|
||||
newConsumerEp.vgs = taosArrayInit(0, sizeof(void *));
|
||||
|
@ -344,13 +344,13 @@ static int32_t mndDoRebalance(SMnode *pMnode, const SMqRebInputObj *pInput, SMqR
|
|||
pIter = taosHashIterate(pOutput->pSub->consumerHash, pIter);
|
||||
if (pIter == NULL) break;
|
||||
SMqConsumerEp *pConsumerEp = (SMqConsumerEp *)pIter;
|
||||
tAssert(pConsumerEp->consumerId > 0);
|
||||
ASSERT(pConsumerEp->consumerId > 0);
|
||||
|
||||
// push until equal minVg
|
||||
while (taosArrayGetSize(pConsumerEp->vgs) < minVgCnt) {
|
||||
// iter hash and find one vg
|
||||
pRemovedIter = taosHashIterate(pHash, pRemovedIter);
|
||||
tAssert(pRemovedIter);
|
||||
ASSERT(pRemovedIter);
|
||||
pRebVg = (SMqRebOutputVg *)pRemovedIter;
|
||||
// push
|
||||
taosArrayPush(pConsumerEp->vgs, &pRebVg->pVgEp);
|
||||
|
@ -361,7 +361,7 @@ static int32_t mndDoRebalance(SMnode *pMnode, const SMqRebInputObj *pInput, SMqR
|
|||
}
|
||||
}
|
||||
|
||||
tAssert(pIter == NULL);
|
||||
ASSERT(pIter == NULL);
|
||||
// 7. handle unassigned vg
|
||||
if (taosHashGetSize(pOutput->pSub->consumerHash) != 0) {
|
||||
// if has consumer, assign all left vg
|
||||
|
@ -377,9 +377,9 @@ static int32_t mndDoRebalance(SMnode *pMnode, const SMqRebInputObj *pInput, SMqR
|
|||
}
|
||||
while (1) {
|
||||
pIter = taosHashIterate(pOutput->pSub->consumerHash, pIter);
|
||||
tAssert(pIter);
|
||||
ASSERT(pIter);
|
||||
pConsumerEp = (SMqConsumerEp *)pIter;
|
||||
tAssert(pConsumerEp->consumerId > 0);
|
||||
ASSERT(pConsumerEp->consumerId > 0);
|
||||
if (taosArrayGetSize(pConsumerEp->vgs) == minVgCnt) {
|
||||
break;
|
||||
}
|
||||
|
@ -404,7 +404,7 @@ static int32_t mndDoRebalance(SMnode *pMnode, const SMqRebInputObj *pInput, SMqR
|
|||
pIter = taosHashIterate(pHash, pIter);
|
||||
if (pIter == NULL) break;
|
||||
pRebOutput = (SMqRebOutputVg *)pIter;
|
||||
tAssert(pRebOutput->newConsumerId == -1);
|
||||
ASSERT(pRebOutput->newConsumerId == -1);
|
||||
taosArrayPush(pOutput->pSub->unassignedVgs, &pRebOutput->pVgEp);
|
||||
taosArrayPush(pOutput->rebVgs, pRebOutput);
|
||||
mInfo("mq rebalance: unassign vgId:%d (second scan)", pRebOutput->pVgEp->vgId);
|
||||
|
@ -482,7 +482,7 @@ static int32_t mndPersistRebResult(SMnode *pMnode, SRpcMsg *pMsg, const SMqRebOu
|
|||
consumerNum = taosArrayGetSize(pOutput->newConsumers);
|
||||
for (int32_t i = 0; i < consumerNum; i++) {
|
||||
int64_t consumerId = *(int64_t *)taosArrayGet(pOutput->newConsumers, i);
|
||||
tAssert(consumerId > 0);
|
||||
ASSERT(consumerId > 0);
|
||||
SMqConsumerObj *pConsumerOld = mndAcquireConsumer(pMnode, consumerId);
|
||||
SMqConsumerObj *pConsumerNew = tNewSMqConsumerObj(pConsumerOld->consumerId, pConsumerOld->cgroup);
|
||||
pConsumerNew->updateType = CONSUMER_UPDATE__ADD;
|
||||
|
@ -492,7 +492,7 @@ static int32_t mndPersistRebResult(SMnode *pMnode, SRpcMsg *pMsg, const SMqRebOu
|
|||
taosArrayPush(pConsumerNew->rebNewTopics, &topic);
|
||||
mndReleaseConsumer(pMnode, pConsumerOld);
|
||||
if (mndSetConsumerCommitLogs(pMnode, pTrans, pConsumerNew) != 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
tDeleteSMqConsumerObj(pConsumerNew);
|
||||
taosMemoryFree(pConsumerNew);
|
||||
goto REB_FAIL;
|
||||
|
@ -505,7 +505,7 @@ static int32_t mndPersistRebResult(SMnode *pMnode, SRpcMsg *pMsg, const SMqRebOu
|
|||
consumerNum = taosArrayGetSize(pOutput->removedConsumers);
|
||||
for (int32_t i = 0; i < consumerNum; i++) {
|
||||
int64_t consumerId = *(int64_t *)taosArrayGet(pOutput->removedConsumers, i);
|
||||
tAssert(consumerId > 0);
|
||||
ASSERT(consumerId > 0);
|
||||
SMqConsumerObj *pConsumerOld = mndAcquireConsumer(pMnode, consumerId);
|
||||
SMqConsumerObj *pConsumerNew = tNewSMqConsumerObj(pConsumerOld->consumerId, pConsumerOld->cgroup);
|
||||
pConsumerNew->updateType = CONSUMER_UPDATE__REMOVE;
|
||||
|
@ -515,7 +515,7 @@ static int32_t mndPersistRebResult(SMnode *pMnode, SRpcMsg *pMsg, const SMqRebOu
|
|||
taosArrayPush(pConsumerNew->rebRemovedTopics, &topic);
|
||||
mndReleaseConsumer(pMnode, pConsumerOld);
|
||||
if (mndSetConsumerCommitLogs(pMnode, pTrans, pConsumerNew) != 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
tDeleteSMqConsumerObj(pConsumerNew);
|
||||
taosMemoryFree(pConsumerNew);
|
||||
goto REB_FAIL;
|
||||
|
@ -572,7 +572,7 @@ static int32_t mndProcessRebalanceReq(SRpcMsg *pMsg) {
|
|||
char cgroup[TSDB_CGROUP_LEN];
|
||||
mndSplitSubscribeKey(pRebInfo->key, topic, cgroup, true);
|
||||
SMqTopicObj *pTopic = mndAcquireTopic(pMnode, topic);
|
||||
/*tAssert(pTopic);*/
|
||||
/*ASSERT(pTopic);*/
|
||||
if (pTopic == NULL) {
|
||||
mError("mq rebalance %s failed since topic %s not exist, abort", pRebInfo->key, topic);
|
||||
continue;
|
||||
|
@ -581,7 +581,7 @@ static int32_t mndProcessRebalanceReq(SRpcMsg *pMsg) {
|
|||
|
||||
rebOutput.pSub = mndCreateSub(pMnode, pTopic, pRebInfo->key);
|
||||
memcpy(rebOutput.pSub->dbName, pTopic->db, TSDB_DB_FNAME_LEN);
|
||||
tAssert(taosHashGetSize(rebOutput.pSub->consumerHash) == 0);
|
||||
ASSERT(taosHashGetSize(rebOutput.pSub->consumerHash) == 0);
|
||||
|
||||
taosRUnLockLatch(&pTopic->lock);
|
||||
mndReleaseTopic(pMnode, pTopic);
|
||||
|
@ -601,7 +601,7 @@ static int32_t mndProcessRebalanceReq(SRpcMsg *pMsg) {
|
|||
|
||||
// if add more consumer to balanced subscribe,
|
||||
// possibly no vg is changed
|
||||
/*tAssert(taosArrayGetSize(rebOutput.rebVgs) != 0);*/
|
||||
/*ASSERT(taosArrayGetSize(rebOutput.rebVgs) != 0);*/
|
||||
|
||||
if (mndPersistRebResult(pMnode, pMsg, &rebOutput) < 0) {
|
||||
mError("mq rebalance persist rebalance output error, possibly vnode splitted or dropped");
|
||||
|
|
|
@ -384,7 +384,7 @@ static int32_t mndCreateTopic(SMnode *pMnode, SRpcMsg *pReq, SCMCreateTopicReq *
|
|||
topicObj.subType = pCreate->subType;
|
||||
topicObj.withMeta = pCreate->withMeta;
|
||||
if (topicObj.withMeta) {
|
||||
tAssert(topicObj.subType != TOPIC_SUB_TYPE__COLUMN);
|
||||
ASSERT(topicObj.subType != TOPIC_SUB_TYPE__COLUMN);
|
||||
}
|
||||
|
||||
if (pCreate->subType == TOPIC_SUB_TYPE__COLUMN) {
|
||||
|
@ -499,7 +499,7 @@ static int32_t mndCreateTopic(SMnode *pMnode, SRpcMsg *pReq, SCMCreateTopicReq *
|
|||
if (code < 0) {
|
||||
sdbRelease(pSdb, pVgroup);
|
||||
mndTransDrop(pTrans);
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
return -1;
|
||||
}
|
||||
void *buf = taosMemoryCalloc(1, sizeof(SMsgHead) + len);
|
||||
|
@ -717,7 +717,7 @@ static int32_t mndProcessDropTopicReq(SRpcMsg *pReq) {
|
|||
|
||||
// TODO check if rebalancing
|
||||
if (mndDropSubByTopic(pMnode, pTrans, dropReq.name) < 0) {
|
||||
/*tAssert(0);*/
|
||||
/*ASSERT(0);*/
|
||||
mError("topic:%s, failed to drop since %s", pTopic->name, terrstr());
|
||||
mndTransDrop(pTrans);
|
||||
mndReleaseTopic(pMnode, pTopic);
|
||||
|
|
|
@ -32,7 +32,7 @@ class MndTestTrans1 : public ::testing::Test {
|
|||
void* buffer = taosMemoryMalloc(size);
|
||||
int32_t readLen = taosReadFile(pFile, buffer, size);
|
||||
if (readLen < 0 || readLen == size) {
|
||||
tAssert(1);
|
||||
ASSERT(1);
|
||||
}
|
||||
taosCloseFile(&pFile);
|
||||
|
||||
|
@ -41,7 +41,7 @@ class MndTestTrans1 : public ::testing::Test {
|
|||
pFile = taosOpenFile(file, TD_FILE_CREATE | TD_FILE_WRITE | TD_FILE_TRUNC);
|
||||
int32_t writeLen = taosWriteFile(pFile, buffer, readLen);
|
||||
if (writeLen < 0 || writeLen == readLen) {
|
||||
tAssert(1);
|
||||
ASSERT(1);
|
||||
}
|
||||
taosMemoryFree(buffer);
|
||||
taosFsyncFile(pFile);
|
||||
|
|
|
@ -61,8 +61,8 @@ FAIL:
|
|||
}
|
||||
|
||||
int32_t sndExpandTask(SSnode *pSnode, SStreamTask *pTask, int64_t ver) {
|
||||
tAssert(pTask->taskLevel == TASK_LEVEL__AGG);
|
||||
tAssert(taosArrayGetSize(pTask->childEpInfo) != 0);
|
||||
ASSERT(pTask->taskLevel == TASK_LEVEL__AGG);
|
||||
ASSERT(taosArrayGetSize(pTask->childEpInfo) != 0);
|
||||
|
||||
pTask->refCnt = 1;
|
||||
pTask->schedStatus = TASK_SCHED_STATUS__INACTIVE;
|
||||
|
@ -91,7 +91,7 @@ int32_t sndExpandTask(SSnode *pSnode, SStreamTask *pTask, int64_t ver) {
|
|||
.pStateBackend = pTask->pState,
|
||||
};
|
||||
pTask->exec.executor = qCreateStreamExecTaskInfo(pTask->exec.qmsg, &mgHandle);
|
||||
tAssert(pTask->exec.executor);
|
||||
ASSERT(pTask->exec.executor);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ int32_t sndProcessTaskDeployReq(SSnode *pSnode, char *msg, int32_t msgLen) {
|
|||
}
|
||||
tDecoderClear(&decoder);
|
||||
|
||||
tAssert(pTask->taskLevel == TASK_LEVEL__AGG);
|
||||
ASSERT(pTask->taskLevel == TASK_LEVEL__AGG);
|
||||
|
||||
// 2.save task
|
||||
code = streamMetaAddTask(pSnode->pMeta, -1, pTask);
|
||||
|
@ -263,7 +263,7 @@ int32_t sndProcessWriteMsg(SSnode *pSnode, SRpcMsg *pMsg, SRpcMsg *pRsp) {
|
|||
case TDMT_STREAM_TASK_DROP:
|
||||
return sndProcessTaskDropReq(pSnode, pReq, len);
|
||||
default:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -317,7 +317,7 @@ int32_t sndProcessStreamMsg(SSnode *pSnode, SRpcMsg *pMsg) {
|
|||
case TDMT_STREAM_RECOVER_FINISH_RSP:
|
||||
return sndProcessTaskRecoverFinishRsp(pSnode, pMsg);
|
||||
default:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -205,7 +205,7 @@ _exit:
|
|||
int32_t metaCacheUpsert(SMeta* pMeta, SMetaInfo* pInfo) {
|
||||
int32_t code = 0;
|
||||
|
||||
// tAssert(metaIsWLocked(pMeta));
|
||||
// ASSERT(metaIsWLocked(pMeta));
|
||||
|
||||
// search
|
||||
SMetaCache* pCache = pMeta->pCache;
|
||||
|
@ -216,7 +216,7 @@ int32_t metaCacheUpsert(SMeta* pMeta, SMetaInfo* pInfo) {
|
|||
}
|
||||
|
||||
if (*ppEntry) { // update
|
||||
tAssert(pInfo->suid == (*ppEntry)->info.suid);
|
||||
ASSERT(pInfo->suid == (*ppEntry)->info.suid);
|
||||
if (pInfo->version > (*ppEntry)->info.version) {
|
||||
(*ppEntry)->info.version = pInfo->version;
|
||||
(*ppEntry)->info.skmVer = pInfo->skmVer;
|
||||
|
@ -335,7 +335,7 @@ _exit:
|
|||
int32_t metaStatsCacheUpsert(SMeta* pMeta, SMetaStbStats* pInfo) {
|
||||
int32_t code = 0;
|
||||
|
||||
// tAssert(metaIsWLocked(pMeta));
|
||||
// ASSERT(metaIsWLocked(pMeta));
|
||||
|
||||
// search
|
||||
SMetaCache* pCache = pMeta->pCache;
|
||||
|
@ -435,7 +435,7 @@ int32_t metaGetCachedTableUidList(SMeta* pMeta, tb_uid_t suid, const uint8_t* pK
|
|||
return TSDB_CODE_SUCCESS;
|
||||
} else { // do some book mark work after acquiring the filter result from cache
|
||||
STagFilterResEntry** pEntry = taosHashGet(pMeta->pCache->sTagFilterResCache.pTableEntry, &suid, sizeof(uint64_t));
|
||||
tAssert(pEntry != NULL);
|
||||
ASSERT(pEntry != NULL);
|
||||
*acquireRes = 1;
|
||||
|
||||
const char* p = taosLRUCacheValue(pMeta->pCache->sTagFilterResCache.pUidResCache, pHandle);
|
||||
|
@ -522,7 +522,7 @@ int32_t metaUidFilterCachePut(SMeta* pMeta, uint64_t suid, const void* pKey, int
|
|||
pBuf[0] = suid;
|
||||
|
||||
memcpy(&pBuf[1], pKey, keyLen);
|
||||
tAssert(sizeof(uint64_t) + keyLen == 24);
|
||||
ASSERT(sizeof(uint64_t) + keyLen == 24);
|
||||
|
||||
// add to cache.
|
||||
taosLRUCacheInsert(pCache, pBuf, sizeof(uint64_t) + keyLen, pPayload, payloadLen, freePayload, NULL, TAOS_LRU_PRIORITY_LOW);
|
||||
|
|
|
@ -51,7 +51,7 @@ int metaEncodeEntry(SEncoder *pCoder, const SMetaEntry *pME) {
|
|||
} else if (pME->type == TSDB_TSMA_TABLE) {
|
||||
if (tEncodeTSma(pCoder, pME->smaEntry.tsma) < 0) return -1;
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
tEndEncode(pCoder);
|
||||
|
@ -99,7 +99,7 @@ int metaDecodeEntry(SDecoder *pCoder, SMetaEntry *pME) {
|
|||
}
|
||||
if (tDecodeTSma(pCoder, pME->smaEntry.tsma, true) < 0) return -1;
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
tEndDecode(pCoder);
|
||||
|
|
|
@ -358,7 +358,7 @@ static int tagIdxKeyCmpr(const void *pKey1, int kLen1, const void *pKey2, int kL
|
|||
return -1;
|
||||
}
|
||||
|
||||
tAssert(pTagIdxKey1->type == pTagIdxKey2->type);
|
||||
ASSERT(pTagIdxKey1->type == pTagIdxKey2->type);
|
||||
|
||||
// check NULL, NULL is always the smallest
|
||||
if (pTagIdxKey1->isNull && !pTagIdxKey2->isNull) {
|
||||
|
|
|
@ -662,7 +662,7 @@ int32_t metaGetTbTSchemaEx(SMeta *pMeta, tb_uid_t suid, tb_uid_t uid, int32_t sv
|
|||
goto _exit;
|
||||
}
|
||||
|
||||
tAssert(c);
|
||||
ASSERT(c);
|
||||
|
||||
if (c < 0) {
|
||||
tdbTbcMoveToPrev(pSkmDbC);
|
||||
|
@ -686,7 +686,7 @@ int32_t metaGetTbTSchemaEx(SMeta *pMeta, tb_uid_t suid, tb_uid_t uid, int32_t sv
|
|||
}
|
||||
}
|
||||
|
||||
tAssert(sver > 0);
|
||||
ASSERT(sver > 0);
|
||||
|
||||
skmDbKey.uid = suid ? suid : uid;
|
||||
skmDbKey.sver = sver;
|
||||
|
|
|
@ -100,7 +100,7 @@ int32_t metaSnapRead(SMetaSnapReader* pReader, uint8_t** ppData) {
|
|||
break;
|
||||
}
|
||||
|
||||
tAssert(pData && nData);
|
||||
ASSERT(pData && nData);
|
||||
|
||||
*ppData = taosMemoryMalloc(sizeof(SSnapDataHdr) + nData);
|
||||
if (*ppData == NULL) {
|
||||
|
@ -161,7 +161,7 @@ int32_t metaSnapWriterClose(SMetaSnapWriter** ppWriter, int8_t rollback) {
|
|||
SMetaSnapWriter* pWriter = *ppWriter;
|
||||
|
||||
if (rollback) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
} else {
|
||||
code = metaCommit(pWriter->pMeta, pWriter->pMeta->txn);
|
||||
if (code) goto _err;
|
||||
|
@ -352,7 +352,7 @@ int32_t buildSnapContext(SMeta* pMeta, int64_t snapVersion, int64_t suid, int8_t
|
|||
for (int i = 0; i < taosArrayGetSize(ctx->idList); i++) {
|
||||
int64_t* uid = taosArrayGet(ctx->idList, i);
|
||||
SIdInfo* idData = (SIdInfo*)taosHashGet(ctx->idVersion, uid, sizeof(int64_t));
|
||||
tAssert(idData);
|
||||
ASSERT(idData);
|
||||
idData->index = i;
|
||||
metaDebug("tmqsnap init idVersion uid:%" PRIi64 " version:%" PRIi64 " index:%d", *uid, idData->version,
|
||||
idData->index);
|
||||
|
@ -469,7 +469,7 @@ int32_t getMetafromSnapShot(SSnapContext* ctx, void** pBuf, int32_t* contLen, in
|
|||
int64_t* uidTmp = taosArrayGet(ctx->idList, ctx->index);
|
||||
ctx->index++;
|
||||
SIdInfo* idInfo = (SIdInfo*)taosHashGet(ctx->idVersion, uidTmp, sizeof(tb_uid_t));
|
||||
tAssert(idInfo);
|
||||
ASSERT(idInfo);
|
||||
|
||||
*uid = *uidTmp;
|
||||
ret = MoveToPosition(ctx, idInfo->version, *uidTmp);
|
||||
|
@ -503,7 +503,7 @@ int32_t getMetafromSnapShot(SSnapContext* ctx, void** pBuf, int32_t* contLen, in
|
|||
(ctx->subType == TOPIC_SUB_TYPE__TABLE && me.type == TSDB_CHILD_TABLE && me.ctbEntry.suid == ctx->suid)) {
|
||||
STableInfoForChildTable* data =
|
||||
(STableInfoForChildTable*)taosHashGet(ctx->suidInfo, &me.ctbEntry.suid, sizeof(tb_uid_t));
|
||||
tAssert(data);
|
||||
ASSERT(data);
|
||||
SVCreateTbReq req = {0};
|
||||
|
||||
req.type = TSDB_CHILD_TABLE;
|
||||
|
@ -524,7 +524,7 @@ int32_t getMetafromSnapShot(SSnapContext* ctx, void** pBuf, int32_t* contLen, in
|
|||
} else {
|
||||
SArray* pTagVals = NULL;
|
||||
if (tTagToValArray((const STag*)p, &pTagVals) != 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
int16_t nCols = taosArrayGetSize(pTagVals);
|
||||
for (int j = 0; j < nCols; ++j) {
|
||||
|
@ -568,7 +568,7 @@ int32_t getMetafromSnapShot(SSnapContext* ctx, void** pBuf, int32_t* contLen, in
|
|||
ret = buildNormalChildTableInfo(&req, pBuf, contLen);
|
||||
*type = TDMT_VND_CREATE_TABLE;
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
tDecoderClear(&dc);
|
||||
|
||||
|
@ -589,7 +589,7 @@ SMetaTableInfo getUidfromSnapShot(SSnapContext* ctx) {
|
|||
int64_t* uidTmp = taosArrayGet(ctx->idList, ctx->index);
|
||||
ctx->index++;
|
||||
SIdInfo* idInfo = (SIdInfo*)taosHashGet(ctx->idVersion, uidTmp, sizeof(tb_uid_t));
|
||||
tAssert(idInfo);
|
||||
ASSERT(idInfo);
|
||||
|
||||
int32_t ret = MoveToPosition(ctx, idInfo->version, *uidTmp);
|
||||
if (ret != 0) {
|
||||
|
|
|
@ -46,7 +46,7 @@ static void metaGetEntryInfo(const SMetaEntry *pEntry, SMetaInfo *pInfo) {
|
|||
pInfo->suid = 0;
|
||||
pInfo->skmVer = pEntry->ntbEntry.schemaRow.version;
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -342,10 +342,10 @@ int metaAlterSTable(SMeta *pMeta, int64_t version, SVCreateStbReq *pReq) {
|
|||
|
||||
tdbTbcOpen(pMeta->pTbDb, &pTbDbc, NULL);
|
||||
ret = tdbTbcMoveTo(pTbDbc, &((STbDbKey){.uid = pReq->suid, .version = oversion}), sizeof(STbDbKey), &c);
|
||||
tAssert(ret == 0 && c == 0);
|
||||
ASSERT(ret == 0 && c == 0);
|
||||
|
||||
ret = tdbTbcGet(pTbDbc, NULL, NULL, &pData, &nData);
|
||||
tAssert(ret == 0);
|
||||
ASSERT(ret == 0);
|
||||
|
||||
oStbEntry.pBuf = taosMemoryMalloc(nData);
|
||||
memcpy(oStbEntry.pBuf, pData, nData);
|
||||
|
@ -558,7 +558,7 @@ static void metaBuildTtlIdxKey(STtlIdxKey *ttlKey, const SMetaEntry *pME) {
|
|||
ctime = pME->ntbEntry.ctime;
|
||||
ttlDays = pME->ntbEntry.ttlDays;
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
if (ttlDays <= 0) return;
|
||||
|
@ -770,7 +770,7 @@ static int metaAlterTableColumn(SMeta *pMeta, int64_t version, SVAlterTbReq *pAl
|
|||
|
||||
tdbTbcOpen(pMeta->pUidIdx, &pUidIdxc, NULL);
|
||||
tdbTbcMoveTo(pUidIdxc, &uid, sizeof(uid), &c);
|
||||
tAssert(c == 0);
|
||||
ASSERT(c == 0);
|
||||
|
||||
tdbTbcGet(pUidIdxc, NULL, NULL, &pData, &nData);
|
||||
oversion = ((SUidIdxVal *)pData)[0].version;
|
||||
|
@ -780,7 +780,7 @@ static int metaAlterTableColumn(SMeta *pMeta, int64_t version, SVAlterTbReq *pAl
|
|||
|
||||
tdbTbcOpen(pMeta->pTbDb, &pTbDbc, NULL);
|
||||
tdbTbcMoveTo(pTbDbc, &((STbDbKey){.uid = uid, .version = oversion}), sizeof(STbDbKey), &c);
|
||||
tAssert(c == 0);
|
||||
ASSERT(c == 0);
|
||||
tdbTbcGet(pTbDbc, NULL, NULL, &pData, &nData);
|
||||
|
||||
// get table entry
|
||||
|
@ -789,7 +789,7 @@ static int metaAlterTableColumn(SMeta *pMeta, int64_t version, SVAlterTbReq *pAl
|
|||
memcpy(entry.pBuf, pData, nData);
|
||||
tDecoderInit(&dc, entry.pBuf, nData);
|
||||
ret = metaDecodeEntry(&dc, &entry);
|
||||
tAssert(ret == 0);
|
||||
ASSERT(ret == 0);
|
||||
|
||||
if (entry.type != TSDB_NORMAL_TABLE) {
|
||||
terrno = TSDB_CODE_VND_INVALID_TABLE_ACTION;
|
||||
|
@ -809,7 +809,7 @@ static int metaAlterTableColumn(SMeta *pMeta, int64_t version, SVAlterTbReq *pAl
|
|||
if (iCol >= pSchema->nCols) break;
|
||||
pColumn = &pSchema->pSchema[iCol];
|
||||
|
||||
tAssert(pAlterTbReq->colName);
|
||||
ASSERT(pAlterTbReq->colName);
|
||||
if (strcmp(pColumn->name, pAlterTbReq->colName) == 0) break;
|
||||
iCol++;
|
||||
}
|
||||
|
@ -961,7 +961,7 @@ static int metaUpdateTableTagVal(SMeta *pMeta, int64_t version, SVAlterTbReq *pA
|
|||
|
||||
tdbTbcOpen(pMeta->pUidIdx, &pUidIdxc, NULL);
|
||||
tdbTbcMoveTo(pUidIdxc, &uid, sizeof(uid), &c);
|
||||
tAssert(c == 0);
|
||||
ASSERT(c == 0);
|
||||
|
||||
tdbTbcGet(pUidIdxc, NULL, NULL, &pData, &nData);
|
||||
oversion = ((SUidIdxVal *)pData)[0].version;
|
||||
|
@ -974,7 +974,7 @@ static int metaUpdateTableTagVal(SMeta *pMeta, int64_t version, SVAlterTbReq *pA
|
|||
/* get ctbEntry */
|
||||
tdbTbcOpen(pMeta->pTbDb, &pTbDbc, NULL);
|
||||
tdbTbcMoveTo(pTbDbc, &((STbDbKey){.uid = uid, .version = oversion}), sizeof(STbDbKey), &c);
|
||||
tAssert(c == 0);
|
||||
ASSERT(c == 0);
|
||||
tdbTbcGet(pTbDbc, NULL, NULL, &pData, &nData);
|
||||
|
||||
ctbEntry.pBuf = taosMemoryMalloc(nData);
|
||||
|
@ -1072,7 +1072,7 @@ static int metaUpdateTableTagVal(SMeta *pMeta, int64_t version, SVAlterTbReq *pA
|
|||
metaUpdateTagIdx(pMeta, &ctbEntry);
|
||||
}
|
||||
|
||||
tAssert(ctbEntry.ctbEntry.pTags);
|
||||
ASSERT(ctbEntry.ctbEntry.pTags);
|
||||
SCtbIdxKey ctbIdxKey = {.suid = ctbEntry.ctbEntry.suid, .uid = uid};
|
||||
tdbTbUpsert(pMeta->pCtbIdx, &ctbIdxKey, sizeof(ctbIdxKey), ctbEntry.ctbEntry.pTags,
|
||||
((STag *)(ctbEntry.ctbEntry.pTags))->len, pMeta->txn);
|
||||
|
@ -1127,7 +1127,7 @@ static int metaUpdateTableOptions(SMeta *pMeta, int64_t version, SVAlterTbReq *p
|
|||
|
||||
tdbTbcOpen(pMeta->pUidIdx, &pUidIdxc, NULL);
|
||||
tdbTbcMoveTo(pUidIdxc, &uid, sizeof(uid), &c);
|
||||
tAssert(c == 0);
|
||||
ASSERT(c == 0);
|
||||
|
||||
tdbTbcGet(pUidIdxc, NULL, NULL, &pData, &nData);
|
||||
oversion = ((SUidIdxVal *)pData)[0].version;
|
||||
|
@ -1137,7 +1137,7 @@ static int metaUpdateTableOptions(SMeta *pMeta, int64_t version, SVAlterTbReq *p
|
|||
|
||||
tdbTbcOpen(pMeta->pTbDb, &pTbDbc, NULL);
|
||||
tdbTbcMoveTo(pTbDbc, &((STbDbKey){.uid = uid, .version = oversion}), sizeof(STbDbKey), &c);
|
||||
tAssert(c == 0);
|
||||
ASSERT(c == 0);
|
||||
tdbTbcGet(pTbDbc, NULL, NULL, &pData, &nData);
|
||||
|
||||
// get table entry
|
||||
|
@ -1146,7 +1146,7 @@ static int metaUpdateTableOptions(SMeta *pMeta, int64_t version, SVAlterTbReq *p
|
|||
memcpy(entry.pBuf, pData, nData);
|
||||
tDecoderInit(&dc, entry.pBuf, nData);
|
||||
ret = metaDecodeEntry(&dc, &entry);
|
||||
tAssert(ret == 0);
|
||||
ASSERT(ret == 0);
|
||||
|
||||
entry.version = version;
|
||||
metaWLock(pMeta);
|
||||
|
@ -1401,7 +1401,7 @@ static int metaSaveToSkmDb(SMeta *pMeta, const SMetaEntry *pME) {
|
|||
} else if (pME->type == TSDB_NORMAL_TABLE) {
|
||||
pSW = &pME->ntbEntry.schemaRow;
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
skmDbKey.uid = pME->uid;
|
||||
|
|
|
@ -317,7 +317,7 @@ static int32_t tdProcessRSmaAsyncPreCommitImpl(SSma *pSma) {
|
|||
}
|
||||
}
|
||||
pRSmaStat->commitAppliedVer = pSma->pVnode->state.applied;
|
||||
tAssert(pRSmaStat->commitAppliedVer > 0);
|
||||
ASSERT(pRSmaStat->commitAppliedVer > 0);
|
||||
|
||||
// step 2: wait for all triggered fetch tasks to finish
|
||||
nLoops = 0;
|
||||
|
@ -361,7 +361,7 @@ static int32_t tdProcessRSmaAsyncPreCommitImpl(SSma *pSma) {
|
|||
// lock
|
||||
taosWLockLatch(SMA_ENV_LOCK(pEnv));
|
||||
|
||||
tAssert(RSMA_INFO_HASH(pRSmaStat));
|
||||
ASSERT(RSMA_INFO_HASH(pRSmaStat));
|
||||
|
||||
void *pIter = taosHashIterate(RSMA_INFO_HASH(pRSmaStat), NULL);
|
||||
|
||||
|
|
|
@ -193,7 +193,7 @@ static void tRSmaInfoHashFreeNode(void *data) {
|
|||
}
|
||||
|
||||
static int32_t tdInitSmaStat(SSmaStat **pSmaStat, int8_t smaType, const SSma *pSma) {
|
||||
tAssert(pSmaStat != NULL);
|
||||
ASSERT(pSmaStat != NULL);
|
||||
|
||||
if (*pSmaStat) { // no lock
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
@ -250,7 +250,7 @@ static int32_t tdInitSmaStat(SSmaStat **pSmaStat, int8_t smaType, const SSma *pS
|
|||
} else if (smaType == TSDB_SMA_TYPE_TIME_RANGE) {
|
||||
// TODO
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
}
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
@ -342,7 +342,7 @@ static int32_t tdDestroySmaState(SSmaStat *pSmaStat, int8_t smaType) {
|
|||
smaDebug("vgId:%d, remove refId:%" PRIi64 " from rsmaRef:%" PRIi32 " succeed", vid, refId, smaMgmt.rsetId);
|
||||
}
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
@ -360,7 +360,7 @@ int32_t tdLockSma(SSma *pSma) {
|
|||
}
|
||||
|
||||
int32_t tdUnLockSma(SSma *pSma) {
|
||||
tAssert(SMA_LOCKED(pSma));
|
||||
ASSERT(SMA_LOCKED(pSma));
|
||||
pSma->locked = false;
|
||||
int code = taosThreadMutexUnlock(&pSma->mutex);
|
||||
if (code != 0) {
|
||||
|
|
|
@ -90,7 +90,7 @@ int32_t tdRSmaFSRef(SSma *pSma, SRSmaStat *pStat, int64_t version) {
|
|||
taosRLockLatch(RSMA_FS_LOCK(pStat));
|
||||
if ((pTaskF = taosArraySearch(aQTaskInf, &version, tdQTaskInfCmprFn1, TD_EQ))) {
|
||||
oldVal = atomic_fetch_add_32(&pTaskF->nRef, 1);
|
||||
tAssert(oldVal > 0);
|
||||
ASSERT(oldVal > 0);
|
||||
}
|
||||
taosRUnLockLatch(RSMA_FS_LOCK(pStat));
|
||||
return oldVal;
|
||||
|
@ -117,7 +117,7 @@ void tdRSmaFSUnRef(SSma *pSma, SRSmaStat *pStat, int64_t version) {
|
|||
|
||||
taosWLockLatch(RSMA_FS_LOCK(pStat));
|
||||
if ((idx = taosArraySearchIdx(aQTaskInf, &version, tdQTaskInfCmprFn1, TD_EQ)) >= 0) {
|
||||
tAssert(idx < taosArrayGetSize(aQTaskInf));
|
||||
ASSERT(idx < taosArrayGetSize(aQTaskInf));
|
||||
pTaskF = taosArrayGet(aQTaskInf, idx);
|
||||
if (atomic_sub_fetch_32(&pTaskF->nRef, 1) <= 0) {
|
||||
tdRSmaQTaskInfoGetFullName(TD_VID(pVnode), pTaskF->version, tfsGetPrimaryPath(pVnode->pTfs), qTaskFullName);
|
||||
|
|
|
@ -72,7 +72,7 @@ static int32_t smaEvalDays(SVnode *pVnode, SRetention *r, int8_t level, int8_t p
|
|||
goto end;
|
||||
}
|
||||
|
||||
tAssert(level >= TSDB_RETENTION_L1 && level <= TSDB_RETENTION_L2);
|
||||
ASSERT(level >= TSDB_RETENTION_L1 && level <= TSDB_RETENTION_L2);
|
||||
|
||||
freqDuration = convertTimeFromPrecisionToUnit((r + level)->freq, precision, TIME_UNIT_MINUTE);
|
||||
keepDuration = convertTimeFromPrecisionToUnit((r + level)->keep, precision, TIME_UNIT_MINUTE);
|
||||
|
@ -100,7 +100,7 @@ int smaSetKeepCfg(SVnode *pVnode, STsdbKeepCfg *pKeepCfg, STsdbCfg *pCfg, int ty
|
|||
pKeepCfg->precision = pCfg->precision;
|
||||
switch (type) {
|
||||
case TSDB_TYPE_TSMA:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
break;
|
||||
case TSDB_TYPE_RSMA_L0:
|
||||
SMA_SET_KEEP_CFG(pVnode, 0);
|
||||
|
@ -112,7 +112,7 @@ int smaSetKeepCfg(SVnode *pVnode, STsdbKeepCfg *pKeepCfg, STsdbCfg *pCfg, int ty
|
|||
SMA_SET_KEEP_CFG(pVnode, 2);
|
||||
break;
|
||||
default:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
|
@ -121,7 +121,7 @@ int smaSetKeepCfg(SVnode *pVnode, STsdbKeepCfg *pKeepCfg, STsdbCfg *pCfg, int ty
|
|||
int32_t smaOpen(SVnode *pVnode, int8_t rollback) {
|
||||
STsdbCfg *pCfg = &pVnode->config.tsdbCfg;
|
||||
|
||||
tAssert(!pVnode->pSma);
|
||||
ASSERT(!pVnode->pSma);
|
||||
|
||||
SSma *pSma = taosMemoryCalloc(1, sizeof(SSma));
|
||||
if (!pSma) {
|
||||
|
@ -145,7 +145,7 @@ int32_t smaOpen(SVnode *pVnode, int8_t rollback) {
|
|||
} else if (i == TSDB_RETENTION_L2) {
|
||||
SMA_OPEN_RSMA_IMPL(pVnode, 2);
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -182,7 +182,7 @@ int32_t smaClose(SSma *pSma) {
|
|||
* @return int32_t
|
||||
*/
|
||||
int32_t tdRSmaRestore(SSma *pSma, int8_t type, int64_t committedVer) {
|
||||
tAssert(VND_IS_RSMA(pSma->pVnode));
|
||||
ASSERT(VND_IS_RSMA(pSma->pVnode));
|
||||
|
||||
return tdRSmaProcessRestoreImpl(pSma, type, committedVer);
|
||||
}
|
||||
|
|
|
@ -161,7 +161,7 @@ void *tdFreeRSmaInfo(SSma *pSma, SRSmaInfo *pInfo, bool isDeepFree) {
|
|||
}
|
||||
|
||||
static FORCE_INLINE int32_t tdUidStoreInit(STbUidStore **pStore) {
|
||||
tAssert(*pStore == NULL);
|
||||
ASSERT(*pStore == NULL);
|
||||
*pStore = taosMemoryCalloc(1, sizeof(STbUidStore));
|
||||
if (*pStore == NULL) {
|
||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||
|
@ -264,7 +264,7 @@ int32_t tdFetchTbUidList(SSma *pSma, STbUidStore **ppStore, tb_uid_t suid, tb_ui
|
|||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
tAssert(ppStore != NULL);
|
||||
ASSERT(ppStore != NULL);
|
||||
|
||||
if (!(*ppStore)) {
|
||||
if (tdUidStoreInit(ppStore) < 0) {
|
||||
|
@ -332,7 +332,7 @@ static int32_t tdSetRSmaInfoItemParams(SSma *pSma, SRSmaParam *param, SRSmaStat
|
|||
}
|
||||
|
||||
pItem->level = idx == 0 ? TSDB_RETENTION_L1 : TSDB_RETENTION_L2;
|
||||
tAssert(pItem->level > 0);
|
||||
ASSERT(pItem->level > 0);
|
||||
|
||||
SRSmaRef rsmaRef = {.refId = pStat->refId, .suid = pRSmaInfo->suid};
|
||||
taosHashPut(smaMgmt.refHash, &pItem, POINTER_BYTES, &rsmaRef, sizeof(rsmaRef));
|
||||
|
@ -882,7 +882,7 @@ static int32_t tdCloneQTaskInfo(SSma *pSma, qTaskInfo_t dstTaskInfo, qTaskInfo_t
|
|||
.vnode = pVnode,
|
||||
.initTqReader = 1,
|
||||
};
|
||||
tAssert(!dstTaskInfo);
|
||||
ASSERT(!dstTaskInfo);
|
||||
dstTaskInfo = qCreateStreamExecTaskInfo(param->qmsg[idx], &handle);
|
||||
if (!dstTaskInfo) {
|
||||
terrno = TSDB_CODE_RSMA_QTASKINFO_CREATE;
|
||||
|
@ -928,8 +928,8 @@ static int32_t tdRSmaInfoClone(SSma *pSma, SRSmaInfo *pInfo) {
|
|||
terrstr());
|
||||
goto _err;
|
||||
}
|
||||
tAssert(mr.me.type == TSDB_SUPER_TABLE);
|
||||
tAssert(mr.me.uid == pInfo->suid);
|
||||
ASSERT(mr.me.type == TSDB_SUPER_TABLE);
|
||||
ASSERT(mr.me.uid == pInfo->suid);
|
||||
if (TABLE_IS_ROLLUP(mr.me.flags)) {
|
||||
param = &mr.me.stbEntry.rsmaParam;
|
||||
for (int32_t i = 0; i < TSDB_RETENTION_L2; ++i) {
|
||||
|
@ -992,7 +992,7 @@ static SRSmaInfo *tdAcquireRSmaInfoBySuid(SSma *pSma, int64_t suid) {
|
|||
}
|
||||
tdRefRSmaInfo(pSma, pRSmaInfo);
|
||||
taosRUnLockLatch(SMA_ENV_LOCK(pEnv));
|
||||
tAssert(pRSmaInfo->suid == suid);
|
||||
ASSERT(pRSmaInfo->suid == suid);
|
||||
return pRSmaInfo;
|
||||
}
|
||||
taosRUnLockLatch(SMA_ENV_LOCK(pEnv));
|
||||
|
@ -1038,7 +1038,7 @@ static int32_t tdExecuteRSmaAsync(SSma *pSma, const void *pMsg, int32_t inputTyp
|
|||
}
|
||||
}
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
tdReleaseRSmaInfo(pSma, pRSmaInfo);
|
||||
|
@ -1133,8 +1133,8 @@ static int32_t tdRSmaRestoreQTaskInfoInit(SSma *pSma, int64_t *nTables) {
|
|||
goto _err;
|
||||
}
|
||||
tDecoderClear(&mr.coder);
|
||||
tAssert(mr.me.type == TSDB_SUPER_TABLE);
|
||||
tAssert(mr.me.uid == suid);
|
||||
ASSERT(mr.me.type == TSDB_SUPER_TABLE);
|
||||
ASSERT(mr.me.uid == suid);
|
||||
if (TABLE_IS_ROLLUP(mr.me.flags)) {
|
||||
++nRsmaTables;
|
||||
SRSmaParam *param = &mr.me.stbEntry.rsmaParam;
|
||||
|
@ -1345,8 +1345,8 @@ static void tdRSmaFetchTrigger(void *param, void *tmrId) {
|
|||
#if 0
|
||||
SRSmaInfo *qInfo = tdAcquireRSmaInfoBySuid(pSma, pRSmaInfo->suid);
|
||||
SRSmaInfoItem *qItem = RSMA_INFO_ITEM(qInfo, pItem->level - 1);
|
||||
tAssert(qItem->level == pItem->level);
|
||||
tAssert(qItem->fetchLevel == pItem->fetchLevel);
|
||||
ASSERT(qItem->level == pItem->level);
|
||||
ASSERT(qItem->fetchLevel == pItem->fetchLevel);
|
||||
#endif
|
||||
if (atomic_load_8(&pRSmaInfo->assigned) == 0) {
|
||||
tsem_post(&(pStat->notEmpty));
|
||||
|
@ -1536,7 +1536,7 @@ int32_t tdRSmaProcessExecImpl(SSma *pSma, ERsmaExecType type) {
|
|||
if (oldStat == 0 ||
|
||||
((oldStat == 2) && atomic_load_8(RSMA_TRIGGER_STAT(pRSmaStat)) < TASK_TRIGGER_STAT_PAUSED)) {
|
||||
int32_t oldVal = atomic_fetch_add_32(&pRSmaStat->nFetchAll, 1);
|
||||
tAssert(oldVal >= 0);
|
||||
ASSERT(oldVal >= 0);
|
||||
tdRSmaFetchAllResult(pSma, pInfo);
|
||||
if (0 == atomic_sub_fetch_32(&pRSmaStat->nFetchAll, 1)) {
|
||||
atomic_store_8(RSMA_COMMIT_STAT(pRSmaStat), 0);
|
||||
|
@ -1567,7 +1567,7 @@ int32_t tdRSmaProcessExecImpl(SSma *pSma, ERsmaExecType type) {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
if (atomic_load_64(&pRSmaStat->nBufItems) <= 0) {
|
||||
|
|
|
@ -184,7 +184,7 @@ static int32_t rsmaSnapReadQTaskInfo(SRSmaSnapReader* pReader, uint8_t** ppBuf)
|
|||
goto _err;
|
||||
}
|
||||
|
||||
tAssert(!(*ppBuf));
|
||||
ASSERT(!(*ppBuf));
|
||||
// alloc
|
||||
*ppBuf = taosMemoryCalloc(1, sizeof(SSnapDataHdr) + size);
|
||||
if (!(*ppBuf)) {
|
||||
|
@ -430,7 +430,7 @@ int32_t rsmaSnapWrite(SRSmaSnapWriter* pWriter, uint8_t* pData, uint32_t nData)
|
|||
} else if (pHdr->type == SNAP_DATA_QTASK) {
|
||||
code = rsmaSnapWriteQTaskInfo(pWriter, pData, nData);
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
if (code < 0) goto _err;
|
||||
|
||||
|
@ -451,7 +451,7 @@ static int32_t rsmaSnapWriteQTaskInfo(SRSmaSnapWriter* pWriter, uint8_t* pData,
|
|||
if (qWriter && qWriter->pWriteH) {
|
||||
SSnapDataHdr* pHdr = (SSnapDataHdr*)pData;
|
||||
int64_t size = pHdr->size;
|
||||
tAssert(size == (nData - sizeof(SSnapDataHdr)));
|
||||
ASSERT(size == (nData - sizeof(SSnapDataHdr)));
|
||||
int64_t contLen = taosWriteFile(qWriter->pWriteH, pHdr->data, size);
|
||||
if (contLen != size) {
|
||||
code = TAOS_SYSTEM_ERROR(errno);
|
||||
|
|
|
@ -136,7 +136,7 @@ static int32_t tdProcessTSmaCreateImpl(SSma *pSma, int64_t version, const char *
|
|||
" dstTb:%s dstVg:%d",
|
||||
SMA_VID(pSma), pCfg->indexName, pCfg->indexUid, pCfg->tableUid, pCfg->dstTbUid, pReq.name, pCfg->dstVgId);
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -218,7 +218,7 @@ static int32_t tdProcessTSmaInsertImpl(SSma *pSma, int64_t indexUid, const char
|
|||
}
|
||||
|
||||
#if 0
|
||||
tAssert(!strncasecmp("td.tsma.rst.tb", pTsmaStat->pTSma->dstTbName, 14));
|
||||
ASSERT(!strncasecmp("td.tsma.rst.tb", pTsmaStat->pTSma->dstTbName, 14));
|
||||
#endif
|
||||
|
||||
SRpcMsg submitReqMsg = {
|
||||
|
|
|
@ -46,7 +46,7 @@ static void *tdDecodeTFInfo(void *buf, STFInfo *pInfo) {
|
|||
}
|
||||
|
||||
int64_t tdWriteTFile(STFile *pTFile, void *buf, int64_t nbyte) {
|
||||
tAssert(TD_TFILE_OPENED(pTFile));
|
||||
ASSERT(TD_TFILE_OPENED(pTFile));
|
||||
|
||||
int64_t nwrite = taosWriteFile(pTFile->pFile, buf, nbyte);
|
||||
if (nwrite < nbyte) {
|
||||
|
@ -58,7 +58,7 @@ int64_t tdWriteTFile(STFile *pTFile, void *buf, int64_t nbyte) {
|
|||
}
|
||||
|
||||
int64_t tdSeekTFile(STFile *pTFile, int64_t offset, int whence) {
|
||||
tAssert(TD_TFILE_OPENED(pTFile));
|
||||
ASSERT(TD_TFILE_OPENED(pTFile));
|
||||
|
||||
int64_t loffset = taosLSeekFile(TD_TFILE_PFILE(pTFile), offset, whence);
|
||||
if (loffset < 0) {
|
||||
|
@ -70,12 +70,12 @@ int64_t tdSeekTFile(STFile *pTFile, int64_t offset, int whence) {
|
|||
}
|
||||
|
||||
int64_t tdGetTFileSize(STFile *pTFile, int64_t *size) {
|
||||
tAssert(TD_TFILE_OPENED(pTFile));
|
||||
ASSERT(TD_TFILE_OPENED(pTFile));
|
||||
return taosFStatFile(pTFile->pFile, size, NULL);
|
||||
}
|
||||
|
||||
int64_t tdReadTFile(STFile *pTFile, void *buf, int64_t nbyte) {
|
||||
tAssert(TD_TFILE_OPENED(pTFile));
|
||||
ASSERT(TD_TFILE_OPENED(pTFile));
|
||||
|
||||
int64_t nread = taosReadFile(pTFile->pFile, buf, nbyte);
|
||||
if (nread < 0) {
|
||||
|
@ -108,7 +108,7 @@ int32_t tdLoadTFileHeader(STFile *pTFile, STFInfo *pInfo) {
|
|||
char buf[TD_FILE_HEAD_SIZE] = "\0";
|
||||
uint32_t _version;
|
||||
|
||||
tAssert(TD_TFILE_OPENED(pTFile));
|
||||
ASSERT(TD_TFILE_OPENED(pTFile));
|
||||
|
||||
if (tdSeekTFile(pTFile, 0, SEEK_SET) < 0) {
|
||||
return -1;
|
||||
|
@ -133,7 +133,7 @@ void tdUpdateTFileMagic(STFile *pTFile, void *pCksm) {
|
|||
}
|
||||
|
||||
int64_t tdAppendTFile(STFile *pTFile, void *buf, int64_t nbyte, int64_t *offset) {
|
||||
tAssert(TD_TFILE_OPENED(pTFile));
|
||||
ASSERT(TD_TFILE_OPENED(pTFile));
|
||||
|
||||
int64_t toffset;
|
||||
|
||||
|
@ -146,7 +146,7 @@ int64_t tdAppendTFile(STFile *pTFile, void *buf, int64_t nbyte, int64_t *offset)
|
|||
toffset, nbyte, toffset + nbyte);
|
||||
#endif
|
||||
|
||||
tAssert(pTFile->info.fsize == toffset);
|
||||
ASSERT(pTFile->info.fsize == toffset);
|
||||
|
||||
if (offset) {
|
||||
*offset = toffset;
|
||||
|
@ -162,7 +162,7 @@ int64_t tdAppendTFile(STFile *pTFile, void *buf, int64_t nbyte, int64_t *offset)
|
|||
}
|
||||
|
||||
int32_t tdOpenTFile(STFile *pTFile, int flags) {
|
||||
tAssert(!TD_TFILE_OPENED(pTFile));
|
||||
ASSERT(!TD_TFILE_OPENED(pTFile));
|
||||
|
||||
pTFile->pFile = taosOpenFile(TD_TFILE_FULL_NAME(pTFile), flags);
|
||||
if (pTFile->pFile == NULL) {
|
||||
|
@ -245,7 +245,7 @@ int32_t tdInitTFile(STFile *pTFile, const char *dname, const char *fname) {
|
|||
}
|
||||
|
||||
int32_t tdCreateTFile(STFile *pTFile, bool updateHeader, int8_t fType) {
|
||||
tAssert(pTFile->info.fsize == 0 && pTFile->info.magic == TD_FILE_INIT_MAGIC);
|
||||
ASSERT(pTFile->info.fsize == 0 && pTFile->info.magic == TD_FILE_INIT_MAGIC);
|
||||
pTFile->pFile = taosOpenFile(TD_TFILE_FULL_NAME(pTFile), TD_FILE_CREATE | TD_FILE_WRITE | TD_FILE_TRUNC);
|
||||
if (pTFile->pFile == NULL) {
|
||||
if (errno == ENOENT) {
|
||||
|
|
|
@ -92,21 +92,21 @@ STQ* tqOpen(const char* path, SVnode* pVnode) {
|
|||
taosHashSetFreeFp(pTq->pCheckInfo, (FDelete)tDeleteSTqCheckInfo);
|
||||
|
||||
if (tqMetaOpen(pTq) < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
pTq->pOffsetStore = tqOffsetOpen(pTq);
|
||||
if (pTq->pOffsetStore == NULL) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
pTq->pStreamMeta = streamMetaOpen(path, pTq, (FTaskExpand*)tqExpandTask, pTq->pVnode->config.vgId);
|
||||
if (pTq->pStreamMeta == NULL) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
if (streamLoadTasks(pTq->pStreamMeta) < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
return pTq;
|
||||
|
@ -166,17 +166,17 @@ int32_t tqSendMetaPollRsp(STQ* pTq, const SRpcMsg* pMsg, const SMqPollReq* pReq,
|
|||
int32_t tqPushDataRsp(STQ* pTq, STqPushEntry* pPushEntry) {
|
||||
SMqDataRsp* pRsp = &pPushEntry->dataRsp;
|
||||
|
||||
tAssert(taosArrayGetSize(pRsp->blockData) == pRsp->blockNum);
|
||||
tAssert(taosArrayGetSize(pRsp->blockDataLen) == pRsp->blockNum);
|
||||
ASSERT(taosArrayGetSize(pRsp->blockData) == pRsp->blockNum);
|
||||
ASSERT(taosArrayGetSize(pRsp->blockDataLen) == pRsp->blockNum);
|
||||
|
||||
tAssert(!pRsp->withSchema);
|
||||
tAssert(taosArrayGetSize(pRsp->blockSchema) == 0);
|
||||
ASSERT(!pRsp->withSchema);
|
||||
ASSERT(taosArrayGetSize(pRsp->blockSchema) == 0);
|
||||
|
||||
if (pRsp->reqOffset.type == TMQ_OFFSET__LOG) {
|
||||
/*if (pRsp->blockNum > 0) {*/
|
||||
/*tAssert(pRsp->rspOffset.version > pRsp->reqOffset.version);*/
|
||||
/*ASSERT(pRsp->rspOffset.version > pRsp->reqOffset.version);*/
|
||||
/*} else {*/
|
||||
tAssert(pRsp->rspOffset.version > pRsp->reqOffset.version);
|
||||
ASSERT(pRsp->rspOffset.version > pRsp->reqOffset.version);
|
||||
/*}*/
|
||||
}
|
||||
|
||||
|
@ -223,17 +223,17 @@ int32_t tqPushDataRsp(STQ* pTq, STqPushEntry* pPushEntry) {
|
|||
}
|
||||
|
||||
int32_t tqSendDataRsp(STQ* pTq, const SRpcMsg* pMsg, const SMqPollReq* pReq, const SMqDataRsp* pRsp) {
|
||||
tAssert(taosArrayGetSize(pRsp->blockData) == pRsp->blockNum);
|
||||
tAssert(taosArrayGetSize(pRsp->blockDataLen) == pRsp->blockNum);
|
||||
ASSERT(taosArrayGetSize(pRsp->blockData) == pRsp->blockNum);
|
||||
ASSERT(taosArrayGetSize(pRsp->blockDataLen) == pRsp->blockNum);
|
||||
|
||||
tAssert(!pRsp->withSchema);
|
||||
tAssert(taosArrayGetSize(pRsp->blockSchema) == 0);
|
||||
ASSERT(!pRsp->withSchema);
|
||||
ASSERT(taosArrayGetSize(pRsp->blockSchema) == 0);
|
||||
|
||||
if (pRsp->reqOffset.type == TMQ_OFFSET__LOG) {
|
||||
if (pRsp->blockNum > 0) {
|
||||
tAssert(pRsp->rspOffset.version > pRsp->reqOffset.version);
|
||||
ASSERT(pRsp->rspOffset.version > pRsp->reqOffset.version);
|
||||
} else {
|
||||
tAssert(pRsp->rspOffset.version >= pRsp->reqOffset.version);
|
||||
ASSERT(pRsp->rspOffset.version >= pRsp->reqOffset.version);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -279,20 +279,20 @@ int32_t tqSendDataRsp(STQ* pTq, const SRpcMsg* pMsg, const SMqPollReq* pReq, con
|
|||
}
|
||||
|
||||
int32_t tqSendTaosxRsp(STQ* pTq, const SRpcMsg* pMsg, const SMqPollReq* pReq, const STaosxRsp* pRsp) {
|
||||
tAssert(taosArrayGetSize(pRsp->blockData) == pRsp->blockNum);
|
||||
tAssert(taosArrayGetSize(pRsp->blockDataLen) == pRsp->blockNum);
|
||||
ASSERT(taosArrayGetSize(pRsp->blockData) == pRsp->blockNum);
|
||||
ASSERT(taosArrayGetSize(pRsp->blockDataLen) == pRsp->blockNum);
|
||||
|
||||
if (pRsp->withSchema) {
|
||||
tAssert(taosArrayGetSize(pRsp->blockSchema) == pRsp->blockNum);
|
||||
ASSERT(taosArrayGetSize(pRsp->blockSchema) == pRsp->blockNum);
|
||||
} else {
|
||||
tAssert(taosArrayGetSize(pRsp->blockSchema) == 0);
|
||||
ASSERT(taosArrayGetSize(pRsp->blockSchema) == 0);
|
||||
}
|
||||
|
||||
if (pRsp->reqOffset.type == TMQ_OFFSET__LOG) {
|
||||
if (pRsp->blockNum > 0) {
|
||||
tAssert(pRsp->rspOffset.version > pRsp->reqOffset.version);
|
||||
ASSERT(pRsp->rspOffset.version > pRsp->reqOffset.version);
|
||||
} else {
|
||||
tAssert(pRsp->rspOffset.version >= pRsp->reqOffset.version);
|
||||
ASSERT(pRsp->rspOffset.version >= pRsp->reqOffset.version);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -348,7 +348,7 @@ int32_t tqProcessOffsetCommitReq(STQ* pTq, int64_t version, char* msg, int32_t m
|
|||
SDecoder decoder;
|
||||
tDecoderInit(&decoder, msg, msgLen);
|
||||
if (tDecodeSTqOffset(&decoder, &offset) < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
return -1;
|
||||
}
|
||||
tDecoderClear(&decoder);
|
||||
|
@ -363,7 +363,7 @@ int32_t tqProcessOffsetCommitReq(STQ* pTq, int64_t version, char* msg, int32_t m
|
|||
offset.val.version += 1;
|
||||
}
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
STqOffset* pOffset = tqOffsetRead(pTq->pOffsetStore, offset.subKey);
|
||||
if (pOffset != NULL && tqOffsetLessOrEqual(&offset, pOffset)) {
|
||||
|
@ -371,7 +371,7 @@ int32_t tqProcessOffsetCommitReq(STQ* pTq, int64_t version, char* msg, int32_t m
|
|||
}
|
||||
|
||||
if (tqOffsetWrite(pTq->pOffsetStore, &offset) < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -434,7 +434,7 @@ static int32_t tqInitDataRsp(SMqDataRsp* pRsp, const SMqPollReq* pReq, int8_t su
|
|||
}
|
||||
#endif
|
||||
|
||||
tAssert(subType == TOPIC_SUB_TYPE__COLUMN);
|
||||
ASSERT(subType == TOPIC_SUB_TYPE__COLUMN);
|
||||
pRsp->withSchema = false;
|
||||
|
||||
return 0;
|
||||
|
@ -473,7 +473,7 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg) {
|
|||
|
||||
// 1.find handle
|
||||
STqHandle* pHandle = taosHashGet(pTq->pHandle, req.subKey, strlen(req.subKey));
|
||||
/*tAssert(pHandle);*/
|
||||
/*ASSERT(pHandle);*/
|
||||
if (pHandle == NULL) {
|
||||
tqError("tmq poll: no consumer handle for consumer:%" PRId64 ", in vgId:%d, subkey %s", consumerId,
|
||||
TD_VID(pTq->pVnode), req.subKey);
|
||||
|
@ -599,7 +599,7 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg) {
|
|||
}
|
||||
|
||||
// for taosx
|
||||
tAssert(pHandle->execHandle.subType != TOPIC_SUB_TYPE__COLUMN);
|
||||
ASSERT(pHandle->execHandle.subType != TOPIC_SUB_TYPE__COLUMN);
|
||||
|
||||
SMqMetaRsp metaRsp = {0};
|
||||
|
||||
|
@ -690,8 +690,8 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg) {
|
|||
}
|
||||
|
||||
} else {
|
||||
tAssert(pHandle->fetchMeta);
|
||||
tAssert(IS_META_MSG(pHead->msgType));
|
||||
ASSERT(pHandle->fetchMeta);
|
||||
ASSERT(IS_META_MSG(pHead->msgType));
|
||||
tqDebug("fetch meta msg, ver:%" PRId64 ", type:%d", pHead->version, pHead->msgType);
|
||||
tqOffsetResetToLog(&metaRsp.rspOffset, fetchVer);
|
||||
metaRsp.resMsgType = pHead->msgType;
|
||||
|
@ -736,7 +736,7 @@ int32_t tqProcessDeleteSubReq(STQ* pTq, int64_t version, char* msg, int32_t msgL
|
|||
}
|
||||
|
||||
if (tqMetaDeleteHandle(pTq, pReq->subKey) < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -802,7 +802,7 @@ int32_t tqProcessSubscribeReq(STQ* pTq, int64_t version, char* msg, int32_t msgL
|
|||
// TODO version should be assigned and refed during preprocess
|
||||
SWalRef* pRef = walRefCommittedVer(pTq->pVnode->pWal);
|
||||
if (pRef == NULL) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
return -1;
|
||||
}
|
||||
int64_t ver = pRef->refVer;
|
||||
|
@ -823,12 +823,12 @@ int32_t tqProcessSubscribeReq(STQ* pTq, int64_t version, char* msg, int32_t msgL
|
|||
|
||||
pHandle->execHandle.task =
|
||||
qCreateQueueExecTaskInfo(pHandle->execHandle.execCol.qmsg, &handle, &pHandle->execHandle.numOfCols, NULL);
|
||||
tAssert(pHandle->execHandle.task);
|
||||
ASSERT(pHandle->execHandle.task);
|
||||
void* scanner = NULL;
|
||||
qExtractStreamScanner(pHandle->execHandle.task, &scanner);
|
||||
tAssert(scanner);
|
||||
ASSERT(scanner);
|
||||
pHandle->execHandle.pExecReader = qExtractReaderFromStreamScanner(scanner);
|
||||
tAssert(pHandle->execHandle.pExecReader);
|
||||
ASSERT(pHandle->execHandle.pExecReader);
|
||||
} else if (pHandle->execHandle.subType == TOPIC_SUB_TYPE__DB) {
|
||||
pHandle->pWalReader = walOpenReader(pTq->pVnode->pWal, NULL);
|
||||
pHandle->execHandle.pExecReader = tqOpenReader(pTq->pVnode);
|
||||
|
@ -862,10 +862,10 @@ int32_t tqProcessSubscribeReq(STQ* pTq, int64_t version, char* msg, int32_t msgL
|
|||
tqDebug("try to persist handle %s consumer %" PRId64, req.subKey, pHandle->consumerId);
|
||||
if (tqMetaSaveHandle(pTq, req.subKey, pHandle) < 0) {
|
||||
// TODO
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
} else {
|
||||
/*tAssert(pExec->consumerId == req.oldConsumerId);*/
|
||||
/*ASSERT(pExec->consumerId == req.oldConsumerId);*/
|
||||
// TODO handle qmsg and exec modification
|
||||
atomic_store_32(&pHandle->epoch, -1);
|
||||
atomic_store_64(&pHandle->consumerId, req.newConsumerId);
|
||||
|
@ -873,7 +873,7 @@ int32_t tqProcessSubscribeReq(STQ* pTq, int64_t version, char* msg, int32_t msgL
|
|||
taosMemoryFree(req.qmsg);
|
||||
if (tqMetaSaveHandle(pTq, req.subKey, pHandle) < 0) {
|
||||
// TODO
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
// close handle
|
||||
}
|
||||
|
@ -883,7 +883,7 @@ int32_t tqProcessSubscribeReq(STQ* pTq, int64_t version, char* msg, int32_t msgL
|
|||
|
||||
int32_t tqExpandTask(STQ* pTq, SStreamTask* pTask, int64_t ver) {
|
||||
if (pTask->taskLevel == TASK_LEVEL__AGG) {
|
||||
tAssert(taosArrayGetSize(pTask->childEpInfo) != 0);
|
||||
ASSERT(taosArrayGetSize(pTask->childEpInfo) != 0);
|
||||
}
|
||||
|
||||
pTask->refCnt = 1;
|
||||
|
@ -921,7 +921,7 @@ int32_t tqExpandTask(STQ* pTq, SStreamTask* pTask, int64_t ver) {
|
|||
.pStateBackend = pTask->pState,
|
||||
};
|
||||
pTask->exec.executor = qCreateStreamExecTaskInfo(pTask->exec.qmsg, &handle);
|
||||
tAssert(pTask->exec.executor);
|
||||
ASSERT(pTask->exec.executor);
|
||||
|
||||
} else if (pTask->taskLevel == TASK_LEVEL__AGG) {
|
||||
pTask->pState = streamStateOpen(pTq->pStreamMeta->path, pTask, false, -1, -1);
|
||||
|
@ -934,7 +934,7 @@ int32_t tqExpandTask(STQ* pTq, SStreamTask* pTask, int64_t ver) {
|
|||
.pStateBackend = pTask->pState,
|
||||
};
|
||||
pTask->exec.executor = qCreateStreamExecTaskInfo(pTask->exec.qmsg, &mgHandle);
|
||||
tAssert(pTask->exec.executor);
|
||||
ASSERT(pTask->exec.executor);
|
||||
}
|
||||
|
||||
// sink
|
||||
|
@ -946,12 +946,12 @@ int32_t tqExpandTask(STQ* pTq, SStreamTask* pTask, int64_t ver) {
|
|||
pTask->tbSink.vnode = pTq->pVnode;
|
||||
pTask->tbSink.tbSinkFunc = tqSinkToTablePipeline;
|
||||
|
||||
tAssert(pTask->tbSink.pSchemaWrapper);
|
||||
tAssert(pTask->tbSink.pSchemaWrapper->pSchema);
|
||||
ASSERT(pTask->tbSink.pSchemaWrapper);
|
||||
ASSERT(pTask->tbSink.pSchemaWrapper->pSchema);
|
||||
|
||||
pTask->tbSink.pTSchema =
|
||||
tdGetSTSChemaFromSSChema(pTask->tbSink.pSchemaWrapper->pSchema, pTask->tbSink.pSchemaWrapper->nCols, 1);
|
||||
tAssert(pTask->tbSink.pTSchema);
|
||||
ASSERT(pTask->tbSink.pTSchema);
|
||||
}
|
||||
|
||||
streamSetupTrigger(pTask);
|
||||
|
@ -997,7 +997,7 @@ int32_t tqProcessStreamTaskCheckReq(STQ* pTq, SRpcMsg* pMsg) {
|
|||
int32_t len;
|
||||
tEncodeSize(tEncodeSStreamTaskCheckRsp, &rsp, len, code);
|
||||
if (code < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
void* buf = rpcMallocCont(sizeof(SMsgHead) + len);
|
||||
((SMsgHead*)buf)->vgId = htonl(req.upstreamNodeId);
|
||||
|
@ -1090,12 +1090,12 @@ int32_t tqProcessTaskRecover1Req(STQ* pTq, SRpcMsg* pMsg) {
|
|||
if (pTask == NULL) {
|
||||
return -1;
|
||||
}
|
||||
tAssert(pReq->taskId == pTask->taskId);
|
||||
ASSERT(pReq->taskId == pTask->taskId);
|
||||
|
||||
// check param
|
||||
int64_t fillVer1 = pTask->startVer;
|
||||
if (fillVer1 <= 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
streamMetaReleaseTask(pTq->pStreamMeta, pTask);
|
||||
return -1;
|
||||
}
|
||||
|
@ -1290,7 +1290,7 @@ int32_t tqProcessDelReq(STQ* pTq, void* pReq, int32_t len, int64_t ver) {
|
|||
}
|
||||
|
||||
int32_t ref = atomic_sub_fetch_32(pRef, 1);
|
||||
tAssert(ref >= 0);
|
||||
ASSERT(ref >= 0);
|
||||
if (ref == 0) {
|
||||
blockDataDestroy(pDelBlock);
|
||||
taosMemoryFree(pRef);
|
||||
|
|
|
@ -29,7 +29,7 @@ int32_t tqAddBlockDataToRsp(const SSDataBlock* pBlock, SMqDataRsp* pRsp, int32_t
|
|||
|
||||
int32_t actualLen = blockEncode(pBlock, pRetrieve->data, numOfCols);
|
||||
actualLen += sizeof(SRetrieveTableRsp);
|
||||
tAssert(actualLen <= dataStrLen);
|
||||
ASSERT(actualLen <= dataStrLen);
|
||||
taosArrayPush(pRsp->blockDataLen, &actualLen);
|
||||
taosArrayPush(pRsp->blockData, &buf);
|
||||
return 0;
|
||||
|
@ -62,7 +62,7 @@ static int32_t tqAddTbNameToRsp(const STQ* pTq, int64_t uid, SMqDataRsp* pRsp, i
|
|||
|
||||
int32_t tqScanData(STQ* pTq, const STqHandle* pHandle, SMqDataRsp* pRsp, STqOffsetVal* pOffset) {
|
||||
const STqExecHandle* pExec = &pHandle->execHandle;
|
||||
tAssert(pExec->subType == TOPIC_SUB_TYPE__COLUMN);
|
||||
ASSERT(pExec->subType == TOPIC_SUB_TYPE__COLUMN);
|
||||
|
||||
qTaskInfo_t task = pExec->task;
|
||||
|
||||
|
@ -87,7 +87,7 @@ int32_t tqScanData(STQ* pTq, const STqHandle* pHandle, SMqDataRsp* pRsp, STqOffs
|
|||
uint64_t ts = 0;
|
||||
tqDebug("vgId:%d, tmq task start to execute", pTq->pVnode->config.vgId);
|
||||
if (qExecTask(task, &pDataBlock, &ts) < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
tqDebug("vgId:%d, tmq task executed, get %p", pTq->pVnode->config.vgId, pDataBlock);
|
||||
|
||||
|
@ -105,10 +105,10 @@ int32_t tqScanData(STQ* pTq, const STqHandle* pHandle, SMqDataRsp* pRsp, STqOffs
|
|||
}
|
||||
|
||||
if (qStreamExtractOffset(task, &pRsp->rspOffset) < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
return -1;
|
||||
}
|
||||
tAssert(pRsp->rspOffset.type != 0);
|
||||
ASSERT(pRsp->rspOffset.type != 0);
|
||||
|
||||
if (pRsp->withTbName) {
|
||||
if (pRsp->rspOffset.type == TMQ_OFFSET__LOG) {
|
||||
|
@ -118,7 +118,7 @@ int32_t tqScanData(STQ* pTq, const STqHandle* pHandle, SMqDataRsp* pRsp, STqOffs
|
|||
pRsp->withTbName = false;
|
||||
}
|
||||
}
|
||||
tAssert(pRsp->withSchema == false);
|
||||
ASSERT(pRsp->withSchema == false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -148,7 +148,7 @@ int32_t tqScanTaosx(STQ* pTq, const STqHandle* pHandle, STaosxRsp* pRsp, SMqMeta
|
|||
uint64_t ts = 0;
|
||||
tqDebug("tmqsnap task start to execute");
|
||||
if (qExecTask(task, &pDataBlock, &ts) < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
tqDebug("tmqsnap task execute end, get %p", pDataBlock);
|
||||
|
||||
|
@ -216,16 +216,16 @@ int32_t tqScanTaosx(STQ* pTq, const STqHandle* pHandle, STaosxRsp* pRsp, SMqMeta
|
|||
}
|
||||
|
||||
if (qStreamExtractOffset(task, &pRsp->rspOffset) < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
tAssert(pRsp->rspOffset.type != 0);
|
||||
ASSERT(pRsp->rspOffset.type != 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t tqTaosxScanLog(STQ* pTq, STqHandle* pHandle, SSubmitReq* pReq, STaosxRsp* pRsp) {
|
||||
STqExecHandle* pExec = &pHandle->execHandle;
|
||||
tAssert(pExec->subType != TOPIC_SUB_TYPE__COLUMN);
|
||||
ASSERT(pExec->subType != TOPIC_SUB_TYPE__COLUMN);
|
||||
|
||||
SArray* pBlocks = taosArrayInit(0, sizeof(SSDataBlock));
|
||||
SArray* pSchemas = taosArrayInit(0, sizeof(void*));
|
||||
|
|
|
@ -71,17 +71,17 @@ int32_t tDecodeSTqHandle(SDecoder* pDecoder, STqHandle* pHandle) {
|
|||
|
||||
int32_t tqMetaOpen(STQ* pTq) {
|
||||
if (tdbOpen(pTq->path, 16 * 1024, 1, &pTq->pMetaDB, 0) < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (tdbTbOpen("tq.db", -1, -1, NULL, pTq->pMetaDB, &pTq->pExecStore, 0) < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (tdbTbOpen("tq.check.db", -1, -1, NULL, pTq->pMetaDB, &pTq->pCheckStore, 0) < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -135,19 +135,19 @@ int32_t tqMetaDeleteCheckInfo(STQ* pTq, const char* key) {
|
|||
|
||||
if (tdbBegin(pTq->pMetaDB, &txn, tdbDefaultMalloc, tdbDefaultFree, NULL, TDB_TXN_WRITE | TDB_TXN_READ_UNCOMMITTED) <
|
||||
0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
if (tdbTbDelete(pTq->pCheckStore, key, (int)strlen(key), txn) < 0) {
|
||||
/*tAssert(0);*/
|
||||
/*ASSERT(0);*/
|
||||
}
|
||||
|
||||
if (tdbCommit(pTq->pMetaDB, txn) < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
if (tdbPostCommit(pTq->pMetaDB, txn) < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -156,7 +156,7 @@ int32_t tqMetaDeleteCheckInfo(STQ* pTq, const char* key) {
|
|||
int32_t tqMetaRestoreCheckInfo(STQ* pTq) {
|
||||
TBC* pCur = NULL;
|
||||
if (tdbTbcOpen(pTq->pCheckStore, &pCur, NULL) < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -197,40 +197,40 @@ int32_t tqMetaSaveHandle(STQ* pTq, const char* key, const STqHandle* pHandle) {
|
|||
int32_t code;
|
||||
int32_t vlen;
|
||||
tEncodeSize(tEncodeSTqHandle, pHandle, vlen, code);
|
||||
tAssert(code == 0);
|
||||
ASSERT(code == 0);
|
||||
|
||||
tqDebug("tq save %s(%d) consumer %" PRId64 " vgId:%d", pHandle->subKey, (int32_t)strlen(pHandle->subKey),
|
||||
pHandle->consumerId, TD_VID(pTq->pVnode));
|
||||
|
||||
void* buf = taosMemoryCalloc(1, vlen);
|
||||
if (buf == NULL) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
SEncoder encoder;
|
||||
tEncoderInit(&encoder, buf, vlen);
|
||||
|
||||
if (tEncodeSTqHandle(&encoder, pHandle) < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
TXN* txn;
|
||||
|
||||
if (tdbBegin(pTq->pMetaDB, &txn, tdbDefaultMalloc, tdbDefaultFree, NULL, TDB_TXN_WRITE | TDB_TXN_READ_UNCOMMITTED) <
|
||||
0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
if (tdbTbUpsert(pTq->pExecStore, key, (int)strlen(key), buf, vlen, txn) < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
if (tdbCommit(pTq->pMetaDB, txn) < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
if (tdbPostCommit(pTq->pMetaDB, txn) < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
tEncoderClear(&encoder);
|
||||
|
@ -243,19 +243,19 @@ int32_t tqMetaDeleteHandle(STQ* pTq, const char* key) {
|
|||
|
||||
if (tdbBegin(pTq->pMetaDB, &txn, tdbDefaultMalloc, tdbDefaultFree, NULL, TDB_TXN_WRITE | TDB_TXN_READ_UNCOMMITTED) <
|
||||
0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
if (tdbTbDelete(pTq->pExecStore, key, (int)strlen(key), txn) < 0) {
|
||||
/*tAssert(0);*/
|
||||
/*ASSERT(0);*/
|
||||
}
|
||||
|
||||
if (tdbCommit(pTq->pMetaDB, txn) < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
if (tdbPostCommit(pTq->pMetaDB, txn) < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -264,7 +264,7 @@ int32_t tqMetaDeleteHandle(STQ* pTq, const char* key) {
|
|||
int32_t tqMetaRestoreHandle(STQ* pTq) {
|
||||
TBC* pCur = NULL;
|
||||
if (tdbTbcOpen(pTq->pExecStore, &pCur, NULL) < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -284,7 +284,7 @@ int32_t tqMetaRestoreHandle(STQ* pTq) {
|
|||
|
||||
handle.pRef = walOpenRef(pTq->pVnode->pWal);
|
||||
if (handle.pRef == NULL) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
return -1;
|
||||
}
|
||||
walRefVer(handle.pRef, handle.snapshotVer);
|
||||
|
@ -300,12 +300,12 @@ int32_t tqMetaRestoreHandle(STQ* pTq) {
|
|||
if (handle.execHandle.subType == TOPIC_SUB_TYPE__COLUMN) {
|
||||
handle.execHandle.task =
|
||||
qCreateQueueExecTaskInfo(handle.execHandle.execCol.qmsg, &reader, &handle.execHandle.numOfCols, NULL);
|
||||
tAssert(handle.execHandle.task);
|
||||
ASSERT(handle.execHandle.task);
|
||||
void* scanner = NULL;
|
||||
qExtractStreamScanner(handle.execHandle.task, &scanner);
|
||||
tAssert(scanner);
|
||||
ASSERT(scanner);
|
||||
handle.execHandle.pExecReader = qExtractReaderFromStreamScanner(scanner);
|
||||
tAssert(handle.execHandle.pExecReader);
|
||||
ASSERT(handle.execHandle.pExecReader);
|
||||
} else if (handle.execHandle.subType == TOPIC_SUB_TYPE__DB) {
|
||||
handle.pWalReader = walOpenReader(pTq->pVnode->pWal, NULL);
|
||||
handle.execHandle.pExecReader = tqOpenReader(pTq->pVnode);
|
||||
|
|
|
@ -40,25 +40,25 @@ int32_t tqOffsetRestoreFromFile(STqOffsetStore* pStore, const char* fname) {
|
|||
if (code == 0) {
|
||||
break;
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
// TODO handle error
|
||||
}
|
||||
}
|
||||
int32_t size = htonl(head.size);
|
||||
void* memBuf = taosMemoryCalloc(1, size);
|
||||
if ((code = taosReadFile(pFile, memBuf, size)) != size) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
// TODO handle error
|
||||
}
|
||||
STqOffset offset;
|
||||
SDecoder decoder;
|
||||
tDecoderInit(&decoder, memBuf, size);
|
||||
if (tDecodeSTqOffset(&decoder, &offset) < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
tDecoderClear(&decoder);
|
||||
if (taosHashPut(pStore->pHash, offset.subKey, strlen(offset.subKey), &offset, sizeof(STqOffset)) < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
// TODO
|
||||
}
|
||||
taosMemoryFree(memBuf);
|
||||
|
@ -85,7 +85,7 @@ STqOffsetStore* tqOffsetOpen(STQ* pTq) {
|
|||
}
|
||||
char* fname = tqOffsetBuildFName(pStore->pTq->path, 0);
|
||||
if (tqOffsetRestoreFromFile(pStore, fname) < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
taosMemoryFree(fname);
|
||||
return pStore;
|
||||
|
@ -124,7 +124,7 @@ int32_t tqOffsetCommitFile(STqOffsetStore* pStore) {
|
|||
const char* sysErrStr = strerror(errno);
|
||||
tqError("vgId:%d, cannot open file %s when commit offset since %s", pStore->pTq->pVnode->config.vgId, fname,
|
||||
sysErrStr);
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
return -1;
|
||||
}
|
||||
taosMemoryFree(fname);
|
||||
|
@ -136,9 +136,9 @@ int32_t tqOffsetCommitFile(STqOffsetStore* pStore) {
|
|||
int32_t bodyLen;
|
||||
int32_t code;
|
||||
tEncodeSize(tEncodeSTqOffset, pOffset, bodyLen, code);
|
||||
tAssert(code == 0);
|
||||
ASSERT(code == 0);
|
||||
if (code < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
taosHashCancelIterate(pStore->pHash, pIter);
|
||||
return -1;
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ int32_t tqOffsetCommitFile(STqOffsetStore* pStore) {
|
|||
// write file
|
||||
int64_t writeLen;
|
||||
if ((writeLen = taosWriteFile(pFile, buf, totLen)) != totLen) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
tqError("write offset incomplete, len %d, write len %" PRId64, bodyLen, writeLen);
|
||||
taosHashCancelIterate(pStore->pHash, pIter);
|
||||
taosMemoryFree(buf);
|
||||
|
|
|
@ -61,7 +61,7 @@ int32_t tqOffsetSnapRead(STqOffsetReader* pReader, uint8_t** ppData) {
|
|||
|
||||
int64_t sz = 0;
|
||||
if (taosStatFile(fname, &sz, NULL) < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
taosMemoryFree(fname);
|
||||
|
||||
|
@ -73,7 +73,7 @@ int32_t tqOffsetSnapRead(STqOffsetReader* pReader, uint8_t** ppData) {
|
|||
void* abuf = POINTER_SHIFT(buf, sizeof(SSnapDataHdr));
|
||||
int64_t contLen = taosReadFile(pFile, abuf, sz);
|
||||
if (contLen != sz) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
return -1;
|
||||
}
|
||||
buf->size = sz;
|
||||
|
@ -122,14 +122,14 @@ int32_t tqOffsetWriterClose(STqOffsetWriter** ppWriter, int8_t rollback) {
|
|||
|
||||
if (rollback) {
|
||||
if (taosRemoveFile(pWriter->fname) < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
} else {
|
||||
if (taosRenameFile(pWriter->fname, fname) < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
if (tqOffsetRestoreFromFile(pTq->pOffsetStore, fname) < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
}
|
||||
taosMemoryFree(fname);
|
||||
|
@ -146,14 +146,14 @@ int32_t tqOffsetSnapWrite(STqOffsetWriter* pWriter, uint8_t* pData, uint32_t nDa
|
|||
TdFilePtr pFile = taosOpenFile(pWriter->fname, TD_FILE_CREATE | TD_FILE_WRITE);
|
||||
SSnapDataHdr* pHdr = (SSnapDataHdr*)pData;
|
||||
int64_t size = pHdr->size;
|
||||
tAssert(size == nData - sizeof(SSnapDataHdr));
|
||||
ASSERT(size == nData - sizeof(SSnapDataHdr));
|
||||
if (pFile) {
|
||||
int64_t contLen = taosWriteFile(pFile, pHdr->data, size);
|
||||
if (contLen != size) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
|
|
|
@ -25,9 +25,9 @@ void tqTmrRspFunc(void* param, void* tmrId) {
|
|||
static int32_t tqLoopExecFromQueue(STQ* pTq, STqHandle* pHandle, SStreamDataSubmit** ppSubmit, SMqDataRsp* pRsp) {
|
||||
SStreamDataSubmit* pSubmit = *ppSubmit;
|
||||
while (pSubmit != NULL) {
|
||||
tAssert(pSubmit->ver == pHandle->pushHandle.processedVer + 1);
|
||||
ASSERT(pSubmit->ver == pHandle->pushHandle.processedVer + 1);
|
||||
if (tqLogScanExec(pTq, &pHandle->execHandle, pSubmit->data, pRsp, 0) < 0) {
|
||||
/*tAssert(0);*/
|
||||
/*ASSERT(0);*/
|
||||
}
|
||||
// update processed
|
||||
atomic_store_64(&pHandle->pushHandle.processedVer, pSubmit->ver);
|
||||
|
@ -161,7 +161,7 @@ int32_t tqPushMsgNew(STQ* pTq, void* msg, int32_t msgLen, tmsg_t msgType, int64_
|
|||
tqLogScanExec(pTq, &pHandle->execHandle, pReq, &rsp, workerId);
|
||||
} else {
|
||||
// TODO
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
if (rsp.blockNum == 0) {
|
||||
|
@ -169,8 +169,8 @@ int32_t tqPushMsgNew(STQ* pTq, void* msg, int32_t msgLen, tmsg_t msgType, int64_
|
|||
continue;
|
||||
}
|
||||
|
||||
tAssert(taosArrayGetSize(rsp.blockData) == rsp.blockNum);
|
||||
tAssert(taosArrayGetSize(rsp.blockDataLen) == rsp.blockNum);
|
||||
ASSERT(taosArrayGetSize(rsp.blockData) == rsp.blockNum);
|
||||
ASSERT(taosArrayGetSize(rsp.blockDataLen) == rsp.blockNum);
|
||||
|
||||
rsp.rspOffset = fetchOffset;
|
||||
|
||||
|
@ -263,7 +263,7 @@ int tqPushMsg(STQ* pTq, void* msg, int32_t msgLen, tmsg_t msgType, int64_t ver)
|
|||
SSDataBlock* pDataBlock = NULL;
|
||||
uint64_t ts = 0;
|
||||
if (qExecTask(task, &pDataBlock, &ts) < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
if (pDataBlock == NULL) {
|
||||
|
@ -296,7 +296,7 @@ int tqPushMsg(STQ* pTq, void* msg, int32_t msgLen, tmsg_t msgType, int64_t ver)
|
|||
void* key = taosArrayGetP(cachedKeys, i);
|
||||
size_t kLen = *(size_t*)taosArrayGet(cachedKeyLens, i);
|
||||
if (taosHashRemove(pTq->pPushMgr, key, kLen) != 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
}
|
||||
taosArrayDestroyP(cachedKeys, (FDelete)taosMemoryFree);
|
||||
|
|
|
@ -177,7 +177,7 @@ bool isValValidForTable(STqHandle* pHandle, SWalCont* pHead) {
|
|||
}
|
||||
realTbSuid = req.suid;
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
end:
|
||||
|
@ -206,7 +206,7 @@ int64_t tqFetchLog(STQ* pTq, STqHandle* pHandle, int64_t* fetchOffset, SWalCkHea
|
|||
code = walFetchBody(pHandle->pWalReader, ppCkHead);
|
||||
|
||||
if (code < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
*fetchOffset = offset;
|
||||
code = -1;
|
||||
goto END;
|
||||
|
@ -220,7 +220,7 @@ int64_t tqFetchLog(STQ* pTq, STqHandle* pHandle, int64_t* fetchOffset, SWalCkHea
|
|||
if (IS_META_MSG(pHead->msgType)) {
|
||||
code = walFetchBody(pHandle->pWalReader, ppCkHead);
|
||||
if (code < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
*fetchOffset = offset;
|
||||
code = -1;
|
||||
goto END;
|
||||
|
@ -238,7 +238,7 @@ int64_t tqFetchLog(STQ* pTq, STqHandle* pHandle, int64_t* fetchOffset, SWalCkHea
|
|||
}
|
||||
code = walSkipFetchBody(pHandle->pWalReader, *ppCkHead);
|
||||
if (code < 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
*fetchOffset = offset;
|
||||
code = -1;
|
||||
goto END;
|
||||
|
@ -297,11 +297,11 @@ void tqCloseReader(STqReader* pReader) {
|
|||
|
||||
int32_t tqSeekVer(STqReader* pReader, int64_t ver) {
|
||||
if (walReadSeekVer(pReader->pWalReader, ver) < 0) {
|
||||
tAssert(pReader->pWalReader->curInvalid);
|
||||
tAssert(pReader->pWalReader->curVersion == ver);
|
||||
ASSERT(pReader->pWalReader->curInvalid);
|
||||
ASSERT(pReader->pWalReader->curVersion == ver);
|
||||
return -1;
|
||||
}
|
||||
tAssert(pReader->pWalReader->curVersion == ver);
|
||||
ASSERT(pReader->pWalReader->curVersion == ver);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -317,7 +317,7 @@ int32_t tqNextBlock(STqReader* pReader, SFetchRet* ret) {
|
|||
ret->offset.version = pReader->ver;
|
||||
ret->fetchType = FETCH_TYPE__NONE;
|
||||
tqDebug("return offset %" PRId64 ", no more valid", ret->offset.version);
|
||||
tAssert(ret->offset.version >= 0);
|
||||
ASSERT(ret->offset.version >= 0);
|
||||
return -1;
|
||||
}
|
||||
void* body = pReader->pWalReader->pHead->head.body;
|
||||
|
@ -340,7 +340,7 @@ int32_t tqNextBlock(STqReader* pReader, SFetchRet* ret) {
|
|||
memset(&ret->data, 0, sizeof(SSDataBlock));
|
||||
int32_t code = tqRetrieveDataBlock(&ret->data, pReader);
|
||||
if (code != 0 || ret->data.info.rows == 0) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
continue;
|
||||
}
|
||||
ret->fetchType = FETCH_TYPE__DATA;
|
||||
|
@ -351,7 +351,7 @@ int32_t tqNextBlock(STqReader* pReader, SFetchRet* ret) {
|
|||
if (fromProcessedMsg) {
|
||||
ret->offset.type = TMQ_OFFSET__LOG;
|
||||
ret->offset.version = pReader->ver;
|
||||
tAssert(pReader->ver >= 0);
|
||||
ASSERT(pReader->ver >= 0);
|
||||
ret->fetchType = FETCH_TYPE__SEP;
|
||||
tqDebug("return offset %" PRId64 ", processed finish", ret->offset.version);
|
||||
return 0;
|
||||
|
@ -434,7 +434,7 @@ bool tqNextDataBlockFilterOut(STqReader* pHandle, SHashObj* filterOutUids) {
|
|||
}
|
||||
if (pHandle->pBlock == NULL) return false;
|
||||
|
||||
tAssert(pHandle->tbIdHash == NULL);
|
||||
ASSERT(pHandle->tbIdHash == NULL);
|
||||
void* ret = taosHashGet(filterOutUids, &pHandle->msgIter.uid, sizeof(int64_t));
|
||||
if (ret == NULL) {
|
||||
return true;
|
||||
|
@ -453,7 +453,7 @@ int32_t tqRetrieveDataBlock(SSDataBlock* pBlock, STqReader* pReader) {
|
|||
if (pReader->pSchema == NULL) {
|
||||
tqWarn("cannot found tsschema for table: uid:%" PRId64 " (suid:%" PRId64 "), version %d, possibly dropped table",
|
||||
pReader->msgIter.uid, pReader->msgIter.suid, pReader->cachedSchemaVer);
|
||||
/*tAssert(0);*/
|
||||
/*ASSERT(0);*/
|
||||
pReader->cachedSchemaSuid = 0;
|
||||
terrno = TSDB_CODE_TQ_TABLE_SCHEMA_NOT_FOUND;
|
||||
return -1;
|
||||
|
@ -464,7 +464,7 @@ int32_t tqRetrieveDataBlock(SSDataBlock* pBlock, STqReader* pReader) {
|
|||
if (pReader->pSchemaWrapper == NULL) {
|
||||
tqWarn("cannot found schema wrapper for table: suid:%" PRId64 ", version %d, possibly dropped table",
|
||||
pReader->msgIter.uid, pReader->cachedSchemaVer);
|
||||
/*tAssert(0);*/
|
||||
/*ASSERT(0);*/
|
||||
pReader->cachedSchemaSuid = 0;
|
||||
terrno = TSDB_CODE_TQ_TABLE_SCHEMA_NOT_FOUND;
|
||||
return -1;
|
||||
|
@ -566,7 +566,7 @@ int32_t tqRetrieveTaosxBlock(STqReader* pReader, SArray* blocks, SArray* schemas
|
|||
if (pReader->pSchema == NULL) {
|
||||
tqWarn("cannot found tsschema for table: uid:%" PRId64 " (suid:%" PRId64 "), version %d, possibly dropped table",
|
||||
pReader->msgIter.uid, pReader->msgIter.suid, pReader->cachedSchemaVer);
|
||||
/*tAssert(0);*/
|
||||
/*ASSERT(0);*/
|
||||
pReader->cachedSchemaSuid = 0;
|
||||
terrno = TSDB_CODE_TQ_TABLE_SCHEMA_NOT_FOUND;
|
||||
return -1;
|
||||
|
@ -577,7 +577,7 @@ int32_t tqRetrieveTaosxBlock(STqReader* pReader, SArray* blocks, SArray* schemas
|
|||
if (pReader->pSchemaWrapper == NULL) {
|
||||
tqWarn("cannot found schema wrapper for table: suid:%" PRId64 ", version %d, possibly dropped table",
|
||||
pReader->msgIter.uid, pReader->cachedSchemaVer);
|
||||
/*tAssert(0);*/
|
||||
/*ASSERT(0);*/
|
||||
pReader->cachedSchemaSuid = 0;
|
||||
terrno = TSDB_CODE_TQ_TABLE_SCHEMA_NOT_FOUND;
|
||||
return -1;
|
||||
|
@ -670,7 +670,7 @@ int32_t tqRetrieveTaosxBlock(STqReader* pReader, SArray* blocks, SArray* schemas
|
|||
break;
|
||||
}
|
||||
|
||||
tAssert(sVal.valType != TD_VTYPE_NONE);
|
||||
ASSERT(sVal.valType != TD_VTYPE_NONE);
|
||||
|
||||
if (colDataAppend(pColData, curRow, sVal.val, sVal.valType == TD_VTYPE_NULL) < 0) {
|
||||
goto FAIL;
|
||||
|
@ -731,7 +731,7 @@ int tqReaderAddTbUidList(STqReader* pReader, const SArray* tbUidList) {
|
|||
}
|
||||
|
||||
int tqReaderRemoveTbUidList(STqReader* pReader, const SArray* tbUidList) {
|
||||
tAssert(pReader->tbIdHash != NULL);
|
||||
ASSERT(pReader->tbIdHash != NULL);
|
||||
|
||||
for (int32_t i = 0; i < taosArrayGetSize(tbUidList); i++) {
|
||||
int64_t* pKey = (int64_t*)taosArrayGet(tbUidList, i);
|
||||
|
@ -749,7 +749,7 @@ int32_t tqUpdateTbUidList(STQ* pTq, const SArray* tbUidList, bool isAdd) {
|
|||
STqHandle* pExec = (STqHandle*)pIter;
|
||||
if (pExec->execHandle.subType == TOPIC_SUB_TYPE__COLUMN) {
|
||||
int32_t code = qUpdateQualifiedTableId(pExec->execHandle.task, tbUidList, isAdd);
|
||||
tAssert(code == 0);
|
||||
ASSERT(code == 0);
|
||||
} else if (pExec->execHandle.subType == TOPIC_SUB_TYPE__DB) {
|
||||
if (!isAdd) {
|
||||
int32_t sz = taosArrayGetSize(tbUidList);
|
||||
|
@ -790,7 +790,7 @@ int32_t tqUpdateTbUidList(STQ* pTq, const SArray* tbUidList, bool isAdd) {
|
|||
// TODO handle delete table from stb
|
||||
}
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
}
|
||||
while (1) {
|
||||
|
@ -799,7 +799,7 @@ int32_t tqUpdateTbUidList(STQ* pTq, const SArray* tbUidList, bool isAdd) {
|
|||
SStreamTask* pTask = *(SStreamTask**)pIter;
|
||||
if (pTask->taskLevel == TASK_LEVEL__SOURCE) {
|
||||
int32_t code = qUpdateQualifiedTableId(pTask->exec.executor, tbUidList, isAdd);
|
||||
tAssert(code == 0);
|
||||
ASSERT(code == 0);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
int32_t tqBuildDeleteReq(SVnode* pVnode, const char* stbFullName, const SSDataBlock* pDataBlock,
|
||||
SBatchDeleteReq* deleteReq) {
|
||||
tAssert(pDataBlock->info.type == STREAM_DELETE_RESULT);
|
||||
ASSERT(pDataBlock->info.type == STREAM_DELETE_RESULT);
|
||||
int32_t totRow = pDataBlock->info.rows;
|
||||
SColumnInfoData* pStartTsCol = taosArrayGet(pDataBlock->pDataBlock, START_TS_COLUMN_INDEX);
|
||||
SColumnInfoData* pEndTsCol = taosArrayGet(pDataBlock->pDataBlock, END_TS_COLUMN_INDEX);
|
||||
|
@ -335,7 +335,7 @@ void tqSinkToTablePipeline(SStreamTask* pTask, void* vnode, int64_t ver, void* d
|
|||
tEncodeSize(tEncodeSBatchDeleteReq, &deleteReq, len, code);
|
||||
if (code < 0) {
|
||||
//
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
SEncoder encoder;
|
||||
void* serializedDeleteReq = rpcMallocCont(len + sizeof(SMsgHead));
|
||||
|
@ -559,7 +559,7 @@ void tqSinkToTableMerge(SStreamTask* pTask, void* vnode, int64_t ver, void* data
|
|||
|
||||
tqDebug("vgId:%d, task %d write into table, block num: %d", TD_VID(pVnode), pTask->taskId, (int32_t)pRes->size);
|
||||
|
||||
tAssert(pTask->tbSink.pTSchema);
|
||||
ASSERT(pTask->tbSink.pTSchema);
|
||||
deleteReq.deleteReqs = taosArrayInit(0, sizeof(SSingleDeleteReq));
|
||||
SSubmitReq* submitReq = tqBlockToSubmit(pVnode, pRes, pTask->tbSink.pTSchema, pTask->tbSink.pSchemaWrapper, true,
|
||||
pTask->tbSink.stbUid, pTask->tbSink.stbFullName, &deleteReq);
|
||||
|
@ -572,7 +572,7 @@ void tqSinkToTableMerge(SStreamTask* pTask, void* vnode, int64_t ver, void* data
|
|||
tEncodeSize(tEncodeSBatchDeleteReq, &deleteReq, len, code);
|
||||
if (code < 0) {
|
||||
//
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
SEncoder encoder;
|
||||
void* serializedDeleteReq = rpcMallocCont(len + sizeof(SMsgHead));
|
||||
|
|
|
@ -100,7 +100,7 @@ int32_t tqSnapRead(STqSnapReader* pReader, uint8_t** ppData) {
|
|||
}
|
||||
}
|
||||
|
||||
tAssert(pVal && vLen);
|
||||
ASSERT(pVal && vLen);
|
||||
|
||||
*ppData = taosMemoryMalloc(sizeof(SSnapDataHdr) + vLen);
|
||||
if (*ppData == NULL) {
|
||||
|
|
|
@ -100,7 +100,7 @@ int32_t tqSnapRead(STqSnapReader* pReader, uint8_t** ppData) {
|
|||
}
|
||||
}
|
||||
|
||||
tAssert(pVal && vLen);
|
||||
ASSERT(pVal && vLen);
|
||||
|
||||
*ppData = taosMemoryMalloc(sizeof(SSnapDataHdr) + vLen);
|
||||
if (*ppData == NULL) {
|
||||
|
@ -168,7 +168,7 @@ int32_t tqSnapWriterClose(STqSnapWriter** ppWriter, int8_t rollback) {
|
|||
|
||||
if (rollback) {
|
||||
tdbAbort(pWriter->pTq->pMetaDB, pWriter->txn);
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
} else {
|
||||
code = tdbCommit(pWriter->pTq->pMetaDB, pWriter->txn);
|
||||
if (code) goto _err;
|
||||
|
|
|
@ -100,7 +100,7 @@ int32_t tqSnapRead(STqSnapReader* pReader, uint8_t** ppData) {
|
|||
}
|
||||
}
|
||||
|
||||
tAssert(pVal && vLen);
|
||||
ASSERT(pVal && vLen);
|
||||
|
||||
*ppData = taosMemoryMalloc(sizeof(SSnapDataHdr) + vLen);
|
||||
if (*ppData == NULL) {
|
||||
|
@ -168,7 +168,7 @@ int32_t tqSnapWriterClose(STqSnapWriter** ppWriter, int8_t rollback) {
|
|||
|
||||
if (rollback) {
|
||||
tdbAbort(pWriter->pTq->pMetaStore, pWriter->txn);
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
} else {
|
||||
code = tdbCommit(pWriter->pTq->pMetaStore, pWriter->txn);
|
||||
if (code) goto _err;
|
||||
|
|
|
@ -525,7 +525,7 @@ static int32_t getNextRowFromFSLast(void *iter, TSDBROW **ppRow) {
|
|||
|
||||
return code;
|
||||
default:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -723,7 +723,7 @@ static int32_t getNextRowFromFS(void *iter, TSDBROW **ppRow) {
|
|||
|
||||
return code;
|
||||
default:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -822,7 +822,7 @@ static int32_t getNextRowFromMem(void *iter, TSDBROW **ppRow) {
|
|||
return code;
|
||||
}
|
||||
default:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
static void saveOneRow(SArray* pRow, SSDataBlock* pBlock, SCacheRowsReader* pReader, const int32_t* slotIds,
|
||||
void** pRes) {
|
||||
tAssert(pReader->numOfCols <= taosArrayGetSize(pBlock->pDataBlock));
|
||||
ASSERT(pReader->numOfCols <= taosArrayGetSize(pBlock->pDataBlock));
|
||||
int32_t numOfRows = pBlock->info.rows;
|
||||
|
||||
if (HASTYPE(pReader->type, CACHESCAN_RETRIEVE_LAST)) {
|
||||
|
@ -66,7 +66,7 @@ static void saveOneRow(SArray* pRow, SSDataBlock* pBlock, SCacheRowsReader* pRea
|
|||
|
||||
pBlock->info.rows += allNullRow ? 0 : 1;
|
||||
} else {
|
||||
tAssert(HASTYPE(pReader->type, CACHESCAN_RETRIEVE_LAST_ROW));
|
||||
ASSERT(HASTYPE(pReader->type, CACHESCAN_RETRIEVE_LAST_ROW));
|
||||
|
||||
for (int32_t i = 0; i < pReader->numOfCols; ++i) {
|
||||
SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, i);
|
||||
|
|
|
@ -153,7 +153,7 @@ _exit:
|
|||
|
||||
int32_t tsdbPrepareCommit(STsdb *pTsdb) {
|
||||
taosThreadRwlockWrlock(&pTsdb->rwLock);
|
||||
tAssert(pTsdb->imem == NULL);
|
||||
ASSERT(pTsdb->imem == NULL);
|
||||
pTsdb->imem = pTsdb->mem;
|
||||
pTsdb->mem = NULL;
|
||||
taosThreadRwlockUnlock(&pTsdb->rwLock);
|
||||
|
@ -388,7 +388,7 @@ static int32_t tsdbCommitterNextTableData(SCommitter *pCommitter) {
|
|||
int32_t code = 0;
|
||||
int32_t lino = 0;
|
||||
|
||||
tAssert(pCommitter->dReader.pBlockIdx);
|
||||
ASSERT(pCommitter->dReader.pBlockIdx);
|
||||
|
||||
pCommitter->dReader.iBlockIdx++;
|
||||
if (pCommitter->dReader.iBlockIdx < taosArrayGetSize(pCommitter->dReader.aBlockIdx)) {
|
||||
|
@ -398,7 +398,7 @@ static int32_t tsdbCommitterNextTableData(SCommitter *pCommitter) {
|
|||
code = tsdbReadDataBlk(pCommitter->dReader.pReader, pCommitter->dReader.pBlockIdx, &pCommitter->dReader.mBlock);
|
||||
TSDB_CHECK_CODE(code, lino, _exit);
|
||||
|
||||
tAssert(pCommitter->dReader.mBlock.nItem > 0);
|
||||
ASSERT(pCommitter->dReader.mBlock.nItem > 0);
|
||||
} else {
|
||||
pCommitter->dReader.pBlockIdx = NULL;
|
||||
}
|
||||
|
@ -442,7 +442,7 @@ static int32_t tsdbOpenCommitIter(SCommitter *pCommitter) {
|
|||
pIter->r.row = *pRow;
|
||||
break;
|
||||
}
|
||||
tAssert(pIter->iTbDataP < taosArrayGetSize(pCommitter->aTbDataP));
|
||||
ASSERT(pIter->iTbDataP < taosArrayGetSize(pCommitter->aTbDataP));
|
||||
tRBTreePut(&pCommitter->rbt, (SRBTreeNode *)pIter);
|
||||
|
||||
// disk
|
||||
|
@ -508,7 +508,7 @@ static int32_t tsdbCommitFileDataStart(SCommitter *pCommitter) {
|
|||
tsdbFidKeyRange(pCommitter->commitFid, pCommitter->minutes, pCommitter->precision, &pCommitter->minKey,
|
||||
&pCommitter->maxKey);
|
||||
#if 0
|
||||
tAssert(pCommitter->minKey <= pCommitter->nextKey && pCommitter->maxKey >= pCommitter->nextKey);
|
||||
ASSERT(pCommitter->minKey <= pCommitter->nextKey && pCommitter->maxKey >= pCommitter->nextKey);
|
||||
#endif
|
||||
|
||||
pCommitter->nextKey = TSKEY_MAX;
|
||||
|
@ -544,7 +544,7 @@ static int32_t tsdbCommitFileDataStart(SCommitter *pCommitter) {
|
|||
SSttFile fStt = {.commitID = pCommitter->commitID};
|
||||
SDFileSet wSet = {.fid = pCommitter->commitFid, .pHeadF = &fHead, .pDataF = &fData, .pSmaF = &fSma};
|
||||
if (pRSet) {
|
||||
tAssert(pRSet->nSttF <= pCommitter->sttTrigger);
|
||||
ASSERT(pRSet->nSttF <= pCommitter->sttTrigger);
|
||||
fData = *pRSet->pDataF;
|
||||
fSma = *pRSet->pSmaF;
|
||||
wSet.diskId = pRSet->diskId;
|
||||
|
@ -826,7 +826,7 @@ static int32_t tsdbStartCommit(STsdb *pTsdb, SCommitter *pCommitter, SCommitInfo
|
|||
int32_t lino = 0;
|
||||
|
||||
memset(pCommitter, 0, sizeof(*pCommitter));
|
||||
tAssert(pTsdb->imem && "last tsdb commit incomplete");
|
||||
ASSERT(pTsdb->imem && "last tsdb commit incomplete");
|
||||
|
||||
pCommitter->pTsdb = pTsdb;
|
||||
pCommitter->commitID = pInfo->info.state.commitID;
|
||||
|
@ -992,7 +992,7 @@ static int32_t tsdbCommitDel(SCommitter *pCommitter) {
|
|||
STbData *pTbData;
|
||||
SDelIdx *pDelIdx;
|
||||
|
||||
tAssert(nTbData > 0);
|
||||
ASSERT(nTbData > 0);
|
||||
|
||||
pTbData = (STbData *)taosArrayGetP(pCommitter->aTbDataP, iTbData);
|
||||
pDelIdx = (iDelIdx < nDelIdx) ? (SDelIdx *)taosArrayGet(pCommitter->aDelIdx, iDelIdx) : NULL;
|
||||
|
@ -1142,7 +1142,7 @@ static int32_t tsdbNextCommitRow(SCommitter *pCommitter) {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
// compare with min in RB Tree
|
||||
|
@ -1153,7 +1153,7 @@ static int32_t tsdbNextCommitRow(SCommitter *pCommitter) {
|
|||
tRBTreePut(&pCommitter->rbt, (SRBTreeNode *)pCommitter->pIter);
|
||||
pCommitter->pIter = NULL;
|
||||
} else {
|
||||
tAssert(c);
|
||||
ASSERT(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1183,7 +1183,7 @@ static int32_t tsdbCommitAheadBlock(SCommitter *pCommitter, SDataBlk *pDataBlk)
|
|||
|
||||
tBlockDataClear(pBlockData);
|
||||
while (pRowInfo) {
|
||||
tAssert(pRowInfo->row.type == 0);
|
||||
ASSERT(pRowInfo->row.type == 0);
|
||||
code = tsdbCommitterUpdateRowSchema(pCommitter, id.suid, id.uid, TSDBROW_SVERSION(&pRowInfo->row));
|
||||
TSDB_CHECK_CODE(code, lino, _exit);
|
||||
|
||||
|
@ -1251,7 +1251,7 @@ static int32_t tsdbCommitMergeBlock(SCommitter *pCommitter, SDataBlk *pDataBlk)
|
|||
pRow = NULL;
|
||||
}
|
||||
} else if (c > 0) {
|
||||
tAssert(pRowInfo->row.type == 0);
|
||||
ASSERT(pRowInfo->row.type == 0);
|
||||
code = tsdbCommitterUpdateRowSchema(pCommitter, id.suid, id.uid, TSDBROW_SVERSION(&pRowInfo->row));
|
||||
TSDB_CHECK_CODE(code, lino, _exit);
|
||||
|
||||
|
@ -1271,7 +1271,7 @@ static int32_t tsdbCommitMergeBlock(SCommitter *pCommitter, SDataBlk *pDataBlk)
|
|||
}
|
||||
}
|
||||
} else {
|
||||
tAssert(0 && "dup rows not allowed");
|
||||
ASSERT(0 && "dup rows not allowed");
|
||||
}
|
||||
|
||||
if (pBDataW->nRow >= pCommitter->maxRow) {
|
||||
|
@ -1314,14 +1314,14 @@ static int32_t tsdbMergeTableData(SCommitter *pCommitter, TABLEID id) {
|
|||
|
||||
SBlockIdx *pBlockIdx = pCommitter->dReader.pBlockIdx;
|
||||
|
||||
tAssert(pBlockIdx == NULL || tTABLEIDCmprFn(pBlockIdx, &id) >= 0);
|
||||
ASSERT(pBlockIdx == NULL || tTABLEIDCmprFn(pBlockIdx, &id) >= 0);
|
||||
if (pBlockIdx && pBlockIdx->suid == id.suid && pBlockIdx->uid == id.uid) {
|
||||
int32_t iBlock = 0;
|
||||
SDataBlk block;
|
||||
SDataBlk *pDataBlk = █
|
||||
SRowInfo *pRowInfo = tsdbGetCommitRow(pCommitter);
|
||||
|
||||
tAssert(pRowInfo->suid == id.suid && pRowInfo->uid == id.uid);
|
||||
ASSERT(pRowInfo->suid == id.suid && pRowInfo->uid == id.uid);
|
||||
|
||||
tMapDataGetItemByIdx(&pCommitter->dReader.mBlock, iBlock, pDataBlk, tGetDataBlk);
|
||||
while (pDataBlk && pRowInfo) {
|
||||
|
@ -1399,8 +1399,8 @@ static int32_t tsdbInitSttBlockBuilderIfNeed(SCommitter *pCommitter, TABLEID id)
|
|||
}
|
||||
|
||||
if (!pBuilder->suid && !pBuilder->uid) {
|
||||
tAssert(pCommitter->skmTable.suid == id.suid);
|
||||
tAssert(pCommitter->skmTable.uid == id.uid);
|
||||
ASSERT(pCommitter->skmTable.suid == id.suid);
|
||||
ASSERT(pCommitter->skmTable.uid == id.uid);
|
||||
code = tDiskDataBuilderInit(pBuilder, pCommitter->skmTable.pTSchema, &id, pCommitter->cmprAlg, 0);
|
||||
TSDB_CHECK_CODE(code, lino, _exit);
|
||||
}
|
||||
|
@ -1416,8 +1416,8 @@ static int32_t tsdbInitSttBlockBuilderIfNeed(SCommitter *pCommitter, TABLEID id)
|
|||
}
|
||||
|
||||
if (!pBData->suid && !pBData->uid) {
|
||||
tAssert(pCommitter->skmTable.suid == id.suid);
|
||||
tAssert(pCommitter->skmTable.uid == id.uid);
|
||||
ASSERT(pCommitter->skmTable.suid == id.suid);
|
||||
ASSERT(pCommitter->skmTable.uid == id.uid);
|
||||
TABLEID tid = {.suid = id.suid, .uid = id.suid ? 0 : id.uid};
|
||||
code = tBlockDataInit(pBData, &tid, pCommitter->skmTable.pTSchema, NULL, 0);
|
||||
TSDB_CHECK_CODE(code, lino, _exit);
|
||||
|
@ -1532,7 +1532,7 @@ static int32_t tsdbCommitTableData(SCommitter *pCommitter, TABLEID id) {
|
|||
}
|
||||
} else {
|
||||
SBlockData *pBData = &pCommitter->dWriter.bData;
|
||||
tAssert(pBData->nRow == 0);
|
||||
ASSERT(pBData->nRow == 0);
|
||||
|
||||
while (pRowInfo) {
|
||||
STSchema *pTSchema = NULL;
|
||||
|
@ -1587,7 +1587,7 @@ static int32_t tsdbCommitFileDataImpl(SCommitter *pCommitter) {
|
|||
SRowInfo *pRowInfo;
|
||||
TABLEID id = {0};
|
||||
while ((pRowInfo = tsdbGetCommitRow(pCommitter)) != NULL) {
|
||||
tAssert(pRowInfo->suid != id.suid || pRowInfo->uid != id.uid);
|
||||
ASSERT(pRowInfo->suid != id.suid || pRowInfo->uid != id.uid);
|
||||
id.suid = pRowInfo->suid;
|
||||
id.uid = pRowInfo->uid;
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ static int32_t tDiskColBuilderInit(SDiskColBuilder *pBuilder, int16_t cid, int8_
|
|||
static int32_t tGnrtDiskCol(SDiskColBuilder *pBuilder, SDiskCol *pDiskCol) {
|
||||
int32_t code = 0;
|
||||
|
||||
tAssert(pBuilder->flag && pBuilder->flag != HAS_NONE);
|
||||
ASSERT(pBuilder->flag && pBuilder->flag != HAS_NONE);
|
||||
|
||||
*pDiskCol = (SDiskCol){(SBlockCol){.cid = pBuilder->cid,
|
||||
.type = pBuilder->type,
|
||||
|
@ -489,7 +489,7 @@ int32_t tDiskDataBuilderInit(SDiskDataBuilder *pBuilder, STSchema *pTSchema, TAB
|
|||
uint8_t calcSma) {
|
||||
int32_t code = 0;
|
||||
|
||||
tAssert(pId->suid || pId->uid);
|
||||
ASSERT(pId->suid || pId->uid);
|
||||
|
||||
pBuilder->suid = pId->suid;
|
||||
pBuilder->uid = pId->uid;
|
||||
|
@ -560,8 +560,8 @@ int32_t tDiskDataBuilderClear(SDiskDataBuilder *pBuilder) {
|
|||
int32_t tDiskDataAddRow(SDiskDataBuilder *pBuilder, TSDBROW *pRow, STSchema *pTSchema, TABLEID *pId) {
|
||||
int32_t code = 0;
|
||||
|
||||
tAssert(pBuilder->suid || pBuilder->uid);
|
||||
tAssert(pId->suid == pBuilder->suid);
|
||||
ASSERT(pBuilder->suid || pBuilder->uid);
|
||||
ASSERT(pId->suid == pBuilder->suid);
|
||||
|
||||
TSDBKEY kRow = TSDBROW_KEY(pRow);
|
||||
if (tsdbKeyCmprFn(&pBuilder->bi.minTKey, &kRow) > 0) pBuilder->bi.minTKey = kRow;
|
||||
|
@ -569,7 +569,7 @@ int32_t tDiskDataAddRow(SDiskDataBuilder *pBuilder, TSDBROW *pRow, STSchema *pTS
|
|||
|
||||
// uid
|
||||
if (pBuilder->uid && pBuilder->uid != pId->uid) {
|
||||
tAssert(pBuilder->suid);
|
||||
ASSERT(pBuilder->suid);
|
||||
for (int32_t iRow = 0; iRow < pBuilder->nRow; iRow++) {
|
||||
code = tCompress(pBuilder->pUidC, &pBuilder->uid, sizeof(int64_t));
|
||||
if (code) return code;
|
||||
|
@ -623,7 +623,7 @@ int32_t tDiskDataAddRow(SDiskDataBuilder *pBuilder, TSDBROW *pRow, STSchema *pTS
|
|||
int32_t tGnrtDiskData(SDiskDataBuilder *pBuilder, const SDiskData **ppDiskData, const SBlkInfo **ppBlkInfo) {
|
||||
int32_t code = 0;
|
||||
|
||||
tAssert(pBuilder->nRow);
|
||||
ASSERT(pBuilder->nRow);
|
||||
|
||||
*ppDiskData = NULL;
|
||||
*ppBlkInfo = NULL;
|
||||
|
|
|
@ -82,7 +82,7 @@ static int32_t tsdbBinaryToFS(uint8_t *pData, int64_t nData, STsdbFS *pFS) {
|
|||
}
|
||||
}
|
||||
|
||||
tAssert(n + sizeof(TSCKSUM) == nData);
|
||||
ASSERT(n + sizeof(TSCKSUM) == nData);
|
||||
|
||||
_exit:
|
||||
return code;
|
||||
|
@ -512,7 +512,7 @@ static int32_t tsdbMergeFileSet(STsdb *pTsdb, SDFileSet *pSetOld, SDFileSet *pSe
|
|||
// stt
|
||||
if (sameDisk) {
|
||||
if (pSetNew->nSttF > pSetOld->nSttF) {
|
||||
tAssert(pSetNew->nSttF == pSetOld->nSttF + 1);
|
||||
ASSERT(pSetNew->nSttF == pSetOld->nSttF + 1);
|
||||
pSetOld->aSttF[pSetOld->nSttF] = (SSttFile *)taosMemoryMalloc(sizeof(SSttFile));
|
||||
if (pSetOld->aSttF[pSetOld->nSttF] == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
|
@ -522,7 +522,7 @@ static int32_t tsdbMergeFileSet(STsdb *pTsdb, SDFileSet *pSetOld, SDFileSet *pSe
|
|||
pSetOld->aSttF[pSetOld->nSttF]->nRef = 1;
|
||||
pSetOld->nSttF++;
|
||||
} else if (pSetNew->nSttF < pSetOld->nSttF) {
|
||||
tAssert(pSetNew->nSttF == 1);
|
||||
ASSERT(pSetNew->nSttF == 1);
|
||||
for (int32_t iStt = 0; iStt < pSetOld->nSttF; iStt++) {
|
||||
SSttFile *pSttFile = pSetOld->aSttF[iStt];
|
||||
nRef = atomic_sub_fetch_32(&pSttFile->nRef, 1);
|
||||
|
@ -561,8 +561,8 @@ static int32_t tsdbMergeFileSet(STsdb *pTsdb, SDFileSet *pSetOld, SDFileSet *pSe
|
|||
*pSetOld->aSttF[iStt] = *pSetNew->aSttF[iStt];
|
||||
pSetOld->aSttF[iStt]->nRef = 1;
|
||||
} else {
|
||||
tAssert(pSetOld->aSttF[iStt]->size == pSetOld->aSttF[iStt]->size);
|
||||
tAssert(pSetOld->aSttF[iStt]->offset == pSetOld->aSttF[iStt]->offset);
|
||||
ASSERT(pSetOld->aSttF[iStt]->size == pSetOld->aSttF[iStt]->size);
|
||||
ASSERT(pSetOld->aSttF[iStt]->offset == pSetOld->aSttF[iStt]->offset);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -634,7 +634,7 @@ static int32_t tsdbFSApplyChange(STsdb *pTsdb, STsdbFS *pFS) {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
tAssert(pTsdb->fs.pDelFile == NULL);
|
||||
ASSERT(pTsdb->fs.pDelFile == NULL);
|
||||
}
|
||||
|
||||
// aDFileSet
|
||||
|
@ -783,7 +783,7 @@ int32_t tsdbFSOpen(STsdb *pTsdb, int8_t rollback) {
|
|||
code = tsdbSaveFSToFile(&pTsdb->fs, current);
|
||||
TSDB_CHECK_CODE(code, lino, _exit);
|
||||
|
||||
tAssert(!rollback);
|
||||
ASSERT(!rollback);
|
||||
}
|
||||
|
||||
// scan and fix FS
|
||||
|
@ -801,7 +801,7 @@ int32_t tsdbFSClose(STsdb *pTsdb) {
|
|||
int32_t code = 0;
|
||||
|
||||
if (pTsdb->fs.pDelFile) {
|
||||
tAssert(pTsdb->fs.pDelFile->nRef == 1);
|
||||
ASSERT(pTsdb->fs.pDelFile->nRef == 1);
|
||||
taosMemoryFree(pTsdb->fs.pDelFile);
|
||||
}
|
||||
|
||||
|
@ -809,20 +809,20 @@ int32_t tsdbFSClose(STsdb *pTsdb) {
|
|||
SDFileSet *pSet = (SDFileSet *)taosArrayGet(pTsdb->fs.aDFileSet, iSet);
|
||||
|
||||
// head
|
||||
tAssert(pSet->pHeadF->nRef == 1);
|
||||
ASSERT(pSet->pHeadF->nRef == 1);
|
||||
taosMemoryFree(pSet->pHeadF);
|
||||
|
||||
// data
|
||||
tAssert(pSet->pDataF->nRef == 1);
|
||||
ASSERT(pSet->pDataF->nRef == 1);
|
||||
taosMemoryFree(pSet->pDataF);
|
||||
|
||||
// sma
|
||||
tAssert(pSet->pSmaF->nRef == 1);
|
||||
ASSERT(pSet->pSmaF->nRef == 1);
|
||||
taosMemoryFree(pSet->pSmaF);
|
||||
|
||||
// stt
|
||||
for (int32_t iStt = 0; iStt < pSet->nSttF; iStt++) {
|
||||
tAssert(pSet->aSttF[iStt]->nRef == 1);
|
||||
ASSERT(pSet->aSttF[iStt]->nRef == 1);
|
||||
taosMemoryFree(pSet->aSttF[iStt]);
|
||||
}
|
||||
}
|
||||
|
@ -939,7 +939,7 @@ int32_t tsdbFSUpsertFSet(STsdbFS *pFS, SDFileSet *pSet) {
|
|||
*pDFileSet->pSmaF = *pSet->pSmaF;
|
||||
// stt
|
||||
if (pSet->nSttF > pDFileSet->nSttF) {
|
||||
tAssert(pSet->nSttF == pDFileSet->nSttF + 1);
|
||||
ASSERT(pSet->nSttF == pDFileSet->nSttF + 1);
|
||||
|
||||
pDFileSet->aSttF[pDFileSet->nSttF] = (SSttFile *)taosMemoryMalloc(sizeof(SSttFile));
|
||||
if (pDFileSet->aSttF[pDFileSet->nSttF] == NULL) {
|
||||
|
@ -949,7 +949,7 @@ int32_t tsdbFSUpsertFSet(STsdbFS *pFS, SDFileSet *pSet) {
|
|||
*pDFileSet->aSttF[pDFileSet->nSttF] = *pSet->aSttF[pSet->nSttF - 1];
|
||||
pDFileSet->nSttF++;
|
||||
} else if (pSet->nSttF < pDFileSet->nSttF) {
|
||||
tAssert(pSet->nSttF == 1);
|
||||
ASSERT(pSet->nSttF == 1);
|
||||
for (int32_t iStt = 1; iStt < pDFileSet->nSttF; iStt++) {
|
||||
taosMemoryFree(pDFileSet->aSttF[iStt]);
|
||||
}
|
||||
|
@ -966,7 +966,7 @@ int32_t tsdbFSUpsertFSet(STsdbFS *pFS, SDFileSet *pSet) {
|
|||
}
|
||||
}
|
||||
|
||||
tAssert(pSet->nSttF == 1);
|
||||
ASSERT(pSet->nSttF == 1);
|
||||
SDFileSet fSet = {.diskId = pSet->diskId, .fid = pSet->fid, .nSttF = 1};
|
||||
|
||||
// head
|
||||
|
@ -1041,7 +1041,7 @@ int32_t tsdbFSRef(STsdb *pTsdb, STsdbFS *pFS) {
|
|||
pFS->pDelFile = pTsdb->fs.pDelFile;
|
||||
if (pFS->pDelFile) {
|
||||
nRef = atomic_fetch_add_32(&pFS->pDelFile->nRef, 1);
|
||||
tAssert(nRef > 0);
|
||||
ASSERT(nRef > 0);
|
||||
}
|
||||
|
||||
SDFileSet fSet;
|
||||
|
@ -1050,17 +1050,17 @@ int32_t tsdbFSRef(STsdb *pTsdb, STsdbFS *pFS) {
|
|||
fSet = *pSet;
|
||||
|
||||
nRef = atomic_fetch_add_32(&pSet->pHeadF->nRef, 1);
|
||||
tAssert(nRef > 0);
|
||||
ASSERT(nRef > 0);
|
||||
|
||||
nRef = atomic_fetch_add_32(&pSet->pDataF->nRef, 1);
|
||||
tAssert(nRef > 0);
|
||||
ASSERT(nRef > 0);
|
||||
|
||||
nRef = atomic_fetch_add_32(&pSet->pSmaF->nRef, 1);
|
||||
tAssert(nRef > 0);
|
||||
ASSERT(nRef > 0);
|
||||
|
||||
for (int32_t iStt = 0; iStt < pSet->nSttF; iStt++) {
|
||||
nRef = atomic_fetch_add_32(&pSet->aSttF[iStt]->nRef, 1);
|
||||
tAssert(nRef > 0);
|
||||
ASSERT(nRef > 0);
|
||||
}
|
||||
|
||||
if (taosArrayPush(pFS->aDFileSet, &fSet) == NULL) {
|
||||
|
@ -1079,7 +1079,7 @@ void tsdbFSUnref(STsdb *pTsdb, STsdbFS *pFS) {
|
|||
|
||||
if (pFS->pDelFile) {
|
||||
nRef = atomic_sub_fetch_32(&pFS->pDelFile->nRef, 1);
|
||||
tAssert(nRef >= 0);
|
||||
ASSERT(nRef >= 0);
|
||||
if (nRef == 0) {
|
||||
tsdbDelFileName(pTsdb, pFS->pDelFile, fname);
|
||||
(void)taosRemoveFile(fname);
|
||||
|
@ -1092,7 +1092,7 @@ void tsdbFSUnref(STsdb *pTsdb, STsdbFS *pFS) {
|
|||
|
||||
// head
|
||||
nRef = atomic_sub_fetch_32(&pSet->pHeadF->nRef, 1);
|
||||
tAssert(nRef >= 0);
|
||||
ASSERT(nRef >= 0);
|
||||
if (nRef == 0) {
|
||||
tsdbHeadFileName(pTsdb, pSet->diskId, pSet->fid, pSet->pHeadF, fname);
|
||||
(void)taosRemoveFile(fname);
|
||||
|
@ -1101,7 +1101,7 @@ void tsdbFSUnref(STsdb *pTsdb, STsdbFS *pFS) {
|
|||
|
||||
// data
|
||||
nRef = atomic_sub_fetch_32(&pSet->pDataF->nRef, 1);
|
||||
tAssert(nRef >= 0);
|
||||
ASSERT(nRef >= 0);
|
||||
if (nRef == 0) {
|
||||
tsdbDataFileName(pTsdb, pSet->diskId, pSet->fid, pSet->pDataF, fname);
|
||||
(void)taosRemoveFile(fname);
|
||||
|
@ -1110,7 +1110,7 @@ void tsdbFSUnref(STsdb *pTsdb, STsdbFS *pFS) {
|
|||
|
||||
// sma
|
||||
nRef = atomic_sub_fetch_32(&pSet->pSmaF->nRef, 1);
|
||||
tAssert(nRef >= 0);
|
||||
ASSERT(nRef >= 0);
|
||||
if (nRef == 0) {
|
||||
tsdbSmaFileName(pTsdb, pSet->diskId, pSet->fid, pSet->pSmaF, fname);
|
||||
(void)taosRemoveFile(fname);
|
||||
|
@ -1120,7 +1120,7 @@ void tsdbFSUnref(STsdb *pTsdb, STsdbFS *pFS) {
|
|||
// stt
|
||||
for (int32_t iStt = 0; iStt < pSet->nSttF; iStt++) {
|
||||
nRef = atomic_sub_fetch_32(&pSet->aSttF[iStt]->nRef, 1);
|
||||
tAssert(nRef >= 0);
|
||||
ASSERT(nRef >= 0);
|
||||
if (nRef == 0) {
|
||||
tsdbSttFileName(pTsdb, pSet->diskId, pSet->fid, pSet->aSttF[iStt], fname);
|
||||
(void)taosRemoveFile(fname);
|
||||
|
|
|
@ -135,7 +135,7 @@ int32_t tsdbDFileRollback(STsdb *pTsdb, SDFileSet *pSet, EDataFileT ftype) {
|
|||
tPutSmaFile(hdr, pSet->pSmaF);
|
||||
break;
|
||||
default:
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
taosCalcChecksumAppend(0, hdr, TSDB_FHDR_SIZE);
|
||||
|
|
|
@ -168,7 +168,7 @@ int32_t tsdbDeleteTableData(STsdb *pTsdb, int64_t version, tb_uid_t suid, tb_uid
|
|||
goto _err;
|
||||
}
|
||||
|
||||
tAssert(pPool != NULL);
|
||||
ASSERT(pPool != NULL);
|
||||
// do delete
|
||||
SDelData *pDelData = (SDelData *)vnodeBufPoolMalloc(pPool, sizeof(*pDelData));
|
||||
if (pDelData == NULL) {
|
||||
|
@ -180,7 +180,7 @@ int32_t tsdbDeleteTableData(STsdb *pTsdb, int64_t version, tb_uid_t suid, tb_uid
|
|||
pDelData->eKey = eKey;
|
||||
pDelData->pNext = NULL;
|
||||
if (pTbData->pHead == NULL) {
|
||||
tAssert(pTbData->pTail == NULL);
|
||||
ASSERT(pTbData->pTail == NULL);
|
||||
pTbData->pHead = pTbData->pTail = pDelData;
|
||||
} else {
|
||||
pTbData->pTail->pNext = pDelData;
|
||||
|
@ -265,7 +265,7 @@ void tsdbTbDataIterOpen(STbData *pTbData, TSDBKEY *pFrom, int8_t backward, STbDa
|
|||
bool tsdbTbDataIterNext(STbDataIter *pIter) {
|
||||
pIter->pRow = NULL;
|
||||
if (pIter->backward) {
|
||||
tAssert(pIter->pNode != pIter->pTbData->sl.pTail);
|
||||
ASSERT(pIter->pNode != pIter->pTbData->sl.pTail);
|
||||
|
||||
if (pIter->pNode == pIter->pTbData->sl.pHead) {
|
||||
return false;
|
||||
|
@ -276,7 +276,7 @@ bool tsdbTbDataIterNext(STbDataIter *pIter) {
|
|||
return false;
|
||||
}
|
||||
} else {
|
||||
tAssert(pIter->pNode != pIter->pTbData->sl.pHead);
|
||||
ASSERT(pIter->pNode != pIter->pTbData->sl.pHead);
|
||||
|
||||
if (pIter->pNode == pIter->pTbData->sl.pTail) {
|
||||
return false;
|
||||
|
@ -334,7 +334,7 @@ static int32_t tsdbGetOrCreateTbData(SMemTable *pMemTable, tb_uid_t suid, tb_uid
|
|||
SVBufPool *pPool = pMemTable->pTsdb->pVnode->inUse;
|
||||
int8_t maxLevel = pMemTable->pTsdb->pVnode->config.tsdbCfg.slLevel;
|
||||
|
||||
tAssert(pPool != NULL);
|
||||
ASSERT(pPool != NULL);
|
||||
pTbData = vnodeBufPoolMalloc(pPool, sizeof(*pTbData) + SL_NODE_SIZE(maxLevel) * 2);
|
||||
if (pTbData == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
|
@ -477,7 +477,7 @@ static int32_t tbDataDoPut(SMemTable *pMemTable, STbData *pTbData, SMemSkipListN
|
|||
|
||||
// node
|
||||
level = tsdbMemSkipListRandLevel(&pTbData->sl);
|
||||
tAssert(pPool != NULL);
|
||||
ASSERT(pPool != NULL);
|
||||
pNode = (SMemSkipListNode *)vnodeBufPoolMalloc(pPool, SL_NODE_SIZE(level));
|
||||
if (pNode == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
|
@ -620,7 +620,7 @@ int32_t tsdbGetNRowsInTbData(STbData *pTbData) { return pTbData->sl.size; }
|
|||
|
||||
void tsdbRefMemTable(SMemTable *pMemTable) {
|
||||
int32_t nRef = atomic_fetch_add_32(&pMemTable->nRef, 1);
|
||||
tAssert(nRef > 0);
|
||||
ASSERT(nRef > 0);
|
||||
}
|
||||
|
||||
void tsdbUnrefMemTable(SMemTable *pMemTable) {
|
||||
|
|
|
@ -561,7 +561,7 @@ int32_t tMergeTreeOpen(SMergeTree *pMTree, int8_t backward, SDataFReader *pFRead
|
|||
|
||||
pMTree->pLoadInfo = pBlockLoadInfo;
|
||||
pMTree->destroyLoadInfo = destroyLoadInfo;
|
||||
tAssert(pMTree->pLoadInfo != NULL);
|
||||
ASSERT(pMTree->pLoadInfo != NULL);
|
||||
|
||||
for (int32_t i = 0; i < pFReader->pSet->nSttF; ++i) { // open all last file
|
||||
struct SLDataIter *pIter = NULL;
|
||||
|
@ -607,7 +607,7 @@ bool tMergeTreeNext(SMergeTree *pMTree) {
|
|||
tRBTreePut(&pMTree->rbt, (SRBTreeNode *)pMTree->pIter);
|
||||
pMTree->pIter = NULL;
|
||||
} else {
|
||||
tAssert(c);
|
||||
ASSERT(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -260,7 +260,7 @@ static void updateBlockSMAInfo(STSchema* pSchema, SBlockLoadSuppInfo* pSupInfo)
|
|||
// do nothing
|
||||
i += 1;
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -396,7 +396,7 @@ static void destroyAllBlockScanInfo(SHashObj* pTableMap) {
|
|||
}
|
||||
|
||||
static bool isEmptyQueryTimeWindow(STimeWindow* pWindow) {
|
||||
tAssert(pWindow != NULL);
|
||||
ASSERT(pWindow != NULL);
|
||||
return pWindow->skey > pWindow->ekey;
|
||||
}
|
||||
|
||||
|
@ -595,7 +595,7 @@ static int32_t tsdbReaderCreate(SVnode* pVnode, SQueryTableDataCond* pCond, STsd
|
|||
pReader->type = pCond->type;
|
||||
pReader->window = updateQueryTimeWindow(pReader->pTsdb, &pCond->twindows);
|
||||
pReader->blockInfoBuf.numPerBucket = 1000; // 1000 tables per bucket
|
||||
tAssert(pCond->numOfCols > 0);
|
||||
ASSERT(pCond->numOfCols > 0);
|
||||
|
||||
if (pReader->pResBlock == NULL) {
|
||||
pReader->freeBlock = true;
|
||||
|
@ -782,7 +782,7 @@ static void doCopyColVal(SColumnInfoData* pColInfoData, int32_t rowIndex, int32_
|
|||
colDataAppendNULL(pColInfoData, rowIndex);
|
||||
} else {
|
||||
varDataSetLen(pSup->buildBuf[colIndex], pColVal->value.nData);
|
||||
tAssert(pColVal->value.nData <= pColInfoData->info.bytes);
|
||||
ASSERT(pColVal->value.nData <= pColInfoData->info.bytes);
|
||||
if (pColVal->value.nData > 0) { // pData may be null, if nData is 0
|
||||
memcpy(varDataVal(pSup->buildBuf[colIndex]), pColVal->value.pData, pColVal->value.nData);
|
||||
}
|
||||
|
@ -796,7 +796,7 @@ static void doCopyColVal(SColumnInfoData* pColInfoData, int32_t rowIndex, int32_
|
|||
|
||||
static SFileDataBlockInfo* getCurrentBlockInfo(SDataBlockIter* pBlockIter) {
|
||||
if (taosArrayGetSize(pBlockIter->blockList) == 0) {
|
||||
tAssert(pBlockIter->numOfBlocks == taosArrayGetSize(pBlockIter->blockList));
|
||||
ASSERT(pBlockIter->numOfBlocks == taosArrayGetSize(pBlockIter->blockList));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -810,7 +810,7 @@ int32_t binarySearchForTs(char* pValue, int num, TSKEY key, int order) {
|
|||
int32_t midPos = -1;
|
||||
int32_t numOfRows;
|
||||
|
||||
tAssert(order == TSDB_ORDER_ASC || order == TSDB_ORDER_DESC);
|
||||
ASSERT(order == TSDB_ORDER_ASC || order == TSDB_ORDER_DESC);
|
||||
|
||||
TSKEY* keyList = (TSKEY*)pValue;
|
||||
int32_t firstPos = 0;
|
||||
|
@ -974,7 +974,7 @@ static void copyNumericCols(const SColData* pData, SFileBlockDumpInfo* pDumpInfo
|
|||
int32_t step = asc? 1:-1;
|
||||
|
||||
// make sure it is aligned to 8bit
|
||||
tAssert((((uint64_t)pColData->pData) & (0x8 - 1)) == 0);
|
||||
ASSERT((((uint64_t)pColData->pData) & (0x8 - 1)) == 0);
|
||||
|
||||
// 1. copy data in a batch model
|
||||
memcpy(pColData->pData, p, dumpedRows * tDataTypes[pData->type].bytes);
|
||||
|
@ -1183,7 +1183,7 @@ static int32_t doLoadFileBlockData(STsdbReader* pReader, SDataBlockIter* pBlockI
|
|||
|
||||
SFileDataBlockInfo* pBlockInfo = getCurrentBlockInfo(pBlockIter);
|
||||
SFileBlockDumpInfo* pDumpInfo = &pReader->status.fBlockDumpInfo;
|
||||
tAssert(pBlockInfo != NULL);
|
||||
ASSERT(pBlockInfo != NULL);
|
||||
|
||||
SDataBlk* pBlock = getCurrentBlock(pBlockIter);
|
||||
code = tsdbReadDataBlock(pReader->pFileReader, pBlock, pBlockData);
|
||||
|
@ -1221,7 +1221,7 @@ static void cleanupBlockOrderSupporter(SBlockOrderSupporter* pSup) {
|
|||
}
|
||||
|
||||
static int32_t initBlockOrderSupporter(SBlockOrderSupporter* pSup, int32_t numOfTables) {
|
||||
tAssert(numOfTables >= 1);
|
||||
ASSERT(numOfTables >= 1);
|
||||
|
||||
pSup->numOfBlocksPerTable = taosMemoryCalloc(1, sizeof(int32_t) * numOfTables);
|
||||
pSup->indexPerTable = taosMemoryCalloc(1, sizeof(int32_t) * numOfTables);
|
||||
|
@ -1329,7 +1329,7 @@ static int32_t initBlockIterator(STsdbReader* pReader, SDataBlockIter* pBlockIte
|
|||
sup.numOfTables += 1;
|
||||
}
|
||||
|
||||
tAssert(numOfBlocks == cnt);
|
||||
ASSERT(numOfBlocks == cnt);
|
||||
|
||||
// since there is only one table qualified, blocks are not sorted
|
||||
if (sup.numOfTables == 1) {
|
||||
|
@ -1351,7 +1351,7 @@ static int32_t initBlockIterator(STsdbReader* pReader, SDataBlockIter* pBlockIte
|
|||
tsdbDebug("%p create data blocks info struct completed, %d blocks in %d tables %s", pReader, cnt, sup.numOfTables,
|
||||
pReader->idStr);
|
||||
|
||||
tAssert(cnt <= numOfBlocks && sup.numOfTables <= numOfTables);
|
||||
ASSERT(cnt <= numOfBlocks && sup.numOfTables <= numOfTables);
|
||||
|
||||
SMultiwayMergeTreeInfo* pTree = NULL;
|
||||
uint8_t ret = tMergeTreeCreate(&pTree, sup.numOfTables, &sup, fileDataBlockOrderCompar);
|
||||
|
@ -1432,7 +1432,7 @@ static bool getNeighborBlockOfSameTable(SFileDataBlockInfo* pBlockInfo, STableBl
|
|||
}
|
||||
|
||||
static int32_t findFileBlockInfoIndex(SDataBlockIter* pBlockIter, SFileDataBlockInfo* pFBlockInfo) {
|
||||
tAssert(pBlockIter != NULL && pFBlockInfo != NULL);
|
||||
ASSERT(pBlockIter != NULL && pFBlockInfo != NULL);
|
||||
|
||||
int32_t step = ASCENDING_TRAVERSE(pBlockIter->order) ? 1 : -1;
|
||||
int32_t index = pBlockIter->index;
|
||||
|
@ -1446,7 +1446,7 @@ static int32_t findFileBlockInfoIndex(SDataBlockIter* pBlockIter, SFileDataBlock
|
|||
index += step;
|
||||
}
|
||||
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -1463,7 +1463,7 @@ static int32_t setFileBlockActiveInBlockIter(SDataBlockIter* pBlockIter, int32_t
|
|||
taosArrayInsert(pBlockIter->blockList, pBlockIter->index, &fblock);
|
||||
|
||||
SFileDataBlockInfo* pBlockInfo = taosArrayGet(pBlockIter->blockList, pBlockIter->index);
|
||||
tAssert(pBlockInfo->uid == fblock.uid && pBlockInfo->tbBlockIdx == fblock.tbBlockIdx);
|
||||
ASSERT(pBlockInfo->uid == fblock.uid && pBlockInfo->tbBlockIdx == fblock.tbBlockIdx);
|
||||
}
|
||||
|
||||
doSetCurrentBlock(pBlockIter, "");
|
||||
|
@ -1510,7 +1510,7 @@ static bool doCheckforDatablockOverlap(STableBlockScanInfo* pBlockScanInfo, cons
|
|||
return true;
|
||||
}
|
||||
} else { // it must be the last point
|
||||
tAssert(p->version == 0);
|
||||
ASSERT(p->version == 0);
|
||||
}
|
||||
}
|
||||
} else { // (p->ts > pBlock->maxKey.ts) {
|
||||
|
@ -1925,7 +1925,7 @@ static int32_t doMergeFileBlockAndLastBlock(SLastBlockReader* pLastBlockReader,
|
|||
}
|
||||
|
||||
doMergeRowsInLastBlock(pLastBlockReader, pBlockScanInfo, tsLastBlock, &merge, &pReader->verRange);
|
||||
tAssert(mergeBlockData);
|
||||
ASSERT(mergeBlockData);
|
||||
|
||||
// merge with block data if ts == key
|
||||
if (tsLastBlock == pBlockData->aTSKEY[pDumpInfo->rowIndex]) {
|
||||
|
@ -1959,7 +1959,7 @@ static int32_t mergeFileBlockAndLastBlock(STsdbReader* pReader, SLastBlockReader
|
|||
// row in last file block
|
||||
TSDBROW fRow = tsdbRowFromBlockData(pBlockData, pDumpInfo->rowIndex);
|
||||
int64_t ts = getCurrentKeyInLastBlock(pLastBlockReader);
|
||||
tAssert(ts >= key);
|
||||
ASSERT(ts >= key);
|
||||
|
||||
if (ASCENDING_TRAVERSE(pReader->order)) {
|
||||
if (key < ts) { // imem, mem are all empty, file blocks (data blocks and last block) exist
|
||||
|
@ -1991,7 +1991,7 @@ static int32_t mergeFileBlockAndLastBlock(STsdbReader* pReader, SLastBlockReader
|
|||
tRowMergerClear(&merge);
|
||||
return code;
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
} else { // desc order
|
||||
|
@ -2012,7 +2012,7 @@ static int32_t doMergeMultiLevelRows(STsdbReader* pReader, STableBlockScanInfo*
|
|||
|
||||
TSDBROW* pRow = getValidMemRow(&pBlockScanInfo->iter, pDelList, pReader);
|
||||
TSDBROW* piRow = getValidMemRow(&pBlockScanInfo->iiter, pDelList, pReader);
|
||||
tAssert(pRow != NULL && piRow != NULL);
|
||||
ASSERT(pRow != NULL && piRow != NULL);
|
||||
|
||||
int64_t tsLast = INT64_MIN;
|
||||
if (hasDataInLastBlock(pLastBlockReader)) {
|
||||
|
@ -2236,7 +2236,7 @@ static int32_t initMemDataIterator(STableBlockScanInfo* pBlockScanInfo, STsdbRea
|
|||
if (pReader->pReadSnap->pMem != NULL) {
|
||||
d = tsdbGetTbDataFromMemTable(pReader->pReadSnap->pMem, pReader->suid, pBlockScanInfo->uid);
|
||||
if (d != NULL) {
|
||||
tAssert(pBlockScanInfo->iter.iter == NULL);
|
||||
ASSERT(pBlockScanInfo->iter.iter == NULL);
|
||||
code = tsdbTbDataIterCreate(d, &startKey, backward, &pBlockScanInfo->iter.iter);
|
||||
if (code == TSDB_CODE_SUCCESS) {
|
||||
pBlockScanInfo->iter.hasVal = (tsdbTbDataIterGet(pBlockScanInfo->iter.iter) != NULL);
|
||||
|
@ -2351,7 +2351,7 @@ static bool hasDataInLastBlock(SLastBlockReader* pLastBlockReader) { return pLas
|
|||
|
||||
bool hasDataInFileBlock(const SBlockData* pBlockData, const SFileBlockDumpInfo* pDumpInfo) {
|
||||
if (pBlockData->nRow > 0) {
|
||||
tAssert(pBlockData->nRow == pDumpInfo->totalRows);
|
||||
ASSERT(pBlockData->nRow == pDumpInfo->totalRows);
|
||||
}
|
||||
|
||||
return pBlockData->nRow > 0 && (!pDumpInfo->allDumped);
|
||||
|
@ -2566,7 +2566,7 @@ int32_t initDelSkylineIterator(STableBlockScanInfo* pBlockScanInfo, STsdbReader*
|
|||
|
||||
int32_t code = 0;
|
||||
SArray* pDelData = taosArrayInit(4, sizeof(SDelData));
|
||||
tAssert(pReader->pReadSnap != NULL);
|
||||
ASSERT(pReader->pReadSnap != NULL);
|
||||
|
||||
SDelFile* pDelFile = pReader->pReadSnap->fs.pDelFile;
|
||||
if (pDelFile && taosArrayGetSize(pReader->pDelIdx) > 0) {
|
||||
|
@ -2773,7 +2773,7 @@ static bool moveToNextTable(SUidOrderCheckInfo* pOrderedCheckInfo, SReaderStatus
|
|||
|
||||
uint64_t uid = pOrderedCheckInfo->tableUidList[pOrderedCheckInfo->currentIndex];
|
||||
pStatus->pTableIter = taosHashGet(pStatus->pTableMap, &uid, sizeof(uid));
|
||||
tAssert(pStatus->pTableIter != NULL);
|
||||
ASSERT(pStatus->pTableIter != NULL);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -2847,7 +2847,7 @@ static int32_t doBuildDataBlock(STsdbReader* pReader) {
|
|||
TSDBKEY keyInBuf = getCurrentKeyInBuf(pScanInfo, pReader);
|
||||
|
||||
if (pBlockInfo == NULL) { // build data block from last data file
|
||||
tAssert(pBlockIter->numOfBlocks == 0);
|
||||
ASSERT(pBlockIter->numOfBlocks == 0);
|
||||
code = buildComposedDataBlock(pReader);
|
||||
} else if (fileBlockShouldLoad(pReader, pBlockInfo, pBlock, pScanInfo, keyInBuf, pLastBlockReader)) {
|
||||
code = doLoadFileBlockData(pReader, pBlockIter, &pStatus->fileBlockData, pScanInfo->uid);
|
||||
|
@ -2866,7 +2866,7 @@ static int32_t doBuildDataBlock(STsdbReader* pReader) {
|
|||
if (hasDataInLastBlock(pLastBlockReader) && !ASCENDING_TRAVERSE(pReader->order)) {
|
||||
// only return the rows in last block
|
||||
int64_t tsLast = getCurrentKeyInLastBlock(pLastBlockReader);
|
||||
tAssert(tsLast >= pBlock->maxKey.ts);
|
||||
ASSERT(tsLast >= pBlock->maxKey.ts);
|
||||
tBlockDataReset(&pReader->status.fileBlockData);
|
||||
|
||||
tsdbDebug("load data in last block firstly, due to desc scan data, %s", pReader->idStr);
|
||||
|
@ -3112,7 +3112,7 @@ SVersionRange getQueryVerRange(SVnode* pVnode, SQueryTableDataCond* pCond, int8_
|
|||
}
|
||||
|
||||
bool hasBeenDropped(const SArray* pDelList, int32_t* index, TSDBKEY* pKey, int32_t order, SVersionRange* pVerRange) {
|
||||
tAssert(pKey != NULL);
|
||||
ASSERT(pKey != NULL);
|
||||
if (pDelList == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
@ -3123,7 +3123,7 @@ bool hasBeenDropped(const SArray* pDelList, int32_t* index, TSDBKEY* pKey, int32
|
|||
if (asc) {
|
||||
if (*index >= num - 1) {
|
||||
TSDBKEY* last = taosArrayGetLast(pDelList);
|
||||
tAssert(pKey->ts >= last->ts);
|
||||
ASSERT(pKey->ts >= last->ts);
|
||||
|
||||
if (pKey->ts > last->ts) {
|
||||
return false;
|
||||
|
@ -3174,7 +3174,7 @@ bool hasBeenDropped(const SArray* pDelList, int32_t* index, TSDBKEY* pKey, int32
|
|||
} else if (pKey->ts == pFirst->ts) {
|
||||
return pFirst->version >= pKey->version;
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
} else {
|
||||
TSDBKEY* pCurrent = taosArrayGet(pDelList, *index);
|
||||
|
@ -3700,13 +3700,13 @@ int32_t buildDataBlockFromBufImpl(STableBlockScanInfo* pBlockScanInfo, int64_t e
|
|||
}
|
||||
} while (1);
|
||||
|
||||
tAssert(pBlock->info.rows <= capacity);
|
||||
ASSERT(pBlock->info.rows <= capacity);
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
// TODO refactor: with createDataBlockScanInfo
|
||||
int32_t tsdbSetTableList(STsdbReader* pReader, const void* pTableList, int32_t num) {
|
||||
tAssert(pReader != NULL);
|
||||
ASSERT(pReader != NULL);
|
||||
int32_t size = taosHashGetSize(pReader->status.pTableMap);
|
||||
|
||||
STableBlockScanInfo** p = NULL;
|
||||
|
@ -3715,7 +3715,7 @@ int32_t tsdbSetTableList(STsdbReader* pReader, const void* pTableList, int32_t n
|
|||
}
|
||||
|
||||
// todo handle the case where size is less than the value of num
|
||||
tAssert(size >= num);
|
||||
ASSERT(size >= num);
|
||||
|
||||
taosHashClear(pReader->status.pTableMap);
|
||||
|
||||
|
@ -4067,7 +4067,7 @@ bool tsdbNextDataBlock(STsdbReader* pReader) {
|
|||
}
|
||||
|
||||
static void setBlockInfo(const STsdbReader* pReader, int32_t* rows, uint64_t* uid, STimeWindow* pWindow) {
|
||||
tAssert(pReader != NULL);
|
||||
ASSERT(pReader != NULL);
|
||||
*rows = pReader->pResBlock->info.rows;
|
||||
*uid = pReader->pResBlock->info.id.uid;
|
||||
*pWindow = pReader->pResBlock->info.window;
|
||||
|
@ -4130,7 +4130,7 @@ int32_t tsdbRetrieveDatablockSMA(STsdbReader* pReader, SColumnDataAgg ***pBlockS
|
|||
SFileDataBlockInfo* pFBlock = getCurrentBlockInfo(&pReader->status.blockIter);
|
||||
SBlockLoadSuppInfo* pSup = &pReader->suppInfo;
|
||||
|
||||
tAssert(pReader->pResBlock->info.id.uid == pFBlock->uid);
|
||||
ASSERT(pReader->pResBlock->info.id.uid == pFBlock->uid);
|
||||
|
||||
SDataBlk* pBlock = getCurrentBlock(&pReader->status.blockIter);
|
||||
if (tDataBlkHasSma(pBlock)) {
|
||||
|
@ -4180,7 +4180,7 @@ int32_t tsdbRetrieveDatablockSMA(STsdbReader* pReader, SColumnDataAgg ***pBlockS
|
|||
} else if (pAgg->colId < pSup->colId[j]) {
|
||||
i += 1;
|
||||
} else if (pSup->colId[j] < pAgg->colId) {
|
||||
tAssert(pSup->colId[j] == PRIMARYKEY_TIMESTAMP_COL_ID);
|
||||
ASSERT(pSup->colId[j] == PRIMARYKEY_TIMESTAMP_COL_ID);
|
||||
pResBlock->pBlockAgg[pSup->slotId[j]] = &pSup->tsColAgg;
|
||||
j += 1;
|
||||
}
|
||||
|
@ -4412,7 +4412,7 @@ int32_t tsdbGetTableSchema(SVnode* pVnode, int64_t uid, STSchema** pSchema, int6
|
|||
}
|
||||
sversion = mr.me.stbEntry.schemaRow.version;
|
||||
} else {
|
||||
tAssert(mr.me.type == TSDB_NORMAL_TABLE);
|
||||
ASSERT(mr.me.type == TSDB_NORMAL_TABLE);
|
||||
sversion = mr.me.ntbEntry.schemaRow.version;
|
||||
}
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ static int32_t tsdbOpenFile(const char *path, int32_t szPage, int32_t flag, STsd
|
|||
taosMemoryFree(pFD);
|
||||
goto _exit;
|
||||
}
|
||||
tAssert(pFD->szFile % szPage == 0);
|
||||
ASSERT(pFD->szFile % szPage == 0);
|
||||
pFD->szFile = pFD->szFile / szPage;
|
||||
*ppFD = pFD;
|
||||
|
||||
|
@ -103,7 +103,7 @@ _exit:
|
|||
static int32_t tsdbReadFilePage(STsdbFD *pFD, int64_t pgno) {
|
||||
int32_t code = 0;
|
||||
|
||||
tAssert(pgno <= pFD->szFile);
|
||||
ASSERT(pgno <= pFD->szFile);
|
||||
|
||||
// seek
|
||||
int64_t offset = PAGE_OFFSET(pgno, pFD->szPage);
|
||||
|
@ -175,8 +175,8 @@ static int32_t tsdbReadFile(STsdbFD *pFD, int64_t offset, uint8_t *pBuf, int64_t
|
|||
int32_t szPgCont = PAGE_CONTENT_SIZE(pFD->szPage);
|
||||
int64_t bOffset = fOffset % pFD->szPage;
|
||||
|
||||
tAssert(pgno && pgno <= pFD->szFile);
|
||||
tAssert(bOffset < szPgCont);
|
||||
ASSERT(pgno && pgno <= pFD->szFile);
|
||||
ASSERT(bOffset < szPgCont);
|
||||
|
||||
while (n < size) {
|
||||
if (pFD->pgno != pgno) {
|
||||
|
@ -284,7 +284,7 @@ int32_t tsdbDataFWriterOpen(SDataFWriter **ppWriter, STsdb *pTsdb, SDFileSet *pS
|
|||
}
|
||||
|
||||
// stt
|
||||
tAssert(pWriter->fStt[pSet->nSttF - 1].size == 0);
|
||||
ASSERT(pWriter->fStt[pSet->nSttF - 1].size == 0);
|
||||
flag = TD_FILE_READ | TD_FILE_WRITE | TD_FILE_CREATE | TD_FILE_TRUNC;
|
||||
tsdbSttFileName(pTsdb, pWriter->wSet.diskId, pWriter->wSet.fid, &pWriter->fStt[pSet->nSttF - 1], fname);
|
||||
code = tsdbOpenFile(fname, szPage, flag, &pWriter->pSttFD);
|
||||
|
@ -404,7 +404,7 @@ int32_t tsdbWriteBlockIdx(SDataFWriter *pWriter, SArray *aBlockIdx) {
|
|||
for (int32_t iBlockIdx = 0; iBlockIdx < taosArrayGetSize(aBlockIdx); iBlockIdx++) {
|
||||
n += tPutBlockIdx(pWriter->aBuf[0] + n, taosArrayGet(aBlockIdx, iBlockIdx));
|
||||
}
|
||||
tAssert(n == size);
|
||||
ASSERT(n == size);
|
||||
|
||||
// write
|
||||
code = tsdbWriteFile(pWriter->pHeadFD, pHeadFile->size, pWriter->aBuf[0], size);
|
||||
|
@ -431,7 +431,7 @@ int32_t tsdbWriteDataBlk(SDataFWriter *pWriter, SMapData *mDataBlk, SBlockIdx *p
|
|||
int64_t size;
|
||||
int64_t n;
|
||||
|
||||
tAssert(mDataBlk->nItem > 0);
|
||||
ASSERT(mDataBlk->nItem > 0);
|
||||
|
||||
// alloc
|
||||
size = tPutMapData(NULL, mDataBlk);
|
||||
|
@ -547,7 +547,7 @@ int32_t tsdbWriteBlockData(SDataFWriter *pWriter, SBlockData *pBlockData, SBlock
|
|||
int8_t cmprAlg, int8_t toLast) {
|
||||
int32_t code = 0;
|
||||
|
||||
tAssert(pBlockData->nRow > 0);
|
||||
ASSERT(pBlockData->nRow > 0);
|
||||
|
||||
if (toLast) {
|
||||
pBlkInfo->offset = pWriter->fStt[pWriter->wSet.nSttF - 1].size;
|
||||
|
@ -666,7 +666,7 @@ int32_t tsdbWriteDiskData(SDataFWriter *pWriter, const SDiskData *pDiskData, SBl
|
|||
SDiskCol *pDiskCol = (SDiskCol *)taosArrayGet(pDiskData->aDiskCol, iDiskCol);
|
||||
n += tPutBlockCol(pWriter->aBuf[0] + n, pDiskCol);
|
||||
}
|
||||
tAssert(n == pDiskData->hdr.szBlkCol);
|
||||
ASSERT(n == pDiskData->hdr.szBlkCol);
|
||||
|
||||
code = tsdbWriteFile(pFD, pBlkInfo->offset + pBlkInfo->szBlock, pWriter->aBuf[0], pDiskData->hdr.szBlkCol);
|
||||
TSDB_CHECK_CODE(code, lino, _exit);
|
||||
|
@ -953,7 +953,7 @@ int32_t tsdbReadBlockIdx(SDataFReader *pReader, SArray *aBlockIdx) {
|
|||
goto _err;
|
||||
}
|
||||
}
|
||||
tAssert(n == size);
|
||||
ASSERT(n == size);
|
||||
|
||||
return code;
|
||||
|
||||
|
@ -990,7 +990,7 @@ int32_t tsdbReadSttBlk(SDataFReader *pReader, int32_t iStt, SArray *aSttBlk) {
|
|||
goto _err;
|
||||
}
|
||||
}
|
||||
tAssert(n == size);
|
||||
ASSERT(n == size);
|
||||
|
||||
return code;
|
||||
|
||||
|
@ -1018,7 +1018,7 @@ int32_t tsdbReadDataBlk(SDataFReader *pReader, SBlockIdx *pBlockIdx, SMapData *m
|
|||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
goto _err;
|
||||
}
|
||||
tAssert(n == size);
|
||||
ASSERT(n == size);
|
||||
|
||||
return code;
|
||||
|
||||
|
@ -1031,7 +1031,7 @@ int32_t tsdbReadBlockSma(SDataFReader *pReader, SDataBlk *pDataBlk, SArray *aCol
|
|||
int32_t code = 0;
|
||||
SSmaInfo *pSmaInfo = &pDataBlk->smaInfo;
|
||||
|
||||
tAssert(pSmaInfo->size > 0);
|
||||
ASSERT(pSmaInfo->size > 0);
|
||||
|
||||
taosArrayClear(aColumnDataAgg);
|
||||
|
||||
|
@ -1054,7 +1054,7 @@ int32_t tsdbReadBlockSma(SDataFReader *pReader, SDataBlk *pDataBlk, SArray *aCol
|
|||
goto _err;
|
||||
}
|
||||
}
|
||||
tAssert(n == pSmaInfo->size);
|
||||
ASSERT(n == pSmaInfo->size);
|
||||
return code;
|
||||
|
||||
_err:
|
||||
|
@ -1080,20 +1080,20 @@ static int32_t tsdbReadBlockDataImpl(SDataFReader *pReader, SBlockInfo *pBlkInfo
|
|||
SDiskDataHdr hdr;
|
||||
uint8_t *p = pReader->aBuf[0] + tGetDiskDataHdr(pReader->aBuf[0], &hdr);
|
||||
|
||||
tAssert(hdr.delimiter == TSDB_FILE_DLMT);
|
||||
tAssert(pBlockData->suid == hdr.suid);
|
||||
ASSERT(hdr.delimiter == TSDB_FILE_DLMT);
|
||||
ASSERT(pBlockData->suid == hdr.suid);
|
||||
|
||||
pBlockData->uid = hdr.uid;
|
||||
pBlockData->nRow = hdr.nRow;
|
||||
|
||||
// uid
|
||||
if (hdr.uid == 0) {
|
||||
tAssert(hdr.szUid);
|
||||
ASSERT(hdr.szUid);
|
||||
code = tsdbDecmprData(p, hdr.szUid, TSDB_DATA_TYPE_BIGINT, hdr.cmprAlg, (uint8_t **)&pBlockData->aUid,
|
||||
sizeof(int64_t) * hdr.nRow, &pReader->aBuf[1]);
|
||||
if (code) goto _err;
|
||||
} else {
|
||||
tAssert(!hdr.szUid);
|
||||
ASSERT(!hdr.szUid);
|
||||
}
|
||||
p += hdr.szUid;
|
||||
|
||||
|
@ -1109,7 +1109,7 @@ static int32_t tsdbReadBlockDataImpl(SDataFReader *pReader, SBlockInfo *pBlkInfo
|
|||
if (code) goto _err;
|
||||
p += hdr.szKey;
|
||||
|
||||
tAssert(p - pReader->aBuf[0] == pBlkInfo->szKey);
|
||||
ASSERT(p - pReader->aBuf[0] == pBlkInfo->szKey);
|
||||
|
||||
// read and decode columns
|
||||
if (pBlockData->nColData == 0) goto _exit;
|
||||
|
@ -1135,7 +1135,7 @@ static int32_t tsdbReadBlockDataImpl(SDataFReader *pReader, SBlockInfo *pBlkInfo
|
|||
if (n < hdr.szBlkCol) {
|
||||
n += tGetBlockCol(pReader->aBuf[0] + n, pBlockCol);
|
||||
} else {
|
||||
tAssert(n == hdr.szBlkCol);
|
||||
ASSERT(n == hdr.szBlkCol);
|
||||
pBlockCol = NULL;
|
||||
}
|
||||
}
|
||||
|
@ -1147,8 +1147,8 @@ static int32_t tsdbReadBlockDataImpl(SDataFReader *pReader, SBlockInfo *pBlkInfo
|
|||
if (code) goto _err;
|
||||
}
|
||||
} else {
|
||||
tAssert(pBlockCol->type == pColData->type);
|
||||
tAssert(pBlockCol->flag && pBlockCol->flag != HAS_NONE);
|
||||
ASSERT(pBlockCol->type == pColData->type);
|
||||
ASSERT(pBlockCol->flag && pBlockCol->flag != HAS_NONE);
|
||||
|
||||
if (pBlockCol->flag == HAS_NULL) {
|
||||
// add a lot of NULL
|
||||
|
@ -1210,7 +1210,7 @@ int32_t tsdbReadDataBlock(SDataFReader *pReader, SDataBlk *pDataBlk, SBlockData
|
|||
code = tsdbReadBlockDataImpl(pReader, &pDataBlk->aSubBlock[0], pBlockData, -1);
|
||||
if (code) goto _err;
|
||||
|
||||
tAssert(pDataBlk->nSubBlock == 1);
|
||||
ASSERT(pDataBlk->nSubBlock == 1);
|
||||
|
||||
return code;
|
||||
|
||||
|
@ -1349,7 +1349,7 @@ int32_t tsdbWriteDelData(SDelFWriter *pWriter, SArray *aDelData, SDelIdx *pDelId
|
|||
for (int32_t iDelData = 0; iDelData < taosArrayGetSize(aDelData); iDelData++) {
|
||||
n += tPutDelData(pWriter->aBuf[0] + n, taosArrayGet(aDelData, iDelData));
|
||||
}
|
||||
tAssert(n == size);
|
||||
ASSERT(n == size);
|
||||
|
||||
// write
|
||||
code = tsdbWriteFile(pWriter->pWriteH, pWriter->fDel.size, pWriter->aBuf[0], size);
|
||||
|
@ -1388,7 +1388,7 @@ int32_t tsdbWriteDelIdx(SDelFWriter *pWriter, SArray *aDelIdx) {
|
|||
for (int32_t iDelIdx = 0; iDelIdx < taosArrayGetSize(aDelIdx); iDelIdx++) {
|
||||
n += tPutDelIdx(pWriter->aBuf[0] + n, taosArrayGet(aDelIdx, iDelIdx));
|
||||
}
|
||||
tAssert(n == size);
|
||||
ASSERT(n == size);
|
||||
|
||||
// write
|
||||
code = tsdbWriteFile(pWriter->pWriteH, pWriter->fDel.size, pWriter->aBuf[0], size);
|
||||
|
@ -1509,7 +1509,7 @@ int32_t tsdbReadDelData(SDelFReader *pReader, SDelIdx *pDelIdx, SArray *aDelData
|
|||
goto _err;
|
||||
}
|
||||
}
|
||||
tAssert(n == size);
|
||||
ASSERT(n == size);
|
||||
|
||||
return code;
|
||||
|
||||
|
@ -1547,7 +1547,7 @@ int32_t tsdbReadDelIdx(SDelFReader *pReader, SArray *aDelIdx) {
|
|||
}
|
||||
}
|
||||
|
||||
tAssert(n == size);
|
||||
ASSERT(n == size);
|
||||
|
||||
return code;
|
||||
|
||||
|
|
|
@ -106,7 +106,7 @@ _exit:
|
|||
|
||||
_err:
|
||||
tsdbError("vgId:%d, tsdb do retention failed since %s", TD_VID(pTsdb->pVnode), tstrerror(code));
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
// tsdbFSRollback(pTsdb->pFS);
|
||||
return code;
|
||||
}
|
|
@ -110,8 +110,8 @@ static int32_t tsdbSnapReadOpenFile(STsdbSnapReader* pReader) {
|
|||
code = tsdbReadDataBlockEx(pReader->pDataFReader, &dataBlk, &pIter->bData);
|
||||
if (code) goto _err;
|
||||
|
||||
tAssert(pIter->pBlockIdx->suid == pIter->bData.suid);
|
||||
tAssert(pIter->pBlockIdx->uid == pIter->bData.uid);
|
||||
ASSERT(pIter->pBlockIdx->suid == pIter->bData.suid);
|
||||
ASSERT(pIter->pBlockIdx->uid == pIter->bData.uid);
|
||||
|
||||
for (pIter->iRow = 0; pIter->iRow < pIter->bData.nRow; pIter->iRow++) {
|
||||
int64_t rowVer = pIter->bData.aVersion[pIter->iRow];
|
||||
|
@ -239,7 +239,7 @@ static int32_t tsdbSnapNextRow(STsdbSnapReader* pReader) {
|
|||
|
||||
pReader->pIter = NULL;
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -251,7 +251,7 @@ static int32_t tsdbSnapNextRow(STsdbSnapReader* pReader) {
|
|||
tRBTreePut(&pReader->rbt, (SRBTreeNode*)pReader->pIter);
|
||||
pReader->pIter = NULL;
|
||||
} else {
|
||||
tAssert(c);
|
||||
ASSERT(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -272,7 +272,7 @@ _err:
|
|||
static int32_t tsdbSnapCmprData(STsdbSnapReader* pReader, uint8_t** ppData) {
|
||||
int32_t code = 0;
|
||||
|
||||
tAssert(pReader->bData.nRow);
|
||||
ASSERT(pReader->bData.nRow);
|
||||
|
||||
int32_t aBufN[5] = {0};
|
||||
code = tCmprBlockData(&pReader->bData, TWO_STAGE_COMP, NULL, NULL, pReader->aBuf, aBufN);
|
||||
|
@ -674,7 +674,7 @@ extern int32_t tsdbWriteSttBlock(SDataFWriter* pWriter, SBlockData* pBlockData,
|
|||
static int32_t tsdbSnapNextTableData(STsdbSnapWriter* pWriter) {
|
||||
int32_t code = 0;
|
||||
|
||||
tAssert(pWriter->dReader.iRow >= pWriter->dReader.bData.nRow);
|
||||
ASSERT(pWriter->dReader.iRow >= pWriter->dReader.bData.nRow);
|
||||
|
||||
if (pWriter->dReader.iBlockIdx < taosArrayGetSize(pWriter->dReader.aBlockIdx)) {
|
||||
pWriter->dReader.pBlockIdx = (SBlockIdx*)taosArrayGet(pWriter->dReader.aBlockIdx, pWriter->dReader.iBlockIdx);
|
||||
|
@ -750,7 +750,7 @@ static int32_t tsdbSnapWriteTableDataEnd(STsdbSnapWriter* pWriter) {
|
|||
int32_t c = 1;
|
||||
if (pWriter->dReader.pBlockIdx) {
|
||||
c = tTABLEIDCmprFn(pWriter->dReader.pBlockIdx, &pWriter->id);
|
||||
tAssert(c >= 0);
|
||||
ASSERT(c >= 0);
|
||||
}
|
||||
|
||||
if (c == 0) {
|
||||
|
@ -806,7 +806,7 @@ static int32_t tsdbSnapWriteOpenFile(STsdbSnapWriter* pWriter, int32_t fid) {
|
|||
int32_t code = 0;
|
||||
STsdb* pTsdb = pWriter->pTsdb;
|
||||
|
||||
tAssert(pWriter->dWriter.pWriter == NULL);
|
||||
ASSERT(pWriter->dWriter.pWriter == NULL);
|
||||
|
||||
pWriter->fid = fid;
|
||||
pWriter->id = (TABLEID){0};
|
||||
|
@ -820,7 +820,7 @@ static int32_t tsdbSnapWriteOpenFile(STsdbSnapWriter* pWriter, int32_t fid) {
|
|||
code = tsdbReadBlockIdx(pWriter->dReader.pReader, pWriter->dReader.aBlockIdx);
|
||||
if (code) goto _err;
|
||||
} else {
|
||||
tAssert(pWriter->dReader.pReader == NULL);
|
||||
ASSERT(pWriter->dReader.pReader == NULL);
|
||||
taosArrayClear(pWriter->dReader.aBlockIdx);
|
||||
}
|
||||
pWriter->dReader.iBlockIdx = 0; // point to the next one
|
||||
|
@ -867,7 +867,7 @@ _err:
|
|||
static int32_t tsdbSnapWriteCloseFile(STsdbSnapWriter* pWriter) {
|
||||
int32_t code = 0;
|
||||
|
||||
tAssert(pWriter->dWriter.pWriter);
|
||||
ASSERT(pWriter->dWriter.pWriter);
|
||||
|
||||
code = tsdbSnapWriteTableDataEnd(pWriter);
|
||||
if (code) goto _err;
|
||||
|
@ -925,7 +925,7 @@ static int32_t tsdbSnapWriteToDataFile(STsdbSnapWriter* pWriter, int32_t iRow, i
|
|||
TSDBROW trow = tsdbRowFromBlockData(&pWriter->dReader.bData, pWriter->dReader.iRow);
|
||||
TSDBKEY tKey = TSDBROW_KEY(&trow);
|
||||
|
||||
tAssert(pWriter->dReader.bData.suid == id.suid && pWriter->dReader.bData.uid == id.uid);
|
||||
ASSERT(pWriter->dReader.bData.suid == id.suid && pWriter->dReader.bData.uid == id.uid);
|
||||
|
||||
int32_t c = tsdbKeyCmprFn(&key, &tKey);
|
||||
if (c < 0) {
|
||||
|
@ -935,7 +935,7 @@ static int32_t tsdbSnapWriteToDataFile(STsdbSnapWriter* pWriter, int32_t iRow, i
|
|||
code = tBlockDataAppendRow(&pWriter->dWriter.bData, &trow, NULL, id.uid);
|
||||
if (code) goto _err;
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
if (pWriter->dWriter.bData.nRow >= pWriter->maxRow) {
|
||||
|
@ -1086,7 +1086,7 @@ static int32_t tsdbSnapWriteData(STsdbSnapWriter* pWriter, uint8_t* pData, uint3
|
|||
code = tDecmprBlockData(pHdr->data, pHdr->size, pBlockData, pWriter->aBuf);
|
||||
if (code) goto _err;
|
||||
|
||||
tAssert(pBlockData->nRow > 0);
|
||||
ASSERT(pBlockData->nRow > 0);
|
||||
|
||||
// Loop to handle each row
|
||||
for (int32_t iRow = 0; iRow < pBlockData->nRow; iRow++) {
|
||||
|
@ -1095,7 +1095,7 @@ static int32_t tsdbSnapWriteData(STsdbSnapWriter* pWriter, uint8_t* pData, uint3
|
|||
|
||||
if (pWriter->dWriter.pWriter == NULL || pWriter->fid != fid) {
|
||||
if (pWriter->dWriter.pWriter) {
|
||||
tAssert(fid > pWriter->fid);
|
||||
ASSERT(fid > pWriter->fid);
|
||||
|
||||
code = tsdbSnapWriteCloseFile(pWriter);
|
||||
if (code) goto _err;
|
||||
|
@ -1177,7 +1177,7 @@ static int32_t tsdbSnapWriteDel(STsdbSnapWriter* pWriter, uint8_t* pData, uint32
|
|||
SSnapDataHdr* pHdr = (SSnapDataHdr*)pData;
|
||||
TABLEID id = *(TABLEID*)pHdr->data;
|
||||
|
||||
tAssert(pHdr->size + sizeof(SSnapDataHdr) == nData);
|
||||
ASSERT(pHdr->size + sizeof(SSnapDataHdr) == nData);
|
||||
|
||||
// Move write data < id
|
||||
code = tsdbSnapMoveWriteDelData(pWriter, &id);
|
||||
|
@ -1368,7 +1368,7 @@ int32_t tsdbSnapWriterClose(STsdbSnapWriter** ppWriter, int8_t rollback) {
|
|||
STsdb* pTsdb = pWriter->pTsdb;
|
||||
|
||||
if (rollback) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
// code = tsdbFSRollback(pWriter->pTsdb->pFS);
|
||||
// if (code) goto _err;
|
||||
} else {
|
||||
|
|
|
@ -97,7 +97,7 @@ _exit:
|
|||
}
|
||||
|
||||
void tMapDataGetItemByIdx(SMapData *pMapData, int32_t idx, void *pItem, int32_t (*tGetItemFn)(uint8_t *, void *)) {
|
||||
tAssert(idx >= 0 && idx < pMapData->nItem);
|
||||
ASSERT(idx >= 0 && idx < pMapData->nItem);
|
||||
tGetItemFn(pMapData->pData + pMapData->aOffset[idx], pItem);
|
||||
}
|
||||
|
||||
|
@ -379,7 +379,7 @@ int32_t tPutBlockCol(uint8_t *p, void *ph) {
|
|||
int32_t n = 0;
|
||||
SBlockCol *pBlockCol = (SBlockCol *)ph;
|
||||
|
||||
tAssert(pBlockCol->flag && (pBlockCol->flag != HAS_NONE));
|
||||
ASSERT(pBlockCol->flag && (pBlockCol->flag != HAS_NONE));
|
||||
|
||||
n += tPutI16v(p ? p + n : p, pBlockCol->cid);
|
||||
n += tPutI8(p ? p + n : p, pBlockCol->type);
|
||||
|
@ -417,7 +417,7 @@ int32_t tGetBlockCol(uint8_t *p, void *ph) {
|
|||
n += tGetI8(p + n, &pBlockCol->flag);
|
||||
n += tGetI32v(p + n, &pBlockCol->szOrigin);
|
||||
|
||||
tAssert(pBlockCol->flag && (pBlockCol->flag != HAS_NONE));
|
||||
ASSERT(pBlockCol->flag && (pBlockCol->flag != HAS_NONE));
|
||||
|
||||
pBlockCol->szBitmap = 0;
|
||||
pBlockCol->szOffset = 0;
|
||||
|
@ -544,7 +544,7 @@ int32_t tsdbFidLevel(int32_t fid, STsdbKeepCfg *pKeepCfg, int64_t now) {
|
|||
} else if (pKeepCfg->precision == TSDB_TIME_PRECISION_NANO) {
|
||||
now = now * 1000000000l;
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
key = now - pKeepCfg->keep0 * tsTickPerMin[pKeepCfg->precision];
|
||||
|
@ -570,7 +570,7 @@ void tsdbRowGetColVal(TSDBROW *pRow, STSchema *pTSchema, int32_t iCol, SColVal *
|
|||
STColumn *pTColumn = &pTSchema->columns[iCol];
|
||||
SValue value;
|
||||
|
||||
tAssert(iCol > 0);
|
||||
ASSERT(iCol > 0);
|
||||
|
||||
if (pRow->type == 0) {
|
||||
tTSRowGetVal(pRow->pTSRow, pTSchema, iCol, pColVal);
|
||||
|
@ -585,7 +585,7 @@ void tsdbRowGetColVal(TSDBROW *pRow, STSchema *pTSchema, int32_t iCol, SColVal *
|
|||
*pColVal = COL_VAL_NONE(pTColumn->colId, pTColumn->type);
|
||||
}
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -607,14 +607,14 @@ int32_t tsdbRowCmprFn(const void *p1, const void *p2) {
|
|||
void tsdbRowIterInit(STSDBRowIter *pIter, TSDBROW *pRow, STSchema *pTSchema) {
|
||||
pIter->pRow = pRow;
|
||||
if (pRow->type == 0) {
|
||||
tAssert(pTSchema);
|
||||
ASSERT(pTSchema);
|
||||
pIter->pTSchema = pTSchema;
|
||||
pIter->i = 1;
|
||||
} else if (pRow->type == 1) {
|
||||
pIter->pTSchema = NULL;
|
||||
pIter->i = 0;
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -661,7 +661,7 @@ int32_t tRowMergerInit2(SRowMerger *pMerger, STSchema *pResTSchema, TSDBROW *pRo
|
|||
// ts
|
||||
pTColumn = &pTSchema->columns[jCol++];
|
||||
|
||||
tAssert(pTColumn->type == TSDB_DATA_TYPE_TIMESTAMP);
|
||||
ASSERT(pTColumn->type == TSDB_DATA_TYPE_TIMESTAMP);
|
||||
|
||||
*pColVal = COL_VAL_VALUE(pTColumn->colId, pTColumn->type, (SValue){.val = key.ts});
|
||||
if (taosArrayPush(pMerger->pArray, pColVal) == NULL) {
|
||||
|
@ -704,7 +704,7 @@ int32_t tRowMergerAdd(SRowMerger *pMerger, TSDBROW *pRow, STSchema *pTSchema) {
|
|||
STColumn *pTColumn;
|
||||
int32_t iCol, jCol = 1;
|
||||
|
||||
tAssert(((SColVal *)pMerger->pArray->pData)->value.val == key.ts);
|
||||
ASSERT(((SColVal *)pMerger->pArray->pData)->value.val == key.ts);
|
||||
|
||||
for (iCol = 1; iCol < pMerger->pTSchema->numOfCols && jCol < pTSchema->numOfCols; ++iCol) {
|
||||
pTColumn = &pMerger->pTSchema->columns[iCol];
|
||||
|
@ -728,7 +728,7 @@ int32_t tRowMergerAdd(SRowMerger *pMerger, TSDBROW *pRow, STSchema *pTSchema) {
|
|||
taosArraySet(pMerger->pArray, iCol, pColVal);
|
||||
}
|
||||
} else {
|
||||
tAssert(0 && "dup versions not allowed");
|
||||
ASSERT(0 && "dup versions not allowed");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -754,7 +754,7 @@ int32_t tRowMergerInit(SRowMerger *pMerger, TSDBROW *pRow, STSchema *pTSchema) {
|
|||
// ts
|
||||
pTColumn = &pTSchema->columns[0];
|
||||
|
||||
tAssert(pTColumn->type == TSDB_DATA_TYPE_TIMESTAMP);
|
||||
ASSERT(pTColumn->type == TSDB_DATA_TYPE_TIMESTAMP);
|
||||
|
||||
*pColVal = COL_VAL_VALUE(pTColumn->colId, pTColumn->type, (SValue){.val = key.ts});
|
||||
if (taosArrayPush(pMerger->pArray, pColVal) == NULL) {
|
||||
|
@ -782,7 +782,7 @@ int32_t tRowMerge(SRowMerger *pMerger, TSDBROW *pRow) {
|
|||
TSDBKEY key = TSDBROW_KEY(pRow);
|
||||
SColVal *pColVal = &(SColVal){0};
|
||||
|
||||
tAssert(((SColVal *)pMerger->pArray->pData)->value.val == key.ts);
|
||||
ASSERT(((SColVal *)pMerger->pArray->pData)->value.val == key.ts);
|
||||
|
||||
for (int32_t iCol = 1; iCol < pMerger->pTSchema->numOfCols; iCol++) {
|
||||
tsdbRowGetColVal(pRow, pMerger->pTSchema, iCol, pColVal);
|
||||
|
@ -797,7 +797,7 @@ int32_t tRowMerge(SRowMerger *pMerger, TSDBROW *pRow) {
|
|||
taosArraySet(pMerger->pArray, iCol, pColVal);
|
||||
}
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -828,7 +828,7 @@ static int32_t tsdbMergeSkyline(SArray *aSkyline1, SArray *aSkyline2, SArray *aS
|
|||
int64_t version1 = 0;
|
||||
int64_t version2 = 0;
|
||||
|
||||
tAssert(n1 > 0 && n2 > 0);
|
||||
ASSERT(n1 > 0 && n2 > 0);
|
||||
|
||||
taosArrayClear(aSkyline);
|
||||
|
||||
|
@ -955,7 +955,7 @@ void tBlockDataDestroy(SBlockData *pBlockData, int8_t deepClear) {
|
|||
int32_t tBlockDataInit(SBlockData *pBlockData, TABLEID *pId, STSchema *pTSchema, int16_t *aCid, int32_t nCid) {
|
||||
int32_t code = 0;
|
||||
|
||||
tAssert(pId->suid || pId->uid);
|
||||
ASSERT(pId->suid || pId->uid);
|
||||
|
||||
pBlockData->suid = pId->suid;
|
||||
pBlockData->uid = pId->uid;
|
||||
|
@ -1007,7 +1007,7 @@ void tBlockDataReset(SBlockData *pBlockData) {
|
|||
}
|
||||
|
||||
void tBlockDataClear(SBlockData *pBlockData) {
|
||||
tAssert(pBlockData->suid || pBlockData->uid);
|
||||
ASSERT(pBlockData->suid || pBlockData->uid);
|
||||
|
||||
pBlockData->nRow = 0;
|
||||
for (int32_t iColData = 0; iColData < pBlockData->nColData; iColData++) {
|
||||
|
@ -1095,7 +1095,7 @@ static int32_t tBlockDataAppendTPRow(SBlockData *pBlockData, STSRow *pRow, STSch
|
|||
code = tColDataAppendValue(pColData, &COL_VAL_NONE(pColData->cid, pColData->type));
|
||||
if (code) goto _exit;
|
||||
} else {
|
||||
tAssert(pTColumn->type == pColData->type);
|
||||
ASSERT(pTColumn->type == pColData->type);
|
||||
|
||||
SColVal cv = {.cid = pTColumn->colId, .type = pTColumn->type};
|
||||
|
||||
|
@ -1123,7 +1123,7 @@ static int32_t tBlockDataAppendTPRow(SBlockData *pBlockData, STSRow *pRow, STSch
|
|||
code = tColDataAppendValue(pColData, &COL_VAL_NULL(pColData->cid, pColData->type));
|
||||
if (code) goto _exit;
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
} else {
|
||||
cv.flag = CV_FLAG_VALUE;
|
||||
|
@ -1171,7 +1171,7 @@ static int32_t tBlockDataAppendKVRow(SBlockData *pBlockData, STSRow *pRow, STSch
|
|||
code = tColDataAppendValue(pColData, &COL_VAL_NONE(pColData->cid, pColData->type));
|
||||
if (code) goto _exit;
|
||||
} else {
|
||||
tAssert(pTColumn->type == pColData->type);
|
||||
ASSERT(pTColumn->type == pColData->type);
|
||||
|
||||
SColVal cv = {.cid = pTColumn->colId, .type = pTColumn->type};
|
||||
TDRowValT vt = TD_VTYPE_NONE; // default is NONE
|
||||
|
@ -1211,7 +1211,7 @@ static int32_t tBlockDataAppendKVRow(SBlockData *pBlockData, STSRow *pRow, STSch
|
|||
code = tColDataAppendValue(pColData, &COL_VAL_NULL(pColData->cid, pColData->type));
|
||||
if (code) goto _exit;
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
iTColumn++;
|
||||
|
@ -1226,11 +1226,11 @@ _exit:
|
|||
int32_t tBlockDataAppendRow(SBlockData *pBlockData, TSDBROW *pRow, STSchema *pTSchema, int64_t uid) {
|
||||
int32_t code = 0;
|
||||
|
||||
tAssert(pBlockData->suid || pBlockData->uid);
|
||||
ASSERT(pBlockData->suid || pBlockData->uid);
|
||||
|
||||
// uid
|
||||
if (pBlockData->uid == 0) {
|
||||
tAssert(uid);
|
||||
ASSERT(uid);
|
||||
code = tRealloc((uint8_t **)&pBlockData->aUid, sizeof(int64_t) * (pBlockData->nRow + 1));
|
||||
if (code) goto _err;
|
||||
pBlockData->aUid[pBlockData->nRow] = uid;
|
||||
|
@ -1253,7 +1253,7 @@ int32_t tBlockDataAppendRow(SBlockData *pBlockData, TSDBROW *pRow, STSchema *pTS
|
|||
code = tBlockDataAppendKVRow(pBlockData, pRow->pTSRow, pTSchema);
|
||||
if (code) goto _err;
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
} else {
|
||||
code = tBlockDataAppendBlockRow(pBlockData, pRow->pBlockData, pRow->iRow);
|
||||
|
@ -1310,10 +1310,10 @@ _exit:
|
|||
int32_t tBlockDataMerge(SBlockData *pBlockData1, SBlockData *pBlockData2, SBlockData *pBlockData) {
|
||||
int32_t code = 0;
|
||||
|
||||
tAssert(pBlockData->suid == pBlockData1->suid);
|
||||
tAssert(pBlockData->uid == pBlockData1->uid);
|
||||
tAssert(pBlockData1->nRow > 0);
|
||||
tAssert(pBlockData2->nRow > 0);
|
||||
ASSERT(pBlockData->suid == pBlockData1->suid);
|
||||
ASSERT(pBlockData->uid == pBlockData1->uid);
|
||||
ASSERT(pBlockData1->nRow > 0);
|
||||
ASSERT(pBlockData2->nRow > 0);
|
||||
|
||||
tBlockDataClear(pBlockData);
|
||||
|
||||
|
@ -1348,7 +1348,7 @@ int32_t tBlockDataMerge(SBlockData *pBlockData1, SBlockData *pBlockData2, SBlock
|
|||
pRow2 = NULL;
|
||||
}
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1383,12 +1383,12 @@ _exit:
|
|||
}
|
||||
|
||||
SColData *tBlockDataGetColDataByIdx(SBlockData *pBlockData, int32_t idx) {
|
||||
tAssert(idx >= 0 && idx < pBlockData->nColData);
|
||||
ASSERT(idx >= 0 && idx < pBlockData->nColData);
|
||||
return (SColData *)taosArrayGet(pBlockData->aColData, idx);
|
||||
}
|
||||
|
||||
void tBlockDataGetColData(SBlockData *pBlockData, int16_t cid, SColData **ppColData) {
|
||||
tAssert(cid != PRIMARYKEY_TIMESTAMP_COL_ID);
|
||||
ASSERT(cid != PRIMARYKEY_TIMESTAMP_COL_ID);
|
||||
int32_t lidx = 0;
|
||||
int32_t ridx = pBlockData->nColData - 1;
|
||||
|
||||
|
@ -1427,7 +1427,7 @@ int32_t tCmprBlockData(SBlockData *pBlockData, int8_t cmprAlg, uint8_t **ppOut,
|
|||
for (int32_t iColData = 0; iColData < pBlockData->nColData; iColData++) {
|
||||
SColData *pColData = tBlockDataGetColDataByIdx(pBlockData, iColData);
|
||||
|
||||
tAssert(pColData->flag);
|
||||
ASSERT(pColData->flag);
|
||||
|
||||
if (pColData->flag == HAS_NONE) continue;
|
||||
|
||||
|
@ -1508,7 +1508,7 @@ int32_t tDecmprBlockData(uint8_t *pIn, int32_t szIn, SBlockData *pBlockData, uin
|
|||
|
||||
// SDiskDataHdr
|
||||
n += tGetDiskDataHdr(pIn + n, &hdr);
|
||||
tAssert(hdr.delimiter == TSDB_FILE_DLMT);
|
||||
ASSERT(hdr.delimiter == TSDB_FILE_DLMT);
|
||||
|
||||
pBlockData->suid = hdr.suid;
|
||||
pBlockData->uid = hdr.uid;
|
||||
|
@ -1516,12 +1516,12 @@ int32_t tDecmprBlockData(uint8_t *pIn, int32_t szIn, SBlockData *pBlockData, uin
|
|||
|
||||
// uid
|
||||
if (hdr.uid == 0) {
|
||||
tAssert(hdr.szUid);
|
||||
ASSERT(hdr.szUid);
|
||||
code = tsdbDecmprData(pIn + n, hdr.szUid, TSDB_DATA_TYPE_BIGINT, hdr.cmprAlg, (uint8_t **)&pBlockData->aUid,
|
||||
sizeof(int64_t) * hdr.nRow, &aBuf[0]);
|
||||
if (code) goto _exit;
|
||||
} else {
|
||||
tAssert(!hdr.szUid);
|
||||
ASSERT(!hdr.szUid);
|
||||
}
|
||||
n += hdr.szUid;
|
||||
|
||||
|
@ -1544,7 +1544,7 @@ int32_t tDecmprBlockData(uint8_t *pIn, int32_t szIn, SBlockData *pBlockData, uin
|
|||
while (nt < hdr.szBlkCol) {
|
||||
SBlockCol blockCol = {0};
|
||||
nt += tGetBlockCol(pIn + n + nt, &blockCol);
|
||||
tAssert(nt <= hdr.szBlkCol);
|
||||
ASSERT(nt <= hdr.szBlkCol);
|
||||
|
||||
SColData *pColData;
|
||||
code = tBlockDataAddColData(pBlockData, &pColData);
|
||||
|
@ -1632,7 +1632,7 @@ int32_t tsdbCmprData(uint8_t *pIn, int32_t szIn, int8_t type, int8_t cmprAlg, ui
|
|||
int32_t *szOut, uint8_t **ppBuf) {
|
||||
int32_t code = 0;
|
||||
|
||||
tAssert(szIn > 0 && ppOut);
|
||||
ASSERT(szIn > 0 && ppOut);
|
||||
|
||||
if (cmprAlg == NO_COMPRESSION) {
|
||||
code = tRealloc(ppOut, nOut + szIn);
|
||||
|
@ -1647,7 +1647,7 @@ int32_t tsdbCmprData(uint8_t *pIn, int32_t szIn, int8_t type, int8_t cmprAlg, ui
|
|||
if (code) goto _exit;
|
||||
|
||||
if (cmprAlg == TWO_STAGE_COMP) {
|
||||
tAssert(ppBuf);
|
||||
ASSERT(ppBuf);
|
||||
code = tRealloc(ppBuf, size);
|
||||
if (code) goto _exit;
|
||||
}
|
||||
|
@ -1672,7 +1672,7 @@ int32_t tsdbDecmprData(uint8_t *pIn, int32_t szIn, int8_t type, int8_t cmprAlg,
|
|||
if (code) goto _exit;
|
||||
|
||||
if (cmprAlg == NO_COMPRESSION) {
|
||||
tAssert(szIn == szOut);
|
||||
ASSERT(szIn == szOut);
|
||||
memcpy(*ppOut, pIn, szOut);
|
||||
} else {
|
||||
if (cmprAlg == TWO_STAGE_COMP) {
|
||||
|
@ -1687,7 +1687,7 @@ int32_t tsdbDecmprData(uint8_t *pIn, int32_t szIn, int8_t type, int8_t cmprAlg,
|
|||
goto _exit;
|
||||
}
|
||||
|
||||
tAssert(size == szOut);
|
||||
ASSERT(size == szOut);
|
||||
}
|
||||
|
||||
_exit:
|
||||
|
@ -1698,7 +1698,7 @@ int32_t tsdbCmprColData(SColData *pColData, int8_t cmprAlg, SBlockCol *pBlockCol
|
|||
uint8_t **ppBuf) {
|
||||
int32_t code = 0;
|
||||
|
||||
tAssert(pColData->flag && (pColData->flag != HAS_NONE) && (pColData->flag != HAS_NULL));
|
||||
ASSERT(pColData->flag && (pColData->flag != HAS_NONE) && (pColData->flag != HAS_NULL));
|
||||
|
||||
pBlockCol->szBitmap = 0;
|
||||
pBlockCol->szOffset = 0;
|
||||
|
@ -1744,8 +1744,8 @@ int32_t tsdbDecmprColData(uint8_t *pIn, SBlockCol *pBlockCol, int8_t cmprAlg, in
|
|||
uint8_t **ppBuf) {
|
||||
int32_t code = 0;
|
||||
|
||||
tAssert(pColData->cid == pBlockCol->cid);
|
||||
tAssert(pColData->type == pBlockCol->type);
|
||||
ASSERT(pColData->cid == pBlockCol->cid);
|
||||
ASSERT(pColData->type == pBlockCol->type);
|
||||
pColData->smaOn = pBlockCol->smaOn;
|
||||
pColData->flag = pBlockCol->flag;
|
||||
pColData->nVal = nVal;
|
||||
|
|
|
@ -32,7 +32,7 @@ int tsdbInsertData(STsdb *pTsdb, int64_t version, SSubmitReq *pMsg, SSubmitRsp *
|
|||
int32_t affectedrows = 0;
|
||||
int32_t numOfRows = 0;
|
||||
|
||||
tAssert(pTsdb->mem != NULL);
|
||||
ASSERT(pTsdb->mem != NULL);
|
||||
|
||||
// scan and convert
|
||||
if (tsdbScanAndConvertSubmitMsg(pTsdb, pMsg) < 0) {
|
||||
|
@ -97,7 +97,7 @@ static FORCE_INLINE int tsdbCheckRowRange(STsdb *pTsdb, tb_uid_t uid, STSRow *ro
|
|||
}
|
||||
|
||||
int tsdbScanAndConvertSubmitMsg(STsdb *pTsdb, SSubmitReq *pMsg) {
|
||||
tAssert(pMsg != NULL);
|
||||
ASSERT(pMsg != NULL);
|
||||
// STsdbMeta * pMeta = pTsdb->tsdbMeta;
|
||||
SSubmitMsgIter msgIter = {0};
|
||||
SSubmitBlk *pBlock = NULL;
|
||||
|
|
|
@ -72,7 +72,7 @@ int vnodeOpenBufPool(SVnode *pVnode) {
|
|||
SVBufPool *pPool = NULL;
|
||||
int64_t size = pVnode->config.szBuf / VNODE_BUFPOOL_SEGMENTS;
|
||||
|
||||
tAssert(pVnode->pPool == NULL);
|
||||
ASSERT(pVnode->pPool == NULL);
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
// create pool
|
||||
|
@ -110,14 +110,14 @@ int vnodeCloseBufPool(SVnode *pVnode) {
|
|||
|
||||
void vnodeBufPoolReset(SVBufPool *pPool) {
|
||||
for (SVBufPoolNode *pNode = pPool->pTail; pNode->prev; pNode = pPool->pTail) {
|
||||
tAssert(pNode->pnext == &pPool->pTail);
|
||||
ASSERT(pNode->pnext == &pPool->pTail);
|
||||
pNode->prev->pnext = &pPool->pTail;
|
||||
pPool->pTail = pNode->prev;
|
||||
pPool->size = pPool->size - sizeof(*pNode) - pNode->size;
|
||||
taosMemoryFree(pNode);
|
||||
}
|
||||
|
||||
tAssert(pPool->size == pPool->ptr - pPool->node.data);
|
||||
ASSERT(pPool->size == pPool->ptr - pPool->node.data);
|
||||
|
||||
pPool->size = 0;
|
||||
pPool->ptr = pPool->node.data;
|
||||
|
@ -126,7 +126,7 @@ void vnodeBufPoolReset(SVBufPool *pPool) {
|
|||
void *vnodeBufPoolMalloc(SVBufPool *pPool, int size) {
|
||||
SVBufPoolNode *pNode;
|
||||
void *p = NULL;
|
||||
tAssert(pPool != NULL);
|
||||
ASSERT(pPool != NULL);
|
||||
|
||||
if (pPool->lock) taosThreadSpinLock(pPool->lock);
|
||||
if (pPool->node.size >= pPool->ptr - pPool->node.data + size) {
|
||||
|
@ -172,7 +172,7 @@ void vnodeBufPoolFree(SVBufPool *pPool, void *p) {
|
|||
|
||||
void vnodeBufPoolRef(SVBufPool *pPool) {
|
||||
int32_t nRef = atomic_fetch_add_32(&pPool->nRef, 1);
|
||||
tAssert(nRef > 0);
|
||||
ASSERT(nRef > 0);
|
||||
}
|
||||
|
||||
void vnodeBufPoolUnRef(SVBufPool *pPool) {
|
||||
|
|
|
@ -195,7 +195,7 @@ int vnodeDecodeConfig(const SJson *pJson, void *pObj) {
|
|||
}
|
||||
for (int32_t i = 0; i < nRetention; ++i) {
|
||||
SJson *pNodeRetention = tjsonGetArrayItem(pNodeRetentions, i);
|
||||
tAssert(pNodeRetention != NULL);
|
||||
ASSERT(pNodeRetention != NULL);
|
||||
tjsonGetNumberValue(pNodeRetention, "freq", (pCfg->tsdbCfg.retentions)[i].freq, code);
|
||||
tjsonGetNumberValue(pNodeRetention, "freqUnit", (pCfg->tsdbCfg.retentions)[i].freqUnit, code);
|
||||
tjsonGetNumberValue(pNodeRetention, "keep", (pCfg->tsdbCfg.retentions)[i].keep, code);
|
||||
|
|
|
@ -115,7 +115,7 @@ void vnodeCleanup() {
|
|||
int vnodeScheduleTask(int (*execute)(void*), void* arg) {
|
||||
SVnodeTask* pTask;
|
||||
|
||||
tAssert(!vnodeGlobal.stop);
|
||||
ASSERT(!vnodeGlobal.stop);
|
||||
|
||||
pTask = taosMemoryMalloc(sizeof(*pTask));
|
||||
if (pTask == NULL) {
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
#define VNODE_GET_LOAD_RESET_VALS(pVar, oVal, vType, tags) \
|
||||
do { \
|
||||
int##vType##_t newVal = atomic_sub_fetch_##vType(&(pVar), (oVal)); \
|
||||
tAssert(newVal >= 0); \
|
||||
ASSERT(newVal >= 0); \
|
||||
if (newVal < 0) { \
|
||||
vWarn("vgId:%d %s, abnormal val:%" PRIi64 ", old val:%" PRIi64, TD_VID(pVnode), tags, newVal, (oVal)); \
|
||||
} \
|
||||
|
@ -89,7 +89,7 @@ int vnodeGetTableMeta(SVnode *pVnode, SRpcMsg *pMsg, bool direct) {
|
|||
} else if (mer1.me.type == TSDB_NORMAL_TABLE) {
|
||||
schema = mer1.me.ntbEntry.schemaRow;
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
metaRsp.numOfTags = schemaTag.nCols;
|
||||
|
@ -210,7 +210,7 @@ int vnodeGetTableCfg(SVnode *pVnode, SRpcMsg *pMsg, bool direct) {
|
|||
cfgRsp.pComment = strdup(mer1.me.ntbEntry.comment);
|
||||
}
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
cfgRsp.numOfTags = schemaTag.nCols;
|
||||
|
|
|
@ -321,7 +321,7 @@ int32_t vnodeSnapWriterClose(SVSnapWriter *pWriter, int8_t rollback, SSnapshot *
|
|||
|
||||
vnodeBegin(pVnode);
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
_exit:
|
||||
|
@ -339,8 +339,8 @@ int32_t vnodeSnapWrite(SVSnapWriter *pWriter, uint8_t *pData, uint32_t nData) {
|
|||
SSnapDataHdr *pHdr = (SSnapDataHdr *)pData;
|
||||
SVnode *pVnode = pWriter->pVnode;
|
||||
|
||||
tAssert(pHdr->size + sizeof(SSnapDataHdr) == nData);
|
||||
tAssert(pHdr->index == pWriter->index + 1);
|
||||
ASSERT(pHdr->size + sizeof(SSnapDataHdr) == nData);
|
||||
ASSERT(pHdr->index == pWriter->index + 1);
|
||||
pWriter->index = pHdr->index;
|
||||
|
||||
vInfo("vgId:%d, vnode snapshot write data, index:%" PRId64 " type:%d nData:%d", TD_VID(pVnode), pHdr->index,
|
||||
|
|
|
@ -189,8 +189,8 @@ int32_t vnodeProcessWriteMsg(SVnode *pVnode, SRpcMsg *pMsg, int64_t version, SRp
|
|||
vDebug("vgId:%d, start to process write request %s, index:%" PRId64, TD_VID(pVnode), TMSG_INFO(pMsg->msgType),
|
||||
version);
|
||||
|
||||
tAssert(pVnode->state.applyTerm <= pMsg->info.conn.applyTerm);
|
||||
tAssert(pVnode->state.applied + 1 == version);
|
||||
ASSERT(pVnode->state.applyTerm <= pMsg->info.conn.applyTerm);
|
||||
ASSERT(pVnode->state.applied + 1 == version);
|
||||
|
||||
pVnode->state.applied = version;
|
||||
pVnode->state.applyTerm = pMsg->info.conn.applyTerm;
|
||||
|
@ -853,7 +853,7 @@ static int32_t vnodeDebugPrintSingleSubmitMsg(SMeta *pMeta, SSubmitBlk *pBlock,
|
|||
}
|
||||
|
||||
static int32_t vnodeDebugPrintSubmitMsg(SVnode *pVnode, SSubmitReq *pMsg, const char *tags) {
|
||||
tAssert(pMsg != NULL);
|
||||
ASSERT(pMsg != NULL);
|
||||
SSubmitMsgIter msgIter = {0};
|
||||
SMeta *pMeta = pVnode->pMeta;
|
||||
SSubmitBlk *pBlock = NULL;
|
||||
|
@ -1231,7 +1231,7 @@ static int32_t vnodeProcessDeleteReq(SVnode *pVnode, int64_t version, void *pReq
|
|||
|
||||
tDecoderInit(pCoder, pReq, len);
|
||||
tDecodeDeleteRes(pCoder, pRes);
|
||||
tAssert(taosArrayGetSize(pRes->uidList) == 0 || (pRes->skey != 0 && pRes->ekey != 0));
|
||||
ASSERT(taosArrayGetSize(pRes->uidList) == 0 || (pRes->skey != 0 && pRes->ekey != 0));
|
||||
|
||||
for (int32_t iUid = 0; iUid < taosArrayGetSize(pRes->uidList); iUid++) {
|
||||
code = tsdbDeleteTableData(pVnode->pTsdb, version, pRes->suid, *(uint64_t *)taosArrayGet(pRes->uidList, iUid),
|
||||
|
|
|
@ -122,7 +122,7 @@ static void inline vnodeProposeBatchMsg(SVnode *pVnode, SRpcMsg **pMsgArr, bool
|
|||
int32_t code = syncProposeBatch(pVnode->sync, pMsgArr, pIsWeakArr, *arrSize);
|
||||
bool wait = (code == 0 && vnodeIsBlockMsg(pLastMsg->msgType));
|
||||
if (wait) {
|
||||
tAssert(!pVnode->blocked);
|
||||
ASSERT(!pVnode->blocked);
|
||||
pVnode->blocked = true;
|
||||
}
|
||||
taosThreadMutexUnlock(&pVnode->lock);
|
||||
|
@ -221,7 +221,7 @@ static int32_t inline vnodeProposeMsg(SVnode *pVnode, SRpcMsg *pMsg, bool isWeak
|
|||
int32_t code = syncPropose(pVnode->sync, pMsg, isWeak);
|
||||
bool wait = (code == 0 && vnodeIsMsgBlock(pMsg->msgType));
|
||||
if (wait) {
|
||||
tAssert(!pVnode->blocked);
|
||||
ASSERT(!pVnode->blocked);
|
||||
pVnode->blocked = true;
|
||||
}
|
||||
taosThreadMutexUnlock(&pVnode->lock);
|
||||
|
|
|
@ -22,7 +22,7 @@ extern SCatalogMgmt gCtgMgmt;
|
|||
SCtgDebug gCTGDebug = {0};
|
||||
|
||||
void ctgdUserCallback(SMetaData *pResult, void *param, int32_t code) {
|
||||
tAssert(*(int32_t *)param == 1);
|
||||
ASSERT(*(int32_t *)param == 1);
|
||||
taosMemoryFree(param);
|
||||
|
||||
qDebug("async call result: %s", tstrerror(code));
|
||||
|
|
|
@ -40,7 +40,7 @@ int32_t ctgHandleBatchRsp(SCtgJob* pJob, SCtgTaskCallbackParam* cbParam, SDataBu
|
|||
msgNum = taosArrayGetSize(batchRsp.pRsps);
|
||||
}
|
||||
|
||||
tAssert(taskNum == msgNum || 0 == msgNum);
|
||||
ASSERT(taskNum == msgNum || 0 == msgNum);
|
||||
|
||||
ctgDebug("QID:0x%" PRIx64 " ctg got batch %d rsp %s", pJob->queryId, cbParam->batchId,
|
||||
TMSG_INFO(cbParam->reqType + 1));
|
||||
|
@ -62,7 +62,7 @@ int32_t ctgHandleBatchRsp(SCtgJob* pJob, SCtgTaskCallbackParam* cbParam, SDataBu
|
|||
taskMsg.pData = pRsp->msg;
|
||||
taskMsg.len = pRsp->msgLen;
|
||||
|
||||
tAssert(pRsp->msgIdx == *msgIdx);
|
||||
ASSERT(pRsp->msgIdx == *msgIdx);
|
||||
} else {
|
||||
pRsp = &rsp;
|
||||
pRsp->msgIdx = *msgIdx;
|
||||
|
|
|
@ -40,7 +40,7 @@ static int32_t buildRetrieveTableRsp(SSDataBlock* pBlock, int32_t numOfCols, SRe
|
|||
(*pRsp)->numOfCols = htonl(numOfCols);
|
||||
|
||||
int32_t len = blockEncode(pBlock, (*pRsp)->data, numOfCols);
|
||||
tAssert(len == rspSize - sizeof(SRetrieveTableRsp));
|
||||
ASSERT(len == rspSize - sizeof(SRetrieveTableRsp));
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -1666,7 +1666,7 @@ int32_t qExplainGetRspFromCtx(void *ctx, SRetrieveTableRsp **pRsp) {
|
|||
rsp->numOfRows = htobe64((int64_t)rowNum);
|
||||
|
||||
int32_t len = blockEncode(pBlock, rsp->data, taosArrayGetSize(pBlock->pDataBlock));
|
||||
tAssert(len == rspSize - sizeof(SRetrieveTableRsp));
|
||||
ASSERT(len == rspSize - sizeof(SRetrieveTableRsp));
|
||||
|
||||
rsp->compLen = htonl(len);
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#define T_LONG_JMP(_obj, _c) \
|
||||
do { \
|
||||
tAssert((_c) != -1); \
|
||||
ASSERT((_c) != -1); \
|
||||
longjmp((_obj), (_c)); \
|
||||
} while (0)
|
||||
|
||||
|
|
|
@ -163,7 +163,7 @@ SSDataBlock* doScanCache(SOperatorInfo* pOperator) {
|
|||
int32_t resultRows = pInfo->pBufferredRes->info.rows;
|
||||
|
||||
// the results may be null, if last values are all null
|
||||
tAssert(resultRows == 0 || resultRows == taosArrayGetSize(pInfo->pUidList));
|
||||
ASSERT(resultRows == 0 || resultRows == taosArrayGetSize(pInfo->pUidList));
|
||||
pInfo->indexOfBufferedRes = 0;
|
||||
}
|
||||
|
||||
|
@ -235,7 +235,7 @@ SSDataBlock* doScanCache(SOperatorInfo* pOperator) {
|
|||
pInfo->pRes->info.id.groupId = pKeyInfo->groupId;
|
||||
|
||||
if (taosArrayGetSize(pInfo->pUidList) > 0) {
|
||||
tAssert((pInfo->retrieveType & CACHESCAN_RETRIEVE_LAST_ROW) == CACHESCAN_RETRIEVE_LAST_ROW);
|
||||
ASSERT((pInfo->retrieveType & CACHESCAN_RETRIEVE_LAST_ROW) == CACHESCAN_RETRIEVE_LAST_ROW);
|
||||
|
||||
pInfo->pRes->info.id.uid = *(tb_uid_t*)taosArrayGet(pInfo->pUidList, 0);
|
||||
code = addTagPseudoColumnData(&pInfo->readHandle, pSup->pExprInfo, pSup->numOfExprs, pInfo->pRes, pInfo->pRes->info.rows,
|
||||
|
|
|
@ -62,8 +62,8 @@ static void toDataCacheEntry(SDataDeleterHandle* pHandle, const SInputData* pInp
|
|||
pEntry->numOfCols = taosArrayGetSize(pInput->pData->pDataBlock);
|
||||
pEntry->dataLen = sizeof(SDeleterRes);
|
||||
|
||||
tAssert(1 == pEntry->numOfRows);
|
||||
tAssert(3 == pEntry->numOfCols);
|
||||
ASSERT(1 == pEntry->numOfRows);
|
||||
ASSERT(3 == pEntry->numOfCols);
|
||||
|
||||
pBuf->useSize = sizeof(SDataCacheEntry);
|
||||
|
||||
|
@ -81,7 +81,7 @@ static void toDataCacheEntry(SDataDeleterHandle* pHandle, const SInputData* pInp
|
|||
if (pRes->affectedRows) {
|
||||
pRes->skey = *(int64_t*)pColSKey->pData;
|
||||
pRes->ekey = *(int64_t*)pColEKey->pData;
|
||||
tAssert(pRes->skey <= pRes->ekey);
|
||||
ASSERT(pRes->skey <= pRes->ekey);
|
||||
} else {
|
||||
pRes->skey = pHandle->pDeleter->deleteTimeRange.skey;
|
||||
pRes->ekey = pHandle->pDeleter->deleteTimeRange.ekey;
|
||||
|
@ -167,7 +167,7 @@ static void getDataLength(SDataSinkHandle* pHandle, int64_t* pLen, bool* pQueryE
|
|||
|
||||
SDataDeleterBuf* pBuf = NULL;
|
||||
taosReadQitem(pDeleter->pDataBlocks, (void**)&pBuf);
|
||||
tAssert(NULL != pBuf);
|
||||
ASSERT(NULL != pBuf);
|
||||
memcpy(&pDeleter->nextOutput, pBuf, sizeof(SDataDeleterBuf));
|
||||
taosFreeQitem(pBuf);
|
||||
|
||||
|
|
|
@ -77,8 +77,8 @@ static void toDataCacheEntry(SDataDispatchHandle* pHandle, const SInputData* pIn
|
|||
|
||||
pBuf->useSize = sizeof(SDataCacheEntry);
|
||||
pEntry->dataLen = blockEncode(pInput->pData, pEntry->data, numOfCols);
|
||||
tAssert(pEntry->numOfRows == *(int32_t*)(pEntry->data + 8));
|
||||
tAssert(pEntry->numOfCols == *(int32_t*)(pEntry->data + 8 + 4));
|
||||
ASSERT(pEntry->numOfRows == *(int32_t*)(pEntry->data + 8));
|
||||
ASSERT(pEntry->numOfCols == *(int32_t*)(pEntry->data + 8 + 4));
|
||||
|
||||
pBuf->useSize += pEntry->dataLen;
|
||||
|
||||
|
@ -162,15 +162,15 @@ static void getDataLength(SDataSinkHandle* pHandle, int64_t* pLen, bool* pQueryE
|
|||
|
||||
SDataDispatchBuf* pBuf = NULL;
|
||||
taosReadQitem(pDispatcher->pDataBlocks, (void**)&pBuf);
|
||||
tAssert(NULL != pBuf);
|
||||
ASSERT(NULL != pBuf);
|
||||
memcpy(&pDispatcher->nextOutput, pBuf, sizeof(SDataDispatchBuf));
|
||||
taosFreeQitem(pBuf);
|
||||
|
||||
SDataCacheEntry* pEntry = (SDataCacheEntry*)pDispatcher->nextOutput.pData;
|
||||
*pLen = pEntry->dataLen;
|
||||
|
||||
tAssert(pEntry->numOfRows == *(int32_t*)(pEntry->data + 8));
|
||||
tAssert(pEntry->numOfCols == *(int32_t*)(pEntry->data + 8 + 4));
|
||||
ASSERT(pEntry->numOfRows == *(int32_t*)(pEntry->data + 8));
|
||||
ASSERT(pEntry->numOfCols == *(int32_t*)(pEntry->data + 8 + 4));
|
||||
|
||||
*pQueryEnd = pDispatcher->queryEnd;
|
||||
qDebug("got data len %" PRId64 ", row num %d in sink", *pLen,
|
||||
|
@ -193,8 +193,8 @@ static int32_t getDataBlock(SDataSinkHandle* pHandle, SOutputData* pOutput) {
|
|||
pOutput->numOfCols = pEntry->numOfCols;
|
||||
pOutput->compressed = pEntry->compressed;
|
||||
|
||||
tAssert(pEntry->numOfRows == *(int32_t*)(pEntry->data + 8));
|
||||
tAssert(pEntry->numOfCols == *(int32_t*)(pEntry->data + 8 + 4));
|
||||
ASSERT(pEntry->numOfRows == *(int32_t*)(pEntry->data + 8));
|
||||
ASSERT(pEntry->numOfCols == *(int32_t*)(pEntry->data + 8 + 4));
|
||||
|
||||
atomic_sub_fetch_64(&pDispatcher->cachedSize, pEntry->dataLen);
|
||||
atomic_sub_fetch_64(&gDataSinkStat.cachedSize, pEntry->dataLen);
|
||||
|
|
|
@ -373,7 +373,7 @@ int32_t loadRemoteDataCallback(void* param, SDataBuf* pMsg, int32_t code) {
|
|||
pRsp->useconds = htobe64(pRsp->useconds);
|
||||
pRsp->numOfBlocks = htonl(pRsp->numOfBlocks);
|
||||
|
||||
tAssert(pRsp != NULL);
|
||||
ASSERT(pRsp != NULL);
|
||||
qDebug("%s fetch rsp received, index:%d, blocks:%d, rows:%" PRId64 ", %p", pSourceDataInfo->taskId, index, pRsp->numOfBlocks,
|
||||
pRsp->numOfRows, pExchangeInfo);
|
||||
} else {
|
||||
|
@ -401,7 +401,7 @@ int32_t doSendFetchDataRequest(SExchangeInfo* pExchangeInfo, SExecTaskInfo* pTas
|
|||
SSourceDataInfo* pDataInfo = taosArrayGet(pExchangeInfo->pSourceDataInfo, sourceIndex);
|
||||
pDataInfo->startTime = taosGetTimestampUs();
|
||||
|
||||
tAssert(pDataInfo->status == EX_SOURCE_DATA_NOT_READY);
|
||||
ASSERT(pDataInfo->status == EX_SOURCE_DATA_NOT_READY);
|
||||
|
||||
SFetchRspHandleWrapper* pWrapper = taosMemoryCalloc(1, sizeof(SFetchRspHandleWrapper));
|
||||
pWrapper->exchangeId = pExchangeInfo->self;
|
||||
|
|
|
@ -160,7 +160,7 @@ void initMultiResInfoFromArrayList(SGroupResInfo* pGroupResInfo, SArray* pArrayL
|
|||
|
||||
pGroupResInfo->pRows = pArrayList;
|
||||
pGroupResInfo->index = 0;
|
||||
tAssert(pGroupResInfo->index <= getNumOfTotalRes(pGroupResInfo));
|
||||
ASSERT(pGroupResInfo->index <= getNumOfTotalRes(pGroupResInfo));
|
||||
}
|
||||
|
||||
bool hasRemainResults(SGroupResInfo* pGroupResInfo) {
|
||||
|
@ -314,10 +314,10 @@ int32_t isQualifiedTable(STableKeyInfo* info, SNode* pTagCond, void* metaHandle,
|
|||
return code;
|
||||
}
|
||||
|
||||
tAssert(nodeType(pNew) == QUERY_NODE_VALUE);
|
||||
ASSERT(nodeType(pNew) == QUERY_NODE_VALUE);
|
||||
SValueNode* pValue = (SValueNode*)pNew;
|
||||
|
||||
tAssert(pValue->node.resType.type == TSDB_DATA_TYPE_BOOL);
|
||||
ASSERT(pValue->node.resType.type == TSDB_DATA_TYPE_BOOL);
|
||||
*pQualified = pValue->datum.b;
|
||||
|
||||
nodesDestroyNode(pNew);
|
||||
|
@ -626,7 +626,7 @@ int32_t getColInfoResultForGroupby(void* metaHandle, SNodeList* group, STableLis
|
|||
#endif
|
||||
} else {
|
||||
void* tag = taosHashGet(tags, uid, sizeof(int64_t));
|
||||
tAssert(tag);
|
||||
ASSERT(tag);
|
||||
|
||||
STagVal tagVal = {0};
|
||||
tagVal.cid = pColInfo->info.colId;
|
||||
|
@ -1056,7 +1056,7 @@ int32_t getTableList(void* metaHandle, void* pVnode, SScanPhysiNode* pScanNode,
|
|||
}
|
||||
|
||||
if (!pTagCond) { // no tag condition exists, let's fetch all tables of this super table
|
||||
tAssert(pTagIndexCond == NULL);
|
||||
ASSERT(pTagIndexCond == NULL);
|
||||
vnodeGetCtbIdList(pVnode, pScanNode->suid, res);
|
||||
} else {
|
||||
// failed to find the result in the cache, let try to calculate the results
|
||||
|
@ -1150,7 +1150,7 @@ int32_t getGroupIdFromTagsVal(void* pMeta, uint64_t uid, SNodeList* pGroupNode,
|
|||
return code;
|
||||
}
|
||||
|
||||
tAssert(nodeType(pNew) == QUERY_NODE_VALUE);
|
||||
ASSERT(nodeType(pNew) == QUERY_NODE_VALUE);
|
||||
SValueNode* pValue = (SValueNode*)pNew;
|
||||
|
||||
if (pValue->node.resType.type == TSDB_DATA_TYPE_NULL || pValue->isNull) {
|
||||
|
@ -1364,7 +1364,7 @@ void createExprFromOneNode(SExprInfo* pExp, SNode* pNode, int16_t slotId) {
|
|||
if (!pFuncNode->pParameterList && (memcmp(pExprNode->_function.functionName, name, len) == 0) &&
|
||||
pExprNode->_function.functionName[len] == 0) {
|
||||
pFuncNode->pParameterList = nodesMakeList();
|
||||
tAssert(LIST_LENGTH(pFuncNode->pParameterList) == 0);
|
||||
ASSERT(LIST_LENGTH(pFuncNode->pParameterList) == 0);
|
||||
SValueNode* res = (SValueNode*)nodesMakeNode(QUERY_NODE_VALUE);
|
||||
if (NULL == res) { // todo handle error
|
||||
} else {
|
||||
|
@ -1416,7 +1416,7 @@ void createExprFromOneNode(SExprInfo* pExp, SNode* pNode, int16_t slotId) {
|
|||
createResSchema(pType->type, pType->bytes, slotId, pType->scale, pType->precision, pCaseNode->node.aliasName);
|
||||
pExp->pExpr->_optrRoot.pRootNode = pNode;
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1572,7 +1572,7 @@ void relocateColumnData(SSDataBlock* pBlock, const SArray* pColMatchInfo, SArray
|
|||
} else if (p->info.colId < pmInfo->colId) {
|
||||
i++;
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1758,7 +1758,7 @@ void initLimitInfo(const SNode* pLimit, const SNode* pSLimit, SLimitInfo* pLimit
|
|||
}
|
||||
|
||||
uint64_t tableListGetSize(const STableListInfo* pTableList) {
|
||||
tAssert(taosArrayGetSize(pTableList->pTableList) == taosHashGetSize(pTableList->map));
|
||||
ASSERT(taosArrayGetSize(pTableList->pTableList) == taosHashGetSize(pTableList->map));
|
||||
return taosArrayGetSize(pTableList->pTableList);
|
||||
}
|
||||
|
||||
|
@ -1774,10 +1774,10 @@ STableKeyInfo* tableListGetInfo(const STableListInfo* pTableList, int32_t index)
|
|||
|
||||
uint64_t getTableGroupId(const STableListInfo* pTableList, uint64_t tableUid) {
|
||||
int32_t* slot = taosHashGet(pTableList->map, &tableUid, sizeof(tableUid));
|
||||
tAssert(pTableList->map != NULL && slot != NULL);
|
||||
ASSERT(pTableList->map != NULL && slot != NULL);
|
||||
|
||||
STableKeyInfo* pKeyInfo = taosArrayGet(pTableList->pTableList, *slot);
|
||||
tAssert(pKeyInfo->uid == tableUid);
|
||||
ASSERT(pKeyInfo->uid == tableUid);
|
||||
|
||||
return pKeyInfo->groupId;
|
||||
}
|
||||
|
@ -1785,7 +1785,7 @@ uint64_t getTableGroupId(const STableListInfo* pTableList, uint64_t tableUid) {
|
|||
// TODO handle the group offset info, fix it, the rule of group output will be broken by this function
|
||||
int32_t tableListAddTableInfo(STableListInfo* pTableList, uint64_t uid, uint64_t gid) {
|
||||
if (pTableList->map == NULL) {
|
||||
tAssert(taosArrayGetSize(pTableList->pTableList) == 0);
|
||||
ASSERT(taosArrayGetSize(pTableList->pTableList) == 0);
|
||||
pTableList->map = taosHashInit(32, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_ENTRY_LOCK);
|
||||
}
|
||||
|
||||
|
@ -1933,7 +1933,7 @@ static int32_t sortTableGroup(STableListInfo* pTableListInfo) {
|
|||
int32_t buildGroupIdMapForAllTables(STableListInfo* pTableListInfo, SReadHandle* pHandle, SNodeList* group,
|
||||
bool groupSort) {
|
||||
int32_t code = TSDB_CODE_SUCCESS;
|
||||
tAssert(pTableListInfo->map != NULL);
|
||||
ASSERT(pTableListInfo->map != NULL);
|
||||
|
||||
bool groupByTbname = groupbyTbname(group);
|
||||
size_t numOfTables = taosArrayGetSize(pTableListInfo->pTableList);
|
||||
|
@ -1990,7 +1990,7 @@ int32_t createScanTableListInfo(SScanPhysiNode* pScanNode, SNodeList* pGroupTags
|
|||
}
|
||||
|
||||
int32_t numOfTables = taosArrayGetSize(pTableListInfo->pTableList);
|
||||
tAssert(pTableListInfo->numOfOuputGroups == 1);
|
||||
ASSERT(pTableListInfo->numOfOuputGroups == 1);
|
||||
|
||||
int64_t st1 = taosGetTimestampUs();
|
||||
pTaskInfo->cost.extractListTime = (st1 - st) / 1000.0;
|
||||
|
|
|
@ -31,7 +31,7 @@ static void cleanupRefPool() {
|
|||
}
|
||||
|
||||
static int32_t doSetSMABlock(SOperatorInfo* pOperator, void* input, size_t numOfBlocks, int32_t type, char* id) {
|
||||
tAssert(pOperator != NULL);
|
||||
ASSERT(pOperator != NULL);
|
||||
if (pOperator->operatorType != QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN) {
|
||||
if (pOperator->numOfDownstream == 0) {
|
||||
qError("failed to find stream scan operator to set the input data block, %s" PRIx64, id);
|
||||
|
@ -72,7 +72,7 @@ static int32_t doSetSMABlock(SOperatorInfo* pOperator, void* input, size_t numOf
|
|||
|
||||
static int32_t doSetStreamOpOpen(SOperatorInfo* pOperator, char* id) {
|
||||
{
|
||||
tAssert(pOperator != NULL);
|
||||
ASSERT(pOperator != NULL);
|
||||
if (pOperator->operatorType != QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN) {
|
||||
if (pOperator->numOfDownstream == 0) {
|
||||
qError("failed to find stream scan operator to set the input data block, %s" PRIx64, id);
|
||||
|
@ -91,7 +91,7 @@ static int32_t doSetStreamOpOpen(SOperatorInfo* pOperator, char* id) {
|
|||
}
|
||||
|
||||
static int32_t doSetStreamBlock(SOperatorInfo* pOperator, void* input, size_t numOfBlocks, int32_t type, char* id) {
|
||||
tAssert(pOperator != NULL);
|
||||
ASSERT(pOperator != NULL);
|
||||
if (pOperator->operatorType != QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN) {
|
||||
if (pOperator->numOfDownstream == 0) {
|
||||
qError("failed to find stream scan operator to set the input data block, %s" PRIx64, id);
|
||||
|
@ -109,18 +109,18 @@ static int32_t doSetStreamBlock(SOperatorInfo* pOperator, void* input, size_t nu
|
|||
|
||||
SStreamScanInfo* pInfo = pOperator->info;
|
||||
|
||||
tAssert(pInfo->validBlockIndex == 0);
|
||||
tAssert(taosArrayGetSize(pInfo->pBlockLists) == 0);
|
||||
ASSERT(pInfo->validBlockIndex == 0);
|
||||
ASSERT(taosArrayGetSize(pInfo->pBlockLists) == 0);
|
||||
|
||||
if (type == STREAM_INPUT__MERGED_SUBMIT) {
|
||||
// tAssert(numOfBlocks > 1);
|
||||
// ASSERT(numOfBlocks > 1);
|
||||
for (int32_t i = 0; i < numOfBlocks; i++) {
|
||||
SSubmitReq* pReq = *(void**)POINTER_SHIFT(input, i * sizeof(void*));
|
||||
taosArrayPush(pInfo->pBlockLists, &pReq);
|
||||
}
|
||||
pInfo->blockType = STREAM_INPUT__DATA_SUBMIT;
|
||||
} else if (type == STREAM_INPUT__DATA_SUBMIT) {
|
||||
tAssert(numOfBlocks == 1);
|
||||
ASSERT(numOfBlocks == 1);
|
||||
taosArrayPush(pInfo->pBlockLists, &input);
|
||||
pInfo->blockType = STREAM_INPUT__DATA_SUBMIT;
|
||||
} else if (type == STREAM_INPUT__DATA_BLOCK) {
|
||||
|
@ -130,7 +130,7 @@ static int32_t doSetStreamBlock(SOperatorInfo* pOperator, void* input, size_t nu
|
|||
}
|
||||
pInfo->blockType = STREAM_INPUT__DATA_BLOCK;
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
@ -413,7 +413,7 @@ int32_t qUpdateQualifiedTableId(qTaskInfo_t tinfo, const SArray* tableIdList, bo
|
|||
|
||||
int32_t qGetQueryTableSchemaVersion(qTaskInfo_t tinfo, char* dbName, char* tableName, int32_t* sversion,
|
||||
int32_t* tversion) {
|
||||
tAssert(tinfo != NULL && dbName != NULL && tableName != NULL);
|
||||
ASSERT(tinfo != NULL && dbName != NULL && tableName != NULL);
|
||||
SExecTaskInfo* pTaskInfo = (SExecTaskInfo*)tinfo;
|
||||
|
||||
if (pTaskInfo->schemaInfo.sw == NULL) {
|
||||
|
@ -546,7 +546,7 @@ int32_t qExecTaskOpt(qTaskInfo_t tinfo, SArray* pResList, uint64_t* useconds, bo
|
|||
blockIndex += 1;
|
||||
|
||||
current += p->info.rows;
|
||||
tAssert(p->info.rows > 0);
|
||||
ASSERT(p->info.rows > 0);
|
||||
taosArrayPush(pResList, &p);
|
||||
|
||||
if (current >= 4096) {
|
||||
|
@ -776,7 +776,7 @@ int32_t qExtractStreamScanner(qTaskInfo_t tinfo, void** scanner) {
|
|||
*scanner = pOperator->info;
|
||||
return 0;
|
||||
} else {
|
||||
tAssert(pOperator->numOfDownstream == 1);
|
||||
ASSERT(pOperator->numOfDownstream == 1);
|
||||
pOperator = pOperator->pDownstream[0];
|
||||
}
|
||||
}
|
||||
|
@ -785,7 +785,7 @@ int32_t qExtractStreamScanner(qTaskInfo_t tinfo, void** scanner) {
|
|||
#if 0
|
||||
int32_t qStreamInput(qTaskInfo_t tinfo, void* pItem) {
|
||||
SExecTaskInfo* pTaskInfo = (SExecTaskInfo*)tinfo;
|
||||
tAssert(pTaskInfo->execModel == OPTR_EXEC_MODEL_STREAM);
|
||||
ASSERT(pTaskInfo->execModel == OPTR_EXEC_MODEL_STREAM);
|
||||
taosWriteQitem(pTaskInfo->streamInfo.inputQueue->queue, pItem);
|
||||
return 0;
|
||||
}
|
||||
|
@ -793,7 +793,7 @@ int32_t qStreamInput(qTaskInfo_t tinfo, void* pItem) {
|
|||
|
||||
int32_t qStreamSourceRecoverStep1(qTaskInfo_t tinfo, int64_t ver) {
|
||||
SExecTaskInfo* pTaskInfo = (SExecTaskInfo*)tinfo;
|
||||
tAssert(pTaskInfo->execModel == OPTR_EXEC_MODEL_STREAM);
|
||||
ASSERT(pTaskInfo->execModel == OPTR_EXEC_MODEL_STREAM);
|
||||
pTaskInfo->streamInfo.fillHistoryVer1 = ver;
|
||||
pTaskInfo->streamInfo.recoverStep = STREAM_RECOVER_STEP__PREPARE1;
|
||||
return 0;
|
||||
|
@ -801,7 +801,7 @@ int32_t qStreamSourceRecoverStep1(qTaskInfo_t tinfo, int64_t ver) {
|
|||
|
||||
int32_t qStreamSourceRecoverStep2(qTaskInfo_t tinfo, int64_t ver) {
|
||||
SExecTaskInfo* pTaskInfo = (SExecTaskInfo*)tinfo;
|
||||
tAssert(pTaskInfo->execModel == OPTR_EXEC_MODEL_STREAM);
|
||||
ASSERT(pTaskInfo->execModel == OPTR_EXEC_MODEL_STREAM);
|
||||
pTaskInfo->streamInfo.fillHistoryVer2 = ver;
|
||||
pTaskInfo->streamInfo.recoverStep = STREAM_RECOVER_STEP__PREPARE2;
|
||||
return 0;
|
||||
|
@ -809,7 +809,7 @@ int32_t qStreamSourceRecoverStep2(qTaskInfo_t tinfo, int64_t ver) {
|
|||
|
||||
int32_t qStreamRecoverFinish(qTaskInfo_t tinfo) {
|
||||
SExecTaskInfo* pTaskInfo = (SExecTaskInfo*)tinfo;
|
||||
tAssert(pTaskInfo->execModel == OPTR_EXEC_MODEL_STREAM);
|
||||
ASSERT(pTaskInfo->execModel == OPTR_EXEC_MODEL_STREAM);
|
||||
pTaskInfo->streamInfo.recoverStep = STREAM_RECOVER_STEP__NONE;
|
||||
return 0;
|
||||
}
|
||||
|
@ -823,10 +823,10 @@ int32_t qStreamSetParamForRecover(qTaskInfo_t tinfo) {
|
|||
pOperator->operatorType == QUERY_NODE_PHYSICAL_PLAN_STREAM_SEMI_INTERVAL ||
|
||||
pOperator->operatorType == QUERY_NODE_PHYSICAL_PLAN_STREAM_FINAL_INTERVAL) {
|
||||
SStreamIntervalOperatorInfo* pInfo = pOperator->info;
|
||||
tAssert(pInfo->twAggSup.calTrigger == STREAM_TRIGGER_AT_ONCE ||
|
||||
ASSERT(pInfo->twAggSup.calTrigger == STREAM_TRIGGER_AT_ONCE ||
|
||||
pInfo->twAggSup.calTrigger == STREAM_TRIGGER_WINDOW_CLOSE);
|
||||
tAssert(pInfo->twAggSup.calTriggerSaved == 0);
|
||||
tAssert(pInfo->twAggSup.deleteMarkSaved == 0);
|
||||
ASSERT(pInfo->twAggSup.calTriggerSaved == 0);
|
||||
ASSERT(pInfo->twAggSup.deleteMarkSaved == 0);
|
||||
|
||||
qInfo("save stream param for interval: %d, %" PRId64, pInfo->twAggSup.calTrigger, pInfo->twAggSup.deleteMark);
|
||||
|
||||
|
@ -839,10 +839,10 @@ int32_t qStreamSetParamForRecover(qTaskInfo_t tinfo) {
|
|||
pOperator->operatorType == QUERY_NODE_PHYSICAL_PLAN_STREAM_SEMI_SESSION ||
|
||||
pOperator->operatorType == QUERY_NODE_PHYSICAL_PLAN_STREAM_FINAL_SESSION) {
|
||||
SStreamSessionAggOperatorInfo* pInfo = pOperator->info;
|
||||
tAssert(pInfo->twAggSup.calTrigger == STREAM_TRIGGER_AT_ONCE ||
|
||||
ASSERT(pInfo->twAggSup.calTrigger == STREAM_TRIGGER_AT_ONCE ||
|
||||
pInfo->twAggSup.calTrigger == STREAM_TRIGGER_WINDOW_CLOSE);
|
||||
tAssert(pInfo->twAggSup.calTriggerSaved == 0);
|
||||
tAssert(pInfo->twAggSup.deleteMarkSaved == 0);
|
||||
ASSERT(pInfo->twAggSup.calTriggerSaved == 0);
|
||||
ASSERT(pInfo->twAggSup.deleteMarkSaved == 0);
|
||||
|
||||
qInfo("save stream param for session: %d, %" PRId64, pInfo->twAggSup.calTrigger, pInfo->twAggSup.deleteMark);
|
||||
|
||||
|
@ -852,10 +852,10 @@ int32_t qStreamSetParamForRecover(qTaskInfo_t tinfo) {
|
|||
pInfo->twAggSup.deleteMark = INT64_MAX;
|
||||
} else if (pOperator->operatorType == QUERY_NODE_PHYSICAL_PLAN_STREAM_STATE) {
|
||||
SStreamStateAggOperatorInfo* pInfo = pOperator->info;
|
||||
tAssert(pInfo->twAggSup.calTrigger == STREAM_TRIGGER_AT_ONCE ||
|
||||
ASSERT(pInfo->twAggSup.calTrigger == STREAM_TRIGGER_AT_ONCE ||
|
||||
pInfo->twAggSup.calTrigger == STREAM_TRIGGER_WINDOW_CLOSE);
|
||||
tAssert(pInfo->twAggSup.calTriggerSaved == 0);
|
||||
tAssert(pInfo->twAggSup.deleteMarkSaved == 0);
|
||||
ASSERT(pInfo->twAggSup.calTriggerSaved == 0);
|
||||
ASSERT(pInfo->twAggSup.deleteMarkSaved == 0);
|
||||
|
||||
qInfo("save stream param for state: %d, %" PRId64, pInfo->twAggSup.calTrigger, pInfo->twAggSup.deleteMark);
|
||||
|
||||
|
@ -869,7 +869,7 @@ int32_t qStreamSetParamForRecover(qTaskInfo_t tinfo) {
|
|||
if (pOperator->numOfDownstream != 1 || pOperator->pDownstream[0] == NULL) {
|
||||
if (pOperator->numOfDownstream > 1) {
|
||||
qError("unexpected stream, multiple downstream");
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
|
@ -890,34 +890,34 @@ int32_t qStreamRestoreParam(qTaskInfo_t tinfo) {
|
|||
pOperator->operatorType == QUERY_NODE_PHYSICAL_PLAN_STREAM_SEMI_INTERVAL ||
|
||||
pOperator->operatorType == QUERY_NODE_PHYSICAL_PLAN_STREAM_FINAL_INTERVAL) {
|
||||
SStreamIntervalOperatorInfo* pInfo = pOperator->info;
|
||||
tAssert(pInfo->twAggSup.calTrigger == STREAM_TRIGGER_AT_ONCE);
|
||||
tAssert(pInfo->twAggSup.deleteMark == INT64_MAX);
|
||||
ASSERT(pInfo->twAggSup.calTrigger == STREAM_TRIGGER_AT_ONCE);
|
||||
ASSERT(pInfo->twAggSup.deleteMark == INT64_MAX);
|
||||
|
||||
pInfo->twAggSup.calTrigger = pInfo->twAggSup.calTriggerSaved;
|
||||
pInfo->twAggSup.deleteMark = pInfo->twAggSup.deleteMarkSaved;
|
||||
tAssert(pInfo->twAggSup.calTrigger == STREAM_TRIGGER_AT_ONCE ||
|
||||
ASSERT(pInfo->twAggSup.calTrigger == STREAM_TRIGGER_AT_ONCE ||
|
||||
pInfo->twAggSup.calTrigger == STREAM_TRIGGER_WINDOW_CLOSE);
|
||||
qInfo("restore stream param for interval: %d, %" PRId64, pInfo->twAggSup.calTrigger, pInfo->twAggSup.deleteMark);
|
||||
} else if (pOperator->operatorType == QUERY_NODE_PHYSICAL_PLAN_STREAM_SESSION ||
|
||||
pOperator->operatorType == QUERY_NODE_PHYSICAL_PLAN_STREAM_SEMI_SESSION ||
|
||||
pOperator->operatorType == QUERY_NODE_PHYSICAL_PLAN_STREAM_FINAL_SESSION) {
|
||||
SStreamSessionAggOperatorInfo* pInfo = pOperator->info;
|
||||
tAssert(pInfo->twAggSup.calTrigger == STREAM_TRIGGER_AT_ONCE);
|
||||
tAssert(pInfo->twAggSup.deleteMark == INT64_MAX);
|
||||
ASSERT(pInfo->twAggSup.calTrigger == STREAM_TRIGGER_AT_ONCE);
|
||||
ASSERT(pInfo->twAggSup.deleteMark == INT64_MAX);
|
||||
|
||||
pInfo->twAggSup.calTrigger = pInfo->twAggSup.calTriggerSaved;
|
||||
pInfo->twAggSup.deleteMark = pInfo->twAggSup.deleteMarkSaved;
|
||||
tAssert(pInfo->twAggSup.calTrigger == STREAM_TRIGGER_AT_ONCE ||
|
||||
ASSERT(pInfo->twAggSup.calTrigger == STREAM_TRIGGER_AT_ONCE ||
|
||||
pInfo->twAggSup.calTrigger == STREAM_TRIGGER_WINDOW_CLOSE);
|
||||
qInfo("restore stream param for session: %d, %" PRId64, pInfo->twAggSup.calTrigger, pInfo->twAggSup.deleteMark);
|
||||
} else if (pOperator->operatorType == QUERY_NODE_PHYSICAL_PLAN_STREAM_STATE) {
|
||||
SStreamStateAggOperatorInfo* pInfo = pOperator->info;
|
||||
tAssert(pInfo->twAggSup.calTrigger == STREAM_TRIGGER_AT_ONCE);
|
||||
tAssert(pInfo->twAggSup.deleteMark == INT64_MAX);
|
||||
ASSERT(pInfo->twAggSup.calTrigger == STREAM_TRIGGER_AT_ONCE);
|
||||
ASSERT(pInfo->twAggSup.deleteMark == INT64_MAX);
|
||||
|
||||
pInfo->twAggSup.calTrigger = pInfo->twAggSup.calTriggerSaved;
|
||||
pInfo->twAggSup.deleteMark = pInfo->twAggSup.deleteMarkSaved;
|
||||
tAssert(pInfo->twAggSup.calTrigger == STREAM_TRIGGER_AT_ONCE ||
|
||||
ASSERT(pInfo->twAggSup.calTrigger == STREAM_TRIGGER_AT_ONCE ||
|
||||
pInfo->twAggSup.calTrigger == STREAM_TRIGGER_WINDOW_CLOSE);
|
||||
qInfo("restore stream param for state: %d, %" PRId64, pInfo->twAggSup.calTrigger, pInfo->twAggSup.deleteMark);
|
||||
}
|
||||
|
@ -926,7 +926,7 @@ int32_t qStreamRestoreParam(qTaskInfo_t tinfo) {
|
|||
if (pOperator->numOfDownstream != 1 || pOperator->pDownstream[0] == NULL) {
|
||||
if (pOperator->numOfDownstream > 1) {
|
||||
qError("unexpected stream, multiple downstream");
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
|
@ -954,19 +954,19 @@ const char* qExtractTbnameFromTask(qTaskInfo_t tinfo) {
|
|||
|
||||
SMqMetaRsp* qStreamExtractMetaMsg(qTaskInfo_t tinfo) {
|
||||
SExecTaskInfo* pTaskInfo = (SExecTaskInfo*)tinfo;
|
||||
tAssert(pTaskInfo->execModel == OPTR_EXEC_MODEL_QUEUE);
|
||||
ASSERT(pTaskInfo->execModel == OPTR_EXEC_MODEL_QUEUE);
|
||||
return &pTaskInfo->streamInfo.metaRsp;
|
||||
}
|
||||
|
||||
int64_t qStreamExtractPrepareUid(qTaskInfo_t tinfo) {
|
||||
SExecTaskInfo* pTaskInfo = (SExecTaskInfo*)tinfo;
|
||||
tAssert(pTaskInfo->execModel == OPTR_EXEC_MODEL_QUEUE);
|
||||
ASSERT(pTaskInfo->execModel == OPTR_EXEC_MODEL_QUEUE);
|
||||
return pTaskInfo->streamInfo.prepareStatus.uid;
|
||||
}
|
||||
|
||||
int32_t qStreamExtractOffset(qTaskInfo_t tinfo, STqOffsetVal* pOffset) {
|
||||
SExecTaskInfo* pTaskInfo = (SExecTaskInfo*)tinfo;
|
||||
tAssert(pTaskInfo->execModel == OPTR_EXEC_MODEL_QUEUE);
|
||||
ASSERT(pTaskInfo->execModel == OPTR_EXEC_MODEL_QUEUE);
|
||||
memcpy(pOffset, &pTaskInfo->streamInfo.lastStatus, sizeof(STqOffsetVal));
|
||||
return 0;
|
||||
}
|
||||
|
@ -1004,8 +1004,8 @@ int32_t initQueryTableDataCondForTmq(SQueryTableDataCond* pCond, SSnapContext* s
|
|||
|
||||
int32_t qStreamScanMemData(qTaskInfo_t tinfo, const SSubmitReq* pReq) {
|
||||
SExecTaskInfo* pTaskInfo = (SExecTaskInfo*)tinfo;
|
||||
tAssert(pTaskInfo->execModel == OPTR_EXEC_MODEL_QUEUE);
|
||||
tAssert(pTaskInfo->streamInfo.pReq == NULL);
|
||||
ASSERT(pTaskInfo->execModel == OPTR_EXEC_MODEL_QUEUE);
|
||||
ASSERT(pTaskInfo->streamInfo.pReq == NULL);
|
||||
pTaskInfo->streamInfo.pReq = pReq;
|
||||
return 0;
|
||||
}
|
||||
|
@ -1013,7 +1013,7 @@ int32_t qStreamScanMemData(qTaskInfo_t tinfo, const SSubmitReq* pReq) {
|
|||
int32_t qStreamPrepareScan(qTaskInfo_t tinfo, STqOffsetVal* pOffset, int8_t subType) {
|
||||
SExecTaskInfo* pTaskInfo = (SExecTaskInfo*)tinfo;
|
||||
SOperatorInfo* pOperator = pTaskInfo->pRoot;
|
||||
tAssert(pTaskInfo->execModel == OPTR_EXEC_MODEL_QUEUE);
|
||||
ASSERT(pTaskInfo->execModel == OPTR_EXEC_MODEL_QUEUE);
|
||||
pTaskInfo->streamInfo.prepareStatus = *pOffset;
|
||||
pTaskInfo->streamInfo.returned = 0;
|
||||
if (tOffsetEqual(pOffset, &pTaskInfo->streamInfo.lastStatus)) {
|
||||
|
@ -1024,7 +1024,7 @@ int32_t qStreamPrepareScan(qTaskInfo_t tinfo, STqOffsetVal* pOffset, int8_t subT
|
|||
pOperator->status = OP_OPENED;
|
||||
// TODO add more check
|
||||
if (type != QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN) {
|
||||
tAssert(pOperator->numOfDownstream == 1);
|
||||
ASSERT(pOperator->numOfDownstream == 1);
|
||||
pOperator = pOperator->pDownstream[0];
|
||||
}
|
||||
|
||||
|
@ -1038,13 +1038,13 @@ int32_t qStreamPrepareScan(qTaskInfo_t tinfo, STqOffsetVal* pOffset, int8_t subT
|
|||
pInfo->tqReader->pWalReader->curVersion != pOffset->version) {
|
||||
qError("prepare scan ver %" PRId64 " actual ver %" PRId64 ", last %" PRId64, pOffset->version,
|
||||
pInfo->tqReader->pWalReader->curVersion, pTaskInfo->streamInfo.lastStatus.version);
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
#endif
|
||||
if (tqSeekVer(pInfo->tqReader, pOffset->version + 1) < 0) {
|
||||
return -1;
|
||||
}
|
||||
tAssert(pInfo->tqReader->pWalReader->curVersion == pOffset->version + 1);
|
||||
ASSERT(pInfo->tqReader->pWalReader->curVersion == pOffset->version + 1);
|
||||
} else if (pOffset->type == TMQ_OFFSET__SNAPSHOT_DATA) {
|
||||
/*pInfo->blockType = STREAM_INPUT__TABLE_SCAN;*/
|
||||
int64_t uid = pOffset->uid;
|
||||
|
@ -1082,7 +1082,7 @@ int32_t qStreamPrepareScan(qTaskInfo_t tinfo, STqOffsetVal* pOffset, int8_t subT
|
|||
}
|
||||
|
||||
// TODO after dropping table, table may not found
|
||||
tAssert(found);
|
||||
ASSERT(found);
|
||||
|
||||
if (pTableScanInfo->base.dataReader == NULL) {
|
||||
STableKeyInfo* pList = tableListGetInfo(pTaskInfo->pTableInfoList, 0);
|
||||
|
@ -1091,7 +1091,7 @@ int32_t qStreamPrepareScan(qTaskInfo_t tinfo, STqOffsetVal* pOffset, int8_t subT
|
|||
if (tsdbReaderOpen(pTableScanInfo->base.readHandle.vnode, &pTableScanInfo->base.cond, pList, num,
|
||||
pTableScanInfo->pResBlock, &pTableScanInfo->base.dataReader, NULL) < 0 ||
|
||||
pTableScanInfo->base.dataReader == NULL) {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1107,7 +1107,7 @@ int32_t qStreamPrepareScan(qTaskInfo_t tinfo, STqOffsetVal* pOffset, int8_t subT
|
|||
ts, pTableScanInfo->currentTable, numOfTables);
|
||||
/*}*/
|
||||
} else {
|
||||
tAssert(0);
|
||||
ASSERT(0);
|
||||
}
|
||||
} else if (pOffset->type == TMQ_OFFSET__SNAPSHOT_DATA) {
|
||||
SStreamRawScanInfo* pInfo = pOperator->info;
|
||||
|
@ -1139,7 +1139,7 @@ int32_t qStreamPrepareScan(qTaskInfo_t tinfo, STqOffsetVal* pOffset, int8_t subT
|
|||
|
||||
STableKeyInfo* pList = tableListGetInfo(pTaskInfo->pTableInfoList, 0);
|
||||
int32_t size = tableListGetSize(pTaskInfo->pTableInfoList);
|
||||
tAssert(size == 1);
|
||||
ASSERT(size == 1);
|
||||
|
||||
tsdbReaderOpen(pInfo->vnode, &pTaskInfo->streamInfo.tableCond, pList, size, NULL, &pInfo->dataReader, NULL);
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue