refact: replcase ASSERT with tAssert
This commit is contained in:
parent
9b793fd1e6
commit
f69a188f7e
|
@ -62,7 +62,7 @@ typedef int32_t TdUcs4;
|
||||||
int32_t taosUcs4len(TdUcs4 *ucs4);
|
int32_t taosUcs4len(TdUcs4 *ucs4);
|
||||||
int64_t taosStr2int64(const char *str);
|
int64_t taosStr2int64(const char *str);
|
||||||
|
|
||||||
void taosConvInit(void);
|
int32_t taosConvInit();
|
||||||
void taosConvDestroy();
|
void taosConvDestroy();
|
||||||
int32_t taosUcs4ToMbs(TdUcs4 *ucs4, int32_t ucs4_max_len, char *mbs);
|
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);
|
bool taosMbsToUcs4(const char *mbs, size_t mbs_len, TdUcs4 *ucs4, int32_t ucs4_max_len, int32_t *len);
|
||||||
|
|
|
@ -84,7 +84,8 @@ void taosPrintLongString(const char *flags, ELogLevel level, int32_t dflag, cons
|
||||||
;
|
;
|
||||||
|
|
||||||
bool taosAssertLog(bool condition, const char *file, int32_t line, const char *format, ...);
|
bool taosAssertLog(bool condition, const char *file, int32_t line, const char *format, ...);
|
||||||
#define tAssert(condition, ...) taosAssertLog(condition, __FILE__, __LINE__, __VA_ARGS__)
|
#define tAssertS(condition, ...) taosAssertLog(condition, __FILE__, __LINE__, __VA_ARGS__)
|
||||||
|
#define tAssert(condition) tAssertS(condition, "assert info not provided")
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
#define uFatal(...) { if (uDebugFlag & DEBUG_FATAL) { taosPrintLog("UTL FATAL", DEBUG_FATAL, tsLogEmbedded ? 255 : uDebugFlag, __VA_ARGS__); }}
|
#define uFatal(...) { if (uDebugFlag & DEBUG_FATAL) { taosPrintLog("UTL FATAL", DEBUG_FATAL, tsLogEmbedded ? 255 : uDebugFlag, __VA_ARGS__); }}
|
||||||
|
|
|
@ -407,7 +407,9 @@ void taos_init_imp(void) {
|
||||||
|
|
||||||
initQueryModuleMsgHandle();
|
initQueryModuleMsgHandle();
|
||||||
|
|
||||||
taosConvInit();
|
if (taosConvInit() != 0) {
|
||||||
|
tAssertS(0, "failed to init conv");
|
||||||
|
}
|
||||||
|
|
||||||
rpcInit();
|
rpcInit();
|
||||||
|
|
||||||
|
|
|
@ -1679,7 +1679,7 @@ static int32_t estimateJsonLen(SReqResultInfo* pResultInfo, int32_t numOfCols, i
|
||||||
} else if (jsonInnerType == TSDB_DATA_TYPE_BOOL) {
|
} else if (jsonInnerType == TSDB_DATA_TYPE_BOOL) {
|
||||||
len += (VARSTR_HEADER_SIZE + 5);
|
len += (VARSTR_HEADER_SIZE + 5);
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (IS_VAR_DATA_TYPE(pResultInfo->fields[i].type)) {
|
} else if (IS_VAR_DATA_TYPE(pResultInfo->fields[i].type)) {
|
||||||
|
@ -1785,7 +1785,7 @@ static int32_t doConvertJson(SReqResultInfo* pResultInfo, int32_t numOfCols, int
|
||||||
sprintf(varDataVal(dst), "%s", (*((char*)jsonInnerData) == 1) ? "true" : "false");
|
sprintf(varDataVal(dst), "%s", (*((char*)jsonInnerData) == 1) ? "true" : "false");
|
||||||
varDataSetLen(dst, strlen(varDataVal(dst)));
|
varDataSetLen(dst, strlen(varDataVal(dst)));
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
offset1[j] = len;
|
offset1[j] = len;
|
||||||
|
@ -1879,7 +1879,7 @@ int32_t setResultDataPtr(SReqResultInfo* pResultInfo, TAOS_FIELD* pFields, int32
|
||||||
colLength[i] = htonl(colLength[i]);
|
colLength[i] = htonl(colLength[i]);
|
||||||
if (colLength[i] >= dataLen) {
|
if (colLength[i] >= dataLen) {
|
||||||
tscError("invalid colLength %d, dataLen %d", colLength[i], dataLen);
|
tscError("invalid colLength %d, dataLen %d", colLength[i], dataLen);
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IS_VAR_DATA_TYPE(pResultInfo->fields[i].type)) {
|
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;
|
(*numOfRows) = pResultInfo->numOfRows;
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -785,7 +785,7 @@ static int64_t smlGetTimeValue(const char *value, int32_t len, int8_t type) {
|
||||||
case TSDB_TIME_PRECISION_NANO:
|
case TSDB_TIME_PRECISION_NANO:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
if (ts >= (double)INT64_MAX || ts < 0) {
|
if (ts >= (double)INT64_MAX || ts < 0) {
|
||||||
return -1;
|
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) {
|
} else if (info->protocol == TSDB_SML_TELNET_PROTOCOL) {
|
||||||
ts = smlParseOpenTsdbTime(info, data, len);
|
ts = smlParseOpenTsdbTime(info, data, len);
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
uDebug("SML:0x%" PRIx64 " smlParseTS:%" PRId64, info->id, ts);
|
uDebug("SML:0x%" PRIx64 " smlParseTS:%" PRId64, info->id, ts);
|
||||||
|
|
||||||
|
@ -2206,7 +2206,7 @@ static int32_t smlParseTelnetLine(SSmlHandle *info, void *data, const int len) {
|
||||||
} else if (info->protocol == TSDB_SML_JSON_PROTOCOL) {
|
} else if (info->protocol == TSDB_SML_JSON_PROTOCOL) {
|
||||||
ret = smlParseJSONString(info, (cJSON *)data, tinfo, cols);
|
ret = smlParseJSONString(info, (cJSON *)data, tinfo, cols);
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
if (ret != TSDB_CODE_SUCCESS) {
|
if (ret != TSDB_CODE_SUCCESS) {
|
||||||
uError("SML:0x%" PRIx64 " smlParseTelnetLine failed", info->id);
|
uError("SML:0x%" PRIx64 " smlParseTelnetLine failed", info->id);
|
||||||
|
@ -2421,7 +2421,7 @@ static int32_t smlParseLine(SSmlHandle *info, char *lines[], char *rawLine, char
|
||||||
} else if (info->protocol == TSDB_SML_TELNET_PROTOCOL) {
|
} else if (info->protocol == TSDB_SML_TELNET_PROTOCOL) {
|
||||||
code = smlParseTelnetLine(info, tmp, len);
|
code = smlParseTelnetLine(info, tmp, len);
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
if (code != TSDB_CODE_SUCCESS) {
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
uError("SML:0x%" PRIx64 " smlParseLine failed. line %d : %s", info->id, i, tmp);
|
uError("SML:0x%" PRIx64 " smlParseLine failed. line %d : %s", info->id, i, tmp);
|
||||||
|
|
|
@ -806,7 +806,7 @@ int32_t tmqHandleAllDelayedTask(tmq_t* tmq) {
|
||||||
taosTmrReset(tmqAssignDelayedCommitTask, tmq->autoCommitInterval, pRefId, tmqMgmt.timer, &tmq->commitTimer);
|
taosTmrReset(tmqAssignDelayedCommitTask, tmq->autoCommitInterval, pRefId, tmqMgmt.timer, &tmq->commitTimer);
|
||||||
} else if (*pTaskType == TMQ_DELAYED_TASK__REPORT) {
|
} else if (*pTaskType == TMQ_DELAYED_TASK__REPORT) {
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
taosFreeQitem(pTaskType);
|
taosFreeQitem(pTaskType);
|
||||||
}
|
}
|
||||||
|
@ -1209,7 +1209,7 @@ int32_t tmqPollCb(void* param, SDataBuf* pMsg, int32_t code) {
|
||||||
tDecoderClear(&decoder);
|
tDecoderClear(&decoder);
|
||||||
memcpy(&pRspWrapper->taosxRsp, pMsg->pData, sizeof(SMqRspHead));
|
memcpy(&pRspWrapper->taosxRsp, pMsg->pData, sizeof(SMqRspHead));
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
taosMemoryFree(pMsg->pData);
|
taosMemoryFree(pMsg->pData);
|
||||||
|
|
|
@ -59,7 +59,7 @@ int32_t getJsonValueLen(const char* data) {
|
||||||
} else if (tTagIsJson(data)) { // json string
|
} else if (tTagIsJson(data)) { // json string
|
||||||
dataLen = ((STag*)(data))->len;
|
dataLen = ((STag*)(data))->len;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
return dataLen;
|
return dataLen;
|
||||||
}
|
}
|
||||||
|
@ -2137,7 +2137,7 @@ int32_t buildSubmitReqFromDataBlock(SSubmitReq** pReq, const SSDataBlock* pDataB
|
||||||
case TSDB_DATA_TYPE_JSON:
|
case TSDB_DATA_TYPE_JSON:
|
||||||
case TSDB_DATA_TYPE_MEDIUMBLOB:
|
case TSDB_DATA_TYPE_MEDIUMBLOB:
|
||||||
uError("the column type %" PRIi16 " is defined but not implemented yet", pColInfoData->info.type);
|
uError("the column type %" PRIi16 " is defined but not implemented yet", pColInfoData->info.type);
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (pColInfoData->info.type < TSDB_DATA_TYPE_MAX && pColInfoData->info.type > TSDB_DATA_TYPE_NULL) {
|
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 {
|
} else {
|
||||||
uError("the column type %" PRIi16 " is undefined\n", pColInfoData->info.type);
|
uError("the column type %" PRIi16 " is undefined\n", pColInfoData->info.type);
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,7 +89,7 @@ typedef struct {
|
||||||
SET_BIT2(PB, IDX, VAL); \
|
SET_BIT2(PB, IDX, VAL); \
|
||||||
break; \
|
break; \
|
||||||
default: \
|
default: \
|
||||||
ASSERT(0); \
|
tAssert(0); \
|
||||||
break; \
|
break; \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
|
@ -135,7 +135,7 @@ int32_t tRowBuild(SArray *aColVal, STSchema *pTSchema, SBuffer *pBuffer) {
|
||||||
nkv += tPutI16v(NULL, -pTColumn->colId);
|
nkv += tPutI16v(NULL, -pTColumn->colId);
|
||||||
nIdx++;
|
nIdx++;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
pTColumn = (++iTColumn < pTSchema->numOfCols) ? pTSchema->columns + iTColumn : NULL;
|
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;
|
ntp = sizeof(SRow) + BIT2_SIZE(pTSchema->numOfCols - 1) + ntp;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (maxIdx <= UINT8_MAX) {
|
if (maxIdx <= UINT8_MAX) {
|
||||||
|
@ -302,7 +302,7 @@ int32_t tRowBuild(SArray *aColVal, STSchema *pTSchema, SBuffer *pBuffer) {
|
||||||
pv = pf + pTSchema->flen;
|
pv = pf + pTSchema->flen;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -559,7 +559,7 @@ int32_t tRowIterOpen(SRow *pRow, STSchema *pTSchema, SRowIter **ppIter) {
|
||||||
pIter->pv = pIter->pf + pTSchema->flen;
|
pIter->pv = pIter->pf + pTSchema->flen;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -649,7 +649,7 @@ SColVal *tRowIterNext(SRowIter *pIter) {
|
||||||
pIter->cv = COL_VAL_NONE(pTColumn->colId, pTColumn->type);
|
pIter->cv = COL_VAL_NONE(pTColumn->colId, pTColumn->type);
|
||||||
goto _exit;
|
goto _exit;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
pIter->cv = COL_VAL_NONE(pTColumn->colId, pTColumn->type);
|
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);
|
bv = GET_BIT2(pIter->pb, pIter->iTColumn - 1);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
break;
|
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);
|
printf("%s:%d type:%d vlen:%d, val:%" PRIi8 "\n", tag, ln, (int32_t)type, vlen, *(int8_t *)val);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1581,7 +1581,7 @@ static FORCE_INLINE void tColDataGetValue3(SColData *pColData, int32_t iVal, SCo
|
||||||
*pColVal = COL_VAL_NULL(pColData->cid, pColData->type);
|
*pColVal = COL_VAL_NULL(pColData->cid, pColData->type);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
static FORCE_INLINE void tColDataGetValue4(SColData *pColData, int32_t iVal, SColVal *pColVal) { // HAS_VALUE
|
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);
|
tColDataGetValue4(pColData, iVal, pColVal);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
static FORCE_INLINE void tColDataGetValue6(SColData *pColData, int32_t iVal,
|
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);
|
tColDataGetValue4(pColData, iVal, pColVal);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
static FORCE_INLINE void tColDataGetValue7(SColData *pColData, int32_t iVal,
|
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);
|
tColDataGetValue4(pColData, iVal, pColVal);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
static void (*tColDataGetValueImpl[])(SColData *pColData, int32_t iVal, SColVal *pColVal) = {
|
static void (*tColDataGetValueImpl[])(SColData *pColData, int32_t iVal, SColVal *pColVal) = {
|
||||||
|
@ -1681,7 +1681,7 @@ uint8_t tColDataGetBitValue(const SColData *pColData, int32_t iVal) {
|
||||||
v = GET_BIT2(pColData->pBitMap, iVal);
|
v = GET_BIT2(pColData->pBitMap, iVal);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return v;
|
return v;
|
||||||
|
@ -1759,7 +1759,7 @@ static FORCE_INLINE void tColDataCalcSMABool(SColData *pColData, int64_t *sum, i
|
||||||
CALC_SUM_MAX_MIN(*sum, *max, *min, val);
|
CALC_SUM_MAX_MIN(*sum, *max, *min, val);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1791,7 +1791,7 @@ static FORCE_INLINE void tColDataCalcSMATinyInt(SColData *pColData, int64_t *sum
|
||||||
CALC_SUM_MAX_MIN(*sum, *max, *min, val);
|
CALC_SUM_MAX_MIN(*sum, *max, *min, val);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1823,7 +1823,7 @@ static FORCE_INLINE void tColDataCalcSMATinySmallInt(SColData *pColData, int64_t
|
||||||
CALC_SUM_MAX_MIN(*sum, *max, *min, val);
|
CALC_SUM_MAX_MIN(*sum, *max, *min, val);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1855,7 +1855,7 @@ static FORCE_INLINE void tColDataCalcSMAInt(SColData *pColData, int64_t *sum, in
|
||||||
CALC_SUM_MAX_MIN(*sum, *max, *min, val);
|
CALC_SUM_MAX_MIN(*sum, *max, *min, val);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1887,7 +1887,7 @@ static FORCE_INLINE void tColDataCalcSMABigInt(SColData *pColData, int64_t *sum,
|
||||||
CALC_SUM_MAX_MIN(*sum, *max, *min, val);
|
CALC_SUM_MAX_MIN(*sum, *max, *min, val);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
break;
|
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);
|
CALC_SUM_MAX_MIN(*(double *)sum, *(double *)max, *(double *)min, val);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
break;
|
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);
|
CALC_SUM_MAX_MIN(*(double *)sum, *(double *)max, *(double *)min, val);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
break;
|
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);
|
CALC_SUM_MAX_MIN(*(uint64_t *)sum, *(uint64_t *)max, *(uint64_t *)min, val);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
break;
|
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);
|
CALC_SUM_MAX_MIN(*(uint64_t *)sum, *(uint64_t *)max, *(uint64_t *)min, val);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
break;
|
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);
|
CALC_SUM_MAX_MIN(*(uint64_t *)sum, *(uint64_t *)max, *(uint64_t *)min, val);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
break;
|
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);
|
CALC_SUM_MAX_MIN(*(uint64_t *)sum, *(uint64_t *)max, *(uint64_t *)min, val);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,8 @@
|
||||||
#undef TD_MSG_SEG_CODE_
|
#undef TD_MSG_SEG_CODE_
|
||||||
#include "tmsgdef.h"
|
#include "tmsgdef.h"
|
||||||
|
|
||||||
|
#include "tlog.h"
|
||||||
|
|
||||||
int32_t tInitSubmitMsgIter(const SSubmitReq *pMsg, SSubmitMsgIter *pIter) {
|
int32_t tInitSubmitMsgIter(const SSubmitReq *pMsg, SSubmitMsgIter *pIter) {
|
||||||
if (pMsg == NULL) {
|
if (pMsg == NULL) {
|
||||||
terrno = TSDB_CODE_TDB_SUBMIT_MSG_MSSED_UP;
|
terrno = TSDB_CODE_TDB_SUBMIT_MSG_MSSED_UP;
|
||||||
|
@ -54,7 +56,7 @@ int32_t tGetSubmitMsgNext(SSubmitMsgIter *pIter, SSubmitBlk **pPBlock) {
|
||||||
pIter->len += sizeof(SSubmitReq);
|
pIter->len += sizeof(SSubmitReq);
|
||||||
} else {
|
} else {
|
||||||
if (pIter->len >= pIter->totalLen) {
|
if (pIter->len >= pIter->totalLen) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
pIter->len += (sizeof(SSubmitBlk) + pIter->dataLen + pIter->schemaLen);
|
pIter->len += (sizeof(SSubmitBlk) + pIter->dataLen + pIter->schemaLen);
|
||||||
|
@ -5677,7 +5679,7 @@ int tEncodeSVCreateTbReq(SEncoder *pCoder, const SVCreateTbReq *pReq) {
|
||||||
} else if (pReq->type == TSDB_NORMAL_TABLE) {
|
} else if (pReq->type == TSDB_NORMAL_TABLE) {
|
||||||
if (tEncodeSSchemaWrapper(pCoder, &pReq->ntb.schemaRow) < 0) return -1;
|
if (tEncodeSSchemaWrapper(pCoder, &pReq->ntb.schemaRow) < 0) return -1;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
tEndEncode(pCoder);
|
tEndEncode(pCoder);
|
||||||
|
@ -5719,7 +5721,7 @@ int tDecodeSVCreateTbReq(SDecoder *pCoder, SVCreateTbReq *pReq) {
|
||||||
} else if (pReq->type == TSDB_NORMAL_TABLE) {
|
} else if (pReq->type == TSDB_NORMAL_TABLE) {
|
||||||
if (tDecodeSSchemaWrapperEx(pCoder, &pReq->ntb.schemaRow) < 0) return -1;
|
if (tDecodeSSchemaWrapperEx(pCoder, &pReq->ntb.schemaRow) < 0) return -1;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
tEndDecode(pCoder);
|
tEndDecode(pCoder);
|
||||||
|
@ -6347,7 +6349,7 @@ int32_t tEncodeSTqOffsetVal(SEncoder *pEncoder, const STqOffsetVal *pOffsetVal)
|
||||||
} else if (pOffsetVal->type < 0) {
|
} else if (pOffsetVal->type < 0) {
|
||||||
// do nothing
|
// do nothing
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -6362,7 +6364,7 @@ int32_t tDecodeSTqOffsetVal(SDecoder *pDecoder, STqOffsetVal *pOffsetVal) {
|
||||||
} else if (pOffsetVal->type < 0) {
|
} else if (pOffsetVal->type < 0) {
|
||||||
// do nothing
|
// do nothing
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -6379,7 +6381,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) {
|
} 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);
|
snprintf(buf, maxLen, "offset(ss data) uid:%" PRId64 ", ts:%" PRId64, pVal->uid, pVal->ts);
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -6393,7 +6395,7 @@ bool tOffsetEqual(const STqOffsetVal *pLeft, const STqOffsetVal *pRight) {
|
||||||
} else if (pLeft->type == TMQ_OFFSET__SNAPSHOT_META) {
|
} else if (pLeft->type == TMQ_OFFSET__SNAPSHOT_META) {
|
||||||
return pLeft->uid == pRight->uid;
|
return pLeft->uid == pRight->uid;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
/*ASSERT(pLeft->type == TMQ_OFFSET__RESET_NONE || pLeft->type == TMQ_OFFSET__RESET_EARLIEAST ||*/
|
/*ASSERT(pLeft->type == TMQ_OFFSET__RESET_NONE || pLeft->type == TMQ_OFFSET__RESET_EARLIEAST ||*/
|
||||||
/*pLeft->type == TMQ_OFFSET__RESET_LATEST);*/
|
/*pLeft->type == TMQ_OFFSET__RESET_LATEST);*/
|
||||||
/*return true;*/
|
/*return true;*/
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
|
|
||||||
#define _DEFAULT_SOURCE
|
#define _DEFAULT_SOURCE
|
||||||
#include "trow.h"
|
#include "trow.h"
|
||||||
|
#include "tlog.h"
|
||||||
|
|
||||||
const uint8_t tdVTypeByte[2][3] = {{
|
const uint8_t tdVTypeByte[2][3] = {{
|
||||||
// 2 bits
|
// 2 bits
|
||||||
|
@ -75,7 +76,7 @@ void tdSCellValPrint(SCellVal *pVal, int8_t colType) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!pVal->val) {
|
if (!pVal->val) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
printf("BadVal ");
|
printf("BadVal ");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -248,7 +249,7 @@ bool tdSTSRowIterNext(STSRowIter *pIter, SCellVal *pVal) {
|
||||||
} else if (TD_IS_KV_ROW(pIter->pRow)) {
|
} else if (TD_IS_KV_ROW(pIter->pRow)) {
|
||||||
tdSTSRowIterGetKvVal(pIter, pCol->colId, &pIter->kvIdx, pVal);
|
tdSTSRowIterGetKvVal(pIter, pCol->colId, &pIter->kvIdx, pVal);
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
++pIter->colIdx;
|
++pIter->colIdx;
|
||||||
|
|
||||||
|
@ -489,7 +490,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) {
|
int32_t tdGetBitmapValTypeII(const void *pBitmap, int16_t colIdx, TDRowValT *pValType) {
|
||||||
if (!pBitmap || colIdx < 0) {
|
if (!pBitmap || colIdx < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
terrno = TSDB_CODE_INVALID_PARA;
|
terrno = TSDB_CODE_INVALID_PARA;
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
@ -511,7 +512,7 @@ int32_t tdGetBitmapValTypeII(const void *pBitmap, int16_t colIdx, TDRowValT *pVa
|
||||||
*pValType = ((*pDestByte) & 0x03);
|
*pValType = ((*pDestByte) & 0x03);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
terrno = TSDB_CODE_INVALID_PARA;
|
terrno = TSDB_CODE_INVALID_PARA;
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
@ -520,7 +521,7 @@ int32_t tdGetBitmapValTypeII(const void *pBitmap, int16_t colIdx, TDRowValT *pVa
|
||||||
|
|
||||||
int32_t tdGetBitmapValTypeI(const void *pBitmap, int16_t colIdx, TDRowValT *pValType) {
|
int32_t tdGetBitmapValTypeI(const void *pBitmap, int16_t colIdx, TDRowValT *pValType) {
|
||||||
if (!pBitmap || colIdx < 0) {
|
if (!pBitmap || colIdx < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
terrno = TSDB_CODE_INVALID_PARA;
|
terrno = TSDB_CODE_INVALID_PARA;
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
@ -554,7 +555,7 @@ int32_t tdGetBitmapValTypeI(const void *pBitmap, int16_t colIdx, TDRowValT *pVal
|
||||||
*pValType = ((*pDestByte) & 0x01);
|
*pValType = ((*pDestByte) & 0x01);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
terrno = TSDB_CODE_INVALID_PARA;
|
terrno = TSDB_CODE_INVALID_PARA;
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
@ -563,7 +564,7 @@ int32_t tdGetBitmapValTypeI(const void *pBitmap, int16_t colIdx, TDRowValT *pVal
|
||||||
|
|
||||||
int32_t tdSetBitmapValTypeI(void *pBitmap, int16_t colIdx, TDRowValT valType) {
|
int32_t tdSetBitmapValTypeI(void *pBitmap, int16_t colIdx, TDRowValT valType) {
|
||||||
if (!pBitmap || colIdx < 0) {
|
if (!pBitmap || colIdx < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
terrno = TSDB_CODE_INVALID_PARA;
|
terrno = TSDB_CODE_INVALID_PARA;
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
@ -606,7 +607,7 @@ int32_t tdSetBitmapValTypeI(void *pBitmap, int16_t colIdx, TDRowValT valType) {
|
||||||
// *pDestByte |= (valType);
|
// *pDestByte |= (valType);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
terrno = TSDB_CODE_INVALID_PARA;
|
terrno = TSDB_CODE_INVALID_PARA;
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
@ -629,7 +630,7 @@ int32_t tdGetKvRowValOfCol(SCellVal *output, STSRow *pRow, void *pBitmap, int32_
|
||||||
output->val = POINTER_SHIFT(pRow, offset);
|
output->val = POINTER_SHIFT(pRow, offset);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
if (offset < 0) {
|
if (offset < 0) {
|
||||||
terrno = TSDB_CODE_INVALID_PARA;
|
terrno = TSDB_CODE_INVALID_PARA;
|
||||||
output->valType = TD_VTYPE_NONE;
|
output->valType = TD_VTYPE_NONE;
|
||||||
|
@ -679,7 +680,7 @@ int32_t tdAppendColValToRow(SRowBuilder *pBuilder, col_id_t colId, int8_t colTyp
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
terrno = TSDB_CODE_INVALID_PARA;
|
terrno = TSDB_CODE_INVALID_PARA;
|
||||||
return terrno;
|
return terrno;
|
||||||
#endif
|
#endif
|
||||||
|
@ -706,7 +707,7 @@ int32_t tdAppendColValToRow(SRowBuilder *pBuilder, col_id_t colId, int8_t colTyp
|
||||||
if (!pBuilder->hasNone) pBuilder->hasNone = true;
|
if (!pBuilder->hasNone) pBuilder->hasNone = true;
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -721,7 +722,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,
|
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) {
|
int8_t colType, int16_t colIdx, int32_t offset, col_id_t colId) {
|
||||||
if ((offset < (int32_t)sizeof(SKvRowIdx)) || (colIdx < 1)) {
|
if ((offset < (int32_t)sizeof(SKvRowIdx)) || (colIdx < 1)) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
terrno = TSDB_CODE_INVALID_PARA;
|
terrno = TSDB_CODE_INVALID_PARA;
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
@ -809,7 +810,7 @@ int32_t tdSRowSetExtendedInfo(SRowBuilder *pBuilder, int32_t nCols, int32_t nBou
|
||||||
pBuilder->nCols = nCols;
|
pBuilder->nCols = nCols;
|
||||||
pBuilder->nBoundCols = nBoundCols;
|
pBuilder->nBoundCols = nBoundCols;
|
||||||
if (pBuilder->flen <= 0 || pBuilder->nCols <= 0) {
|
if (pBuilder->flen <= 0 || pBuilder->nCols <= 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
terrno = TSDB_CODE_INVALID_PARA;
|
terrno = TSDB_CODE_INVALID_PARA;
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
@ -831,7 +832,7 @@ int32_t tdSRowSetExtendedInfo(SRowBuilder *pBuilder, int32_t nCols, int32_t nBou
|
||||||
int32_t tdSRowResetBuf(SRowBuilder *pBuilder, void *pBuf) {
|
int32_t tdSRowResetBuf(SRowBuilder *pBuilder, void *pBuf) {
|
||||||
pBuilder->pBuf = (STSRow *)pBuf;
|
pBuilder->pBuf = (STSRow *)pBuf;
|
||||||
if (!pBuilder->pBuf) {
|
if (!pBuilder->pBuf) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
terrno = TSDB_CODE_INVALID_PARA;
|
terrno = TSDB_CODE_INVALID_PARA;
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
@ -868,7 +869,7 @@ int32_t tdSRowResetBuf(SRowBuilder *pBuilder, void *pBuf) {
|
||||||
TD_ROW_SET_NCOLS(pBuilder->pBuf, pBuilder->nBoundCols);
|
TD_ROW_SET_NCOLS(pBuilder->pBuf, pBuilder->nBoundCols);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
terrno = TSDB_CODE_INVALID_PARA;
|
terrno = TSDB_CODE_INVALID_PARA;
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
@ -879,7 +880,7 @@ int32_t tdSRowResetBuf(SRowBuilder *pBuilder, void *pBuf) {
|
||||||
int32_t tdSRowGetBuf(SRowBuilder *pBuilder, void *pBuf) {
|
int32_t tdSRowGetBuf(SRowBuilder *pBuilder, void *pBuf) {
|
||||||
pBuilder->pBuf = (STSRow *)pBuf;
|
pBuilder->pBuf = (STSRow *)pBuf;
|
||||||
if (!pBuilder->pBuf) {
|
if (!pBuilder->pBuf) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
terrno = TSDB_CODE_INVALID_PARA;
|
terrno = TSDB_CODE_INVALID_PARA;
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
@ -899,7 +900,7 @@ int32_t tdSRowGetBuf(SRowBuilder *pBuilder, void *pBuf) {
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
terrno = TSDB_CODE_INVALID_PARA;
|
terrno = TSDB_CODE_INVALID_PARA;
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
@ -919,7 +920,7 @@ int32_t tdSRowSetTpInfo(SRowBuilder *pBuilder, int32_t nCols, int32_t flen) {
|
||||||
pBuilder->flen = flen;
|
pBuilder->flen = flen;
|
||||||
pBuilder->nCols = nCols;
|
pBuilder->nCols = nCols;
|
||||||
if (pBuilder->flen <= 0 || pBuilder->nCols <= 0) {
|
if (pBuilder->flen <= 0 || pBuilder->nCols <= 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
terrno = TSDB_CODE_INVALID_PARA;
|
terrno = TSDB_CODE_INVALID_PARA;
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
@ -938,7 +939,7 @@ int32_t tdSRowSetInfo(SRowBuilder *pBuilder, int32_t nCols, int32_t nBoundCols,
|
||||||
pBuilder->nCols = nCols;
|
pBuilder->nCols = nCols;
|
||||||
pBuilder->nBoundCols = nBoundCols;
|
pBuilder->nBoundCols = nBoundCols;
|
||||||
if (pBuilder->flen <= 0 || pBuilder->nCols <= 0) {
|
if (pBuilder->flen <= 0 || pBuilder->nCols <= 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
terrno = TSDB_CODE_INVALID_PARA;
|
terrno = TSDB_CODE_INVALID_PARA;
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
@ -967,7 +968,7 @@ int32_t tdGetBitmapValType(const void *pBitmap, int16_t colIdx, TDRowValT *pValT
|
||||||
tdGetBitmapValTypeI(pBitmap, colIdx, pValType);
|
tdGetBitmapValTypeI(pBitmap, colIdx, pValType);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
terrno = TSDB_CODE_INVALID_PARA;
|
terrno = TSDB_CODE_INVALID_PARA;
|
||||||
return TSDB_CODE_FAILED;
|
return TSDB_CODE_FAILED;
|
||||||
}
|
}
|
||||||
|
@ -986,7 +987,7 @@ bool tdIsBitmapValTypeNorm(const void *pBitmap, int16_t idx, int8_t bitmapMode)
|
||||||
|
|
||||||
int32_t tdSetBitmapValTypeII(void *pBitmap, int16_t colIdx, TDRowValT valType) {
|
int32_t tdSetBitmapValTypeII(void *pBitmap, int16_t colIdx, TDRowValT valType) {
|
||||||
if (!pBitmap || colIdx < 0) {
|
if (!pBitmap || colIdx < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
terrno = TSDB_CODE_INVALID_PARA;
|
terrno = TSDB_CODE_INVALID_PARA;
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
@ -1013,7 +1014,7 @@ int32_t tdSetBitmapValTypeII(void *pBitmap, int16_t colIdx, TDRowValT valType) {
|
||||||
// *pDestByte |= (valType);
|
// *pDestByte |= (valType);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
terrno = TSDB_CODE_INVALID_PARA;
|
terrno = TSDB_CODE_INVALID_PARA;
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
@ -1030,7 +1031,7 @@ int32_t tdSetBitmapValType(void *pBitmap, int16_t colIdx, TDRowValT valType, int
|
||||||
tdSetBitmapValTypeI(pBitmap, colIdx, valType);
|
tdSetBitmapValTypeI(pBitmap, colIdx, valType);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
terrno = TSDB_CODE_INVALID_PARA;
|
terrno = TSDB_CODE_INVALID_PARA;
|
||||||
return TSDB_CODE_FAILED;
|
return TSDB_CODE_FAILED;
|
||||||
}
|
}
|
||||||
|
@ -1076,7 +1077,7 @@ void tTSRowGetVal(STSRow *pRow, STSchema *pTSchema, int16_t iCol, SColVal *pColV
|
||||||
} else if (TD_IS_KV_ROW(pRow)) {
|
} else if (TD_IS_KV_ROW(pRow)) {
|
||||||
tdSKvRowGetVal(pRow, pTColumn->colId, iCol - 1, &cv);
|
tdSKvRowGetVal(pRow, pTColumn->colId, iCol - 1, &cv);
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tdValTypeIsNone(cv.valType)) {
|
if (tdValTypeIsNone(cv.valType)) {
|
||||||
|
|
|
@ -23,6 +23,8 @@
|
||||||
#define _DEFAULT_SOURCE
|
#define _DEFAULT_SOURCE
|
||||||
#include "ttime.h"
|
#include "ttime.h"
|
||||||
|
|
||||||
|
#include "tlog.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* mktime64 - Converts date to seconds.
|
* mktime64 - Converts date to seconds.
|
||||||
* Converts Gregorian date to seconds since 1970-01-01 00:00:00.
|
* Converts Gregorian date to seconds since 1970-01-01 00:00:00.
|
||||||
|
@ -452,7 +454,7 @@ int64_t convertTimePrecision(int64_t utime, int32_t fromPrecision, int32_t toPre
|
||||||
}
|
}
|
||||||
return utime * 1000000;
|
return utime * 1000000;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return utime;
|
return utime;
|
||||||
}
|
}
|
||||||
} // end from milli
|
} // end from milli
|
||||||
|
@ -468,7 +470,7 @@ int64_t convertTimePrecision(int64_t utime, int32_t fromPrecision, int32_t toPre
|
||||||
}
|
}
|
||||||
return utime * 1000;
|
return utime * 1000;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return utime;
|
return utime;
|
||||||
}
|
}
|
||||||
} // end from micro
|
} // end from micro
|
||||||
|
@ -481,12 +483,12 @@ int64_t convertTimePrecision(int64_t utime, int32_t fromPrecision, int32_t toPre
|
||||||
case TSDB_TIME_PRECISION_NANO:
|
case TSDB_TIME_PRECISION_NANO:
|
||||||
return utime;
|
return utime;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return utime;
|
return utime;
|
||||||
}
|
}
|
||||||
} // end from nano
|
} // end from nano
|
||||||
default: {
|
default: {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return utime; // only to pass windows compilation
|
return utime; // only to pass windows compilation
|
||||||
}
|
}
|
||||||
} // end switch fromPrecision
|
} // end switch fromPrecision
|
||||||
|
|
|
@ -201,7 +201,12 @@ int mainWindows(int argc, char **argv) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
taosConvInit();
|
if (taosConvInit() != 0) {
|
||||||
|
dError("failed to init conv");
|
||||||
|
taosCloseLog();
|
||||||
|
taosCleanupArgs();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (global.dumpConfig) {
|
if (global.dumpConfig) {
|
||||||
dmDumpCfg();
|
dmDumpCfg();
|
||||||
|
|
|
@ -161,8 +161,8 @@ int32_t smPutMsgToQueue(SSnodeMgmt *pMgmt, EQueueType qtype, SRpcMsg *pRpc) {
|
||||||
smPutNodeMsgToWriteQueue(pMgmt, pMsg);
|
smPutNodeMsgToWriteQueue(pMgmt, pMsg);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
tAssert(0, "msg:%p failed to put into snode queue since %s, type:%s qtype:%d", pMsg, terrstr(),
|
tAssertS(0, "msg:%p failed to put into snode queue since %s, type:%s qtype:%d", pMsg, terrstr(),
|
||||||
TMSG_INFO(pMsg->msgType), qtype);
|
TMSG_INFO(pMsg->msgType), qtype);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -134,8 +134,8 @@ static int32_t mndProcessConsumerRecoverMsg(SRpcMsg *pMsg) {
|
||||||
SMqConsumerRecoverMsg *pRecoverMsg = pMsg->pCont;
|
SMqConsumerRecoverMsg *pRecoverMsg = pMsg->pCont;
|
||||||
SMqConsumerObj *pConsumer = mndAcquireConsumer(pMnode, pRecoverMsg->consumerId);
|
SMqConsumerObj *pConsumer = mndAcquireConsumer(pMnode, pRecoverMsg->consumerId);
|
||||||
|
|
||||||
tAssert(pConsumer != NULL, "receive consumer recover msg, consumer id %" PRId64 ", status %s",
|
tAssertS(pConsumer != NULL, "receive consumer recover msg, consumer id %" PRId64 ", status %s",
|
||||||
pRecoverMsg->consumerId, mndConsumerStatusName(pConsumer->status));
|
pRecoverMsg->consumerId, mndConsumerStatusName(pConsumer->status));
|
||||||
|
|
||||||
mInfo("receive consumer recover msg, consumer id %" PRId64 ", status %s", pRecoverMsg->consumerId,
|
mInfo("receive consumer recover msg, consumer id %" PRId64 ", status %s", pRecoverMsg->consumerId,
|
||||||
mndConsumerStatusName(pConsumer->status));
|
mndConsumerStatusName(pConsumer->status));
|
||||||
|
@ -383,7 +383,8 @@ static int32_t mndProcessAskEpReq(SRpcMsg *pMsg) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
tAssert(strcmp(req.cgroup, pConsumer->cgroup) == 0, "cgroup:%s not match consumer:%s", req.cgroup, pConsumer->cgroup);
|
tAssertS(strcmp(req.cgroup, pConsumer->cgroup) == 0, "cgroup:%s not match consumer:%s", req.cgroup,
|
||||||
|
pConsumer->cgroup);
|
||||||
|
|
||||||
atomic_store_32(&pConsumer->hbStatus, 0);
|
atomic_store_32(&pConsumer->hbStatus, 0);
|
||||||
|
|
||||||
|
@ -432,7 +433,7 @@ static int32_t mndProcessAskEpReq(SRpcMsg *pMsg) {
|
||||||
SMqSubscribeObj *pSub = mndAcquireSubscribe(pMnode, pConsumer->cgroup, topic);
|
SMqSubscribeObj *pSub = mndAcquireSubscribe(pMnode, pConsumer->cgroup, topic);
|
||||||
|
|
||||||
// txn guarantees pSub is created
|
// txn guarantees pSub is created
|
||||||
tAsser(pSub);
|
tAssert(pSub != NULL);
|
||||||
taosRLockLatch(&pSub->lock);
|
taosRLockLatch(&pSub->lock);
|
||||||
|
|
||||||
SMqSubTopicEp topicEp = {0};
|
SMqSubTopicEp topicEp = {0};
|
||||||
|
@ -440,7 +441,7 @@ static int32_t mndProcessAskEpReq(SRpcMsg *pMsg) {
|
||||||
|
|
||||||
// 2.1 fetch topic schema
|
// 2.1 fetch topic schema
|
||||||
SMqTopicObj *pTopic = mndAcquireTopic(pMnode, topic);
|
SMqTopicObj *pTopic = mndAcquireTopic(pMnode, topic);
|
||||||
ASSERT(pTopic);
|
tAssertS(pTopic != NULL, "failed to acquire topic:%s", topic);
|
||||||
taosRLockLatch(&pTopic->lock);
|
taosRLockLatch(&pTopic->lock);
|
||||||
tstrncpy(topicEp.db, pTopic->db, TSDB_DB_FNAME_LEN);
|
tstrncpy(topicEp.db, pTopic->db, TSDB_DB_FNAME_LEN);
|
||||||
topicEp.schema.nCols = pTopic->schema.nCols;
|
topicEp.schema.nCols = pTopic->schema.nCols;
|
||||||
|
@ -776,8 +777,8 @@ static int32_t mndConsumerActionUpdate(SSdb *pSdb, SMqConsumerObj *pOldConsumer,
|
||||||
taosWLockLatch(&pOldConsumer->lock);
|
taosWLockLatch(&pOldConsumer->lock);
|
||||||
|
|
||||||
if (pNewConsumer->updateType == CONSUMER_UPDATE__MODIFY) {
|
if (pNewConsumer->updateType == CONSUMER_UPDATE__MODIFY) {
|
||||||
ASSERT(taosArrayGetSize(pOldConsumer->rebNewTopics) == 0);
|
tAssert(taosArrayGetSize(pOldConsumer->rebNewTopics) == 0);
|
||||||
ASSERT(taosArrayGetSize(pOldConsumer->rebRemovedTopics) == 0);
|
tAssert(taosArrayGetSize(pOldConsumer->rebRemovedTopics) == 0);
|
||||||
|
|
||||||
if (taosArrayGetSize(pNewConsumer->rebNewTopics) == 0 && taosArrayGetSize(pNewConsumer->rebRemovedTopics) == 0) {
|
if (taosArrayGetSize(pNewConsumer->rebNewTopics) == 0 && taosArrayGetSize(pNewConsumer->rebRemovedTopics) == 0) {
|
||||||
pOldConsumer->status = MQ_CONSUMER_STATUS__READY;
|
pOldConsumer->status = MQ_CONSUMER_STATUS__READY;
|
||||||
|
@ -799,8 +800,8 @@ static int32_t mndConsumerActionUpdate(SSdb *pSdb, SMqConsumerObj *pOldConsumer,
|
||||||
pOldConsumer->status = MQ_CONSUMER_STATUS__MODIFY;
|
pOldConsumer->status = MQ_CONSUMER_STATUS__MODIFY;
|
||||||
}
|
}
|
||||||
} else if (pNewConsumer->updateType == CONSUMER_UPDATE__LOST) {
|
} else if (pNewConsumer->updateType == CONSUMER_UPDATE__LOST) {
|
||||||
ASSERT(taosArrayGetSize(pOldConsumer->rebNewTopics) == 0);
|
tAssert(taosArrayGetSize(pOldConsumer->rebNewTopics) == 0);
|
||||||
ASSERT(taosArrayGetSize(pOldConsumer->rebRemovedTopics) == 0);
|
tAssert(taosArrayGetSize(pOldConsumer->rebRemovedTopics) == 0);
|
||||||
|
|
||||||
int32_t sz = taosArrayGetSize(pOldConsumer->currentTopics);
|
int32_t sz = taosArrayGetSize(pOldConsumer->currentTopics);
|
||||||
/*pOldConsumer->rebRemovedTopics = taosArrayInit(sz, sizeof(void *));*/
|
/*pOldConsumer->rebRemovedTopics = taosArrayInit(sz, sizeof(void *));*/
|
||||||
|
@ -813,8 +814,8 @@ static int32_t mndConsumerActionUpdate(SSdb *pSdb, SMqConsumerObj *pOldConsumer,
|
||||||
|
|
||||||
pOldConsumer->status = MQ_CONSUMER_STATUS__LOST;
|
pOldConsumer->status = MQ_CONSUMER_STATUS__LOST;
|
||||||
} else if (pNewConsumer->updateType == CONSUMER_UPDATE__RECOVER) {
|
} else if (pNewConsumer->updateType == CONSUMER_UPDATE__RECOVER) {
|
||||||
ASSERT(taosArrayGetSize(pOldConsumer->currentTopics) == 0);
|
tAssert(taosArrayGetSize(pOldConsumer->currentTopics) == 0);
|
||||||
ASSERT(taosArrayGetSize(pOldConsumer->rebNewTopics) == 0);
|
tAssert(taosArrayGetSize(pOldConsumer->rebNewTopics) == 0);
|
||||||
|
|
||||||
int32_t sz = taosArrayGetSize(pOldConsumer->assignedTopics);
|
int32_t sz = taosArrayGetSize(pOldConsumer->assignedTopics);
|
||||||
for (int32_t i = 0; i < sz; i++) {
|
for (int32_t i = 0; i < sz; i++) {
|
||||||
|
@ -831,15 +832,15 @@ static int32_t mndConsumerActionUpdate(SSdb *pSdb, SMqConsumerObj *pOldConsumer,
|
||||||
pOldConsumer->rebalanceTime = pNewConsumer->upTime;
|
pOldConsumer->rebalanceTime = pNewConsumer->upTime;
|
||||||
|
|
||||||
} else if (pNewConsumer->updateType == CONSUMER_UPDATE__ADD) {
|
} else if (pNewConsumer->updateType == CONSUMER_UPDATE__ADD) {
|
||||||
ASSERT(taosArrayGetSize(pNewConsumer->rebNewTopics) == 1);
|
tAssert(taosArrayGetSize(pNewConsumer->rebNewTopics) == 1);
|
||||||
ASSERT(taosArrayGetSize(pNewConsumer->rebRemovedTopics) == 0);
|
tAssert(taosArrayGetSize(pNewConsumer->rebRemovedTopics) == 0);
|
||||||
|
|
||||||
char *addedTopic = strdup(taosArrayGetP(pNewConsumer->rebNewTopics, 0));
|
char *addedTopic = strdup(taosArrayGetP(pNewConsumer->rebNewTopics, 0));
|
||||||
// not exist in current topic
|
// not exist in current topic
|
||||||
#if 1
|
#if 1
|
||||||
for (int32_t i = 0; i < taosArrayGetSize(pOldConsumer->currentTopics); i++) {
|
for (int32_t i = 0; i < taosArrayGetSize(pOldConsumer->currentTopics); i++) {
|
||||||
char *topic = taosArrayGetP(pOldConsumer->currentTopics, i);
|
char *topic = taosArrayGetP(pOldConsumer->currentTopics, i);
|
||||||
ASSERT(strcmp(topic, addedTopic) != 0);
|
tAssert(strcmp(topic, addedTopic) != 0);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -880,15 +881,15 @@ static int32_t mndConsumerActionUpdate(SSdb *pSdb, SMqConsumerObj *pOldConsumer,
|
||||||
|
|
||||||
atomic_add_fetch_32(&pOldConsumer->epoch, 1);
|
atomic_add_fetch_32(&pOldConsumer->epoch, 1);
|
||||||
} else if (pNewConsumer->updateType == CONSUMER_UPDATE__REMOVE) {
|
} else if (pNewConsumer->updateType == CONSUMER_UPDATE__REMOVE) {
|
||||||
ASSERT(taosArrayGetSize(pNewConsumer->rebNewTopics) == 0);
|
tAssert(taosArrayGetSize(pNewConsumer->rebNewTopics) == 0);
|
||||||
ASSERT(taosArrayGetSize(pNewConsumer->rebRemovedTopics) == 1);
|
tAssert(taosArrayGetSize(pNewConsumer->rebRemovedTopics) == 1);
|
||||||
char *removedTopic = taosArrayGetP(pNewConsumer->rebRemovedTopics, 0);
|
char *removedTopic = taosArrayGetP(pNewConsumer->rebRemovedTopics, 0);
|
||||||
|
|
||||||
// not exist in new topic
|
// not exist in new topic
|
||||||
#if 1
|
#if 1
|
||||||
for (int32_t i = 0; i < taosArrayGetSize(pOldConsumer->rebNewTopics); i++) {
|
for (int32_t i = 0; i < taosArrayGetSize(pOldConsumer->rebNewTopics); i++) {
|
||||||
char *topic = taosArrayGetP(pOldConsumer->rebNewTopics, i);
|
char *topic = taosArrayGetP(pOldConsumer->rebNewTopics, i);
|
||||||
ASSERT(strcmp(topic, removedTopic) != 0);
|
tAssert(strcmp(topic, removedTopic) != 0);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -914,7 +915,7 @@ static int32_t mndConsumerActionUpdate(SSdb *pSdb, SMqConsumerObj *pOldConsumer,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// must find the topic
|
// must find the topic
|
||||||
ASSERT(i < sz);
|
tAssert(i < sz);
|
||||||
|
|
||||||
// set status
|
// set status
|
||||||
if (taosArrayGetSize(pOldConsumer->rebNewTopics) == 0 && taosArrayGetSize(pOldConsumer->rebRemovedTopics) == 0) {
|
if (taosArrayGetSize(pOldConsumer->rebNewTopics) == 0 && taosArrayGetSize(pOldConsumer->rebRemovedTopics) == 0) {
|
||||||
|
|
|
@ -112,9 +112,9 @@ static SSdbRaw *mndDbActionEncode(SDbObj *pDb) {
|
||||||
SDB_SET_INT8(pRaw, dataPos, pDb->cfg.hashMethod, _OVER)
|
SDB_SET_INT8(pRaw, dataPos, pDb->cfg.hashMethod, _OVER)
|
||||||
SDB_SET_INT32(pRaw, dataPos, pDb->cfg.numOfRetensions, _OVER)
|
SDB_SET_INT32(pRaw, dataPos, pDb->cfg.numOfRetensions, _OVER)
|
||||||
for (int32_t i = 0; i < pDb->cfg.numOfRetensions; ++i) {
|
for (int32_t i = 0; i < pDb->cfg.numOfRetensions; ++i) {
|
||||||
if (tAssert(taosArrayGetSize(pDb->cfg.pRetensions) == pDb->cfg.numOfRetensions,
|
if (tAssertS(taosArrayGetSize(pDb->cfg.pRetensions) == pDb->cfg.numOfRetensions,
|
||||||
"db:%s, numOfRetensions:%d not matched with %d", pDb->name, pDb->cfg.numOfRetensions,
|
"db:%s, numOfRetensions:%d not matched with %d", pDb->name, pDb->cfg.numOfRetensions,
|
||||||
taosArrayGetSize(pDb->cfg.pRetensions))) {
|
taosArrayGetSize(pDb->cfg.pRetensions))) {
|
||||||
pDb->cfg.numOfRetensions = taosArrayGetSize(pDb->cfg.pRetensions);
|
pDb->cfg.numOfRetensions = taosArrayGetSize(pDb->cfg.pRetensions);
|
||||||
}
|
}
|
||||||
SRetention *pRetension = taosArrayGet(pDb->cfg.pRetensions, i);
|
SRetention *pRetension = taosArrayGet(pDb->cfg.pRetensions, i);
|
||||||
|
|
|
@ -489,7 +489,7 @@ int32_t tEncodeSubscribeObj(void **buf, const SMqSubscribeObj *pSub) {
|
||||||
tlen += tEncodeSMqConsumerEp(buf, pConsumerEp);
|
tlen += tEncodeSMqConsumerEp(buf, pConsumerEp);
|
||||||
cnt++;
|
cnt++;
|
||||||
}
|
}
|
||||||
ASSERT(cnt == sz);
|
tAssert(cnt == sz);
|
||||||
tlen += taosEncodeArray(buf, pSub->unassignedVgs, (FEncode)tEncodeSMqVgEp);
|
tlen += taosEncodeArray(buf, pSub->unassignedVgs, (FEncode)tEncodeSMqVgEp);
|
||||||
tlen += taosEncodeString(buf, pSub->dbName);
|
tlen += taosEncodeString(buf, pSub->dbName);
|
||||||
return tlen;
|
return tlen;
|
||||||
|
|
|
@ -115,13 +115,13 @@ int32_t mndAddDispatcherToInnerTask(SMnode* pMnode, SStreamObj* pStream, SStream
|
||||||
|
|
||||||
if (pStream->fixedSinkVgId == 0) {
|
if (pStream->fixedSinkVgId == 0) {
|
||||||
SDbObj* pDb = mndAcquireDb(pMnode, pStream->targetDb);
|
SDbObj* pDb = mndAcquireDb(pMnode, pStream->targetDb);
|
||||||
ASSERT(pDb);
|
tAssert(pDb != NULL);
|
||||||
if (pDb->cfg.numOfVgroups > 1) {
|
if (pDb->cfg.numOfVgroups > 1) {
|
||||||
isShuffle = true;
|
isShuffle = true;
|
||||||
pTask->outputType = TASK_OUTPUT__SHUFFLE_DISPATCH;
|
pTask->outputType = TASK_OUTPUT__SHUFFLE_DISPATCH;
|
||||||
pTask->dispatchMsgType = TDMT_STREAM_TASK_DISPATCH;
|
pTask->dispatchMsgType = TDMT_STREAM_TASK_DISPATCH;
|
||||||
if (mndExtractDbInfo(pMnode, pDb, &pTask->shuffleDispatcher.dbInfo, NULL) < 0) {
|
if (mndExtractDbInfo(pMnode, pDb, &pTask->shuffleDispatcher.dbInfo, NULL) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -170,7 +170,7 @@ int32_t mndAssignTaskToVg(SMnode* pMnode, SStreamTask* pTask, SSubplan* plan, co
|
||||||
plan->execNode.epSet = pTask->epSet;
|
plan->execNode.epSet = pTask->epSet;
|
||||||
|
|
||||||
if (qSubPlanToString(plan, &pTask->exec.qmsg, &msgLen) < 0) {
|
if (qSubPlanToString(plan, &pTask->exec.qmsg, &msgLen) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
terrno = TSDB_CODE_QRY_INVALID_INPUT;
|
terrno = TSDB_CODE_QRY_INVALID_INPUT;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -195,7 +195,7 @@ int32_t mndAssignTaskToSnode(SMnode* pMnode, SStreamTask* pTask, SSubplan* plan,
|
||||||
plan->execNode.epSet = pTask->epSet;
|
plan->execNode.epSet = pTask->epSet;
|
||||||
|
|
||||||
if (qSubPlanToString(plan, &pTask->exec.qmsg, &msgLen) < 0) {
|
if (qSubPlanToString(plan, &pTask->exec.qmsg, &msgLen) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
terrno = TSDB_CODE_QRY_INVALID_INPUT;
|
terrno = TSDB_CODE_QRY_INVALID_INPUT;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -558,13 +558,13 @@ static int32_t mndCreateSma(SMnode *pMnode, SRpcMsg *pReq, SMCreateSmaReq *pCrea
|
||||||
|
|
||||||
SNode *pAst = NULL;
|
SNode *pAst = NULL;
|
||||||
if (nodesStringToNode(streamObj.ast, &pAst) < 0) {
|
if (nodesStringToNode(streamObj.ast, &pAst) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// extract output schema from ast
|
// extract output schema from ast
|
||||||
if (qExtractResultSchema(pAst, (int32_t *)&streamObj.outputSchema.nCols, &streamObj.outputSchema.pSchema) != 0) {
|
if (qExtractResultSchema(pAst, (int32_t *)&streamObj.outputSchema.nCols, &streamObj.outputSchema.pSchema) != 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -579,13 +579,13 @@ static int32_t mndCreateSma(SMnode *pMnode, SRpcMsg *pReq, SMCreateSmaReq *pCrea
|
||||||
};
|
};
|
||||||
|
|
||||||
if (qCreateQueryPlan(&cxt, &pPlan, NULL) < 0) {
|
if (qCreateQueryPlan(&cxt, &pPlan, NULL) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// save physcial plan
|
// save physcial plan
|
||||||
if (nodesNodeToString((SNode *)pPlan, false, &streamObj.physicalPlan, NULL) != 0) {
|
if (nodesNodeToString((SNode *)pPlan, false, &streamObj.physicalPlan, NULL) != 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (pAst != NULL) nodesDestroyNode(pAst);
|
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) {
|
if (mndDropStreamTasks(pMnode, pTrans, pStream) < 0) {
|
||||||
mError("stream:%s, failed to drop task since %s", pStream->name, terrstr());
|
mError("stream:%s, failed to drop task since %s", pStream->name, terrstr());
|
||||||
sdbRelease(pMnode->pSdb, pStream);
|
sdbRelease(pMnode->pSdb, pStream);
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
goto _OVER;
|
goto _OVER;
|
||||||
}
|
}
|
||||||
|
|
||||||
// drop stream
|
// drop stream
|
||||||
if (mndPersistDropStreamLog(pMnode, pTrans, pStream) < 0) {
|
if (mndPersistDropStreamLog(pMnode, pTrans, pStream) < 0) {
|
||||||
sdbRelease(pMnode->pSdb, pStream);
|
sdbRelease(pMnode->pSdb, pStream);
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
goto _OVER;
|
goto _OVER;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1176,7 +1176,7 @@ static int32_t mndCheckAlterColForTopic(SMnode *pMnode, const char *stbFullName,
|
||||||
|
|
||||||
SNode *pAst = NULL;
|
SNode *pAst = NULL;
|
||||||
if (nodesStringToNode(pTopic->ast, &pAst) != 0) {
|
if (nodesStringToNode(pTopic->ast, &pAst) != 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1221,7 +1221,7 @@ static int32_t mndCheckAlterColForStream(SMnode *pMnode, const char *stbFullName
|
||||||
|
|
||||||
SNode *pAst = NULL;
|
SNode *pAst = NULL;
|
||||||
if (nodesStringToNode(pStream->ast, &pAst) != 0) {
|
if (nodesStringToNode(pStream->ast, &pAst) != 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2091,7 +2091,7 @@ static int32_t mndCheckDropStbForTopic(SMnode *pMnode, const char *stbFullName,
|
||||||
|
|
||||||
SNode *pAst = NULL;
|
SNode *pAst = NULL;
|
||||||
if (nodesStringToNode(pTopic->ast, &pAst) != 0) {
|
if (nodesStringToNode(pTopic->ast, &pAst) != 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2138,7 +2138,7 @@ static int32_t mndCheckDropStbForStream(SMnode *pMnode, const char *stbFullName,
|
||||||
|
|
||||||
SNode *pAst = NULL;
|
SNode *pAst = NULL;
|
||||||
if (nodesStringToNode(pStream->ast, &pAst) != 0) {
|
if (nodesStringToNode(pStream->ast, &pAst) != 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -325,13 +325,13 @@ static int32_t mndBuildStreamObjFromCreateReq(SMnode *pMnode, SStreamObj *pObj,
|
||||||
|
|
||||||
// deserialize ast
|
// deserialize ast
|
||||||
if (nodesStringToNode(pObj->ast, &pAst) < 0) {
|
if (nodesStringToNode(pObj->ast, &pAst) < 0) {
|
||||||
/*ASSERT(0);*/
|
/*tAssert(0);*/
|
||||||
goto FAIL;
|
goto FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// extract output schema from ast
|
// extract output schema from ast
|
||||||
if (qExtractResultSchema(pAst, (int32_t *)&pObj->outputSchema.nCols, &pObj->outputSchema.pSchema) != 0) {
|
if (qExtractResultSchema(pAst, (int32_t *)&pObj->outputSchema.nCols, &pObj->outputSchema.pSchema) != 0) {
|
||||||
/*ASSERT(0);*/
|
/*tAssert(0);*/
|
||||||
goto FAIL;
|
goto FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -346,13 +346,13 @@ static int32_t mndBuildStreamObjFromCreateReq(SMnode *pMnode, SStreamObj *pObj,
|
||||||
|
|
||||||
// using ast and param to build physical plan
|
// using ast and param to build physical plan
|
||||||
if (qCreateQueryPlan(&cxt, &pPlan, NULL) < 0) {
|
if (qCreateQueryPlan(&cxt, &pPlan, NULL) < 0) {
|
||||||
/*ASSERT(0);*/
|
/*tAssert(0);*/
|
||||||
goto FAIL;
|
goto FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// save physcial plan
|
// save physcial plan
|
||||||
if (nodesNodeToString((SNode *)pPlan, false, &pObj->physicalPlan, NULL) != 0) {
|
if (nodesNodeToString((SNode *)pPlan, false, &pObj->physicalPlan, NULL) != 0) {
|
||||||
/*ASSERT(0);*/
|
/*tAssert(0);*/
|
||||||
goto FAIL;
|
goto FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -793,7 +793,7 @@ static int32_t mndProcessStreamDoCheckpoint(SRpcMsg *pReq) {
|
||||||
ASSERT(pTask->nodeId > 0);
|
ASSERT(pTask->nodeId > 0);
|
||||||
SVgObj *pVgObj = mndAcquireVgroup(pMnode, pTask->nodeId);
|
SVgObj *pVgObj = mndAcquireVgroup(pMnode, pTask->nodeId);
|
||||||
if (pVgObj == NULL) {
|
if (pVgObj == NULL) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
taosRUnLockLatch(&pStream->lock);
|
taosRUnLockLatch(&pStream->lock);
|
||||||
mndReleaseStream(pMnode, pStream);
|
mndReleaseStream(pMnode, pStream);
|
||||||
mndTransDrop(pTrans);
|
mndTransDrop(pTrans);
|
||||||
|
@ -853,7 +853,7 @@ static int32_t mndProcessDropStreamReq(SRpcMsg *pReq) {
|
||||||
|
|
||||||
SMDropStreamReq dropReq = {0};
|
SMDropStreamReq dropReq = {0};
|
||||||
if (tDeserializeSMDropStreamReq(pReq->pCont, pReq->contLen, &dropReq) < 0) {
|
if (tDeserializeSMDropStreamReq(pReq->pCont, pReq->contLen, &dropReq) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
terrno = TSDB_CODE_INVALID_MSG;
|
terrno = TSDB_CODE_INVALID_MSG;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -155,7 +155,7 @@ static int32_t mndPersistSubChangeVgReq(SMnode *pMnode, STrans *pTrans, const SM
|
||||||
int32_t vgId = pRebVg->pVgEp->vgId;
|
int32_t vgId = pRebVg->pVgEp->vgId;
|
||||||
SVgObj *pVgObj = mndAcquireVgroup(pMnode, vgId);
|
SVgObj *pVgObj = mndAcquireVgroup(pMnode, vgId);
|
||||||
if (pVgObj == NULL) {
|
if (pVgObj == NULL) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
taosMemoryFree(buf);
|
taosMemoryFree(buf);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -492,7 +492,7 @@ static int32_t mndPersistRebResult(SMnode *pMnode, SRpcMsg *pMsg, const SMqRebOu
|
||||||
taosArrayPush(pConsumerNew->rebNewTopics, &topic);
|
taosArrayPush(pConsumerNew->rebNewTopics, &topic);
|
||||||
mndReleaseConsumer(pMnode, pConsumerOld);
|
mndReleaseConsumer(pMnode, pConsumerOld);
|
||||||
if (mndSetConsumerCommitLogs(pMnode, pTrans, pConsumerNew) != 0) {
|
if (mndSetConsumerCommitLogs(pMnode, pTrans, pConsumerNew) != 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
tDeleteSMqConsumerObj(pConsumerNew);
|
tDeleteSMqConsumerObj(pConsumerNew);
|
||||||
taosMemoryFree(pConsumerNew);
|
taosMemoryFree(pConsumerNew);
|
||||||
goto REB_FAIL;
|
goto REB_FAIL;
|
||||||
|
@ -515,7 +515,7 @@ static int32_t mndPersistRebResult(SMnode *pMnode, SRpcMsg *pMsg, const SMqRebOu
|
||||||
taosArrayPush(pConsumerNew->rebRemovedTopics, &topic);
|
taosArrayPush(pConsumerNew->rebRemovedTopics, &topic);
|
||||||
mndReleaseConsumer(pMnode, pConsumerOld);
|
mndReleaseConsumer(pMnode, pConsumerOld);
|
||||||
if (mndSetConsumerCommitLogs(pMnode, pTrans, pConsumerNew) != 0) {
|
if (mndSetConsumerCommitLogs(pMnode, pTrans, pConsumerNew) != 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
tDeleteSMqConsumerObj(pConsumerNew);
|
tDeleteSMqConsumerObj(pConsumerNew);
|
||||||
taosMemoryFree(pConsumerNew);
|
taosMemoryFree(pConsumerNew);
|
||||||
goto REB_FAIL;
|
goto REB_FAIL;
|
||||||
|
|
|
@ -499,7 +499,7 @@ static int32_t mndCreateTopic(SMnode *pMnode, SRpcMsg *pReq, SCMCreateTopicReq *
|
||||||
if (code < 0) {
|
if (code < 0) {
|
||||||
sdbRelease(pSdb, pVgroup);
|
sdbRelease(pSdb, pVgroup);
|
||||||
mndTransDrop(pTrans);
|
mndTransDrop(pTrans);
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
void *buf = taosMemoryCalloc(1, sizeof(SMsgHead) + len);
|
void *buf = taosMemoryCalloc(1, sizeof(SMsgHead) + len);
|
||||||
|
@ -717,7 +717,7 @@ static int32_t mndProcessDropTopicReq(SRpcMsg *pReq) {
|
||||||
|
|
||||||
// TODO check if rebalancing
|
// TODO check if rebalancing
|
||||||
if (mndDropSubByTopic(pMnode, pTrans, dropReq.name) < 0) {
|
if (mndDropSubByTopic(pMnode, pTrans, dropReq.name) < 0) {
|
||||||
/*ASSERT(0);*/
|
/*tAssert(0);*/
|
||||||
mError("topic:%s, failed to drop since %s", pTopic->name, terrstr());
|
mError("topic:%s, failed to drop since %s", pTopic->name, terrstr());
|
||||||
mndTransDrop(pTrans);
|
mndTransDrop(pTrans);
|
||||||
mndReleaseTopic(pMnode, pTopic);
|
mndReleaseTopic(pMnode, pTopic);
|
||||||
|
|
|
@ -263,7 +263,7 @@ int32_t sndProcessWriteMsg(SSnode *pSnode, SRpcMsg *pMsg, SRpcMsg *pRsp) {
|
||||||
case TDMT_STREAM_TASK_DROP:
|
case TDMT_STREAM_TASK_DROP:
|
||||||
return sndProcessTaskDropReq(pSnode, pReq, len);
|
return sndProcessTaskDropReq(pSnode, pReq, len);
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -317,7 +317,7 @@ int32_t sndProcessStreamMsg(SSnode *pSnode, SRpcMsg *pMsg) {
|
||||||
case TDMT_STREAM_RECOVER_FINISH_RSP:
|
case TDMT_STREAM_RECOVER_FINISH_RSP:
|
||||||
return sndProcessTaskRecoverFinishRsp(pSnode, pMsg);
|
return sndProcessTaskRecoverFinishRsp(pSnode, pMsg);
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ int metaEncodeEntry(SEncoder *pCoder, const SMetaEntry *pME) {
|
||||||
} else if (pME->type == TSDB_TSMA_TABLE) {
|
} else if (pME->type == TSDB_TSMA_TABLE) {
|
||||||
if (tEncodeTSma(pCoder, pME->smaEntry.tsma) < 0) return -1;
|
if (tEncodeTSma(pCoder, pME->smaEntry.tsma) < 0) return -1;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
tEndEncode(pCoder);
|
tEndEncode(pCoder);
|
||||||
|
@ -99,7 +99,7 @@ int metaDecodeEntry(SDecoder *pCoder, SMetaEntry *pME) {
|
||||||
}
|
}
|
||||||
if (tDecodeTSma(pCoder, pME->smaEntry.tsma, true) < 0) return -1;
|
if (tDecodeTSma(pCoder, pME->smaEntry.tsma, true) < 0) return -1;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
tEndDecode(pCoder);
|
tEndDecode(pCoder);
|
||||||
|
|
|
@ -161,7 +161,7 @@ int32_t metaSnapWriterClose(SMetaSnapWriter** ppWriter, int8_t rollback) {
|
||||||
SMetaSnapWriter* pWriter = *ppWriter;
|
SMetaSnapWriter* pWriter = *ppWriter;
|
||||||
|
|
||||||
if (rollback) {
|
if (rollback) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
} else {
|
} else {
|
||||||
code = metaCommit(pWriter->pMeta, pWriter->pMeta->txn);
|
code = metaCommit(pWriter->pMeta, pWriter->pMeta->txn);
|
||||||
if (code) goto _err;
|
if (code) goto _err;
|
||||||
|
@ -524,7 +524,7 @@ int32_t getMetafromSnapShot(SSnapContext* ctx, void** pBuf, int32_t* contLen, in
|
||||||
} else {
|
} else {
|
||||||
SArray* pTagVals = NULL;
|
SArray* pTagVals = NULL;
|
||||||
if (tTagToValArray((const STag*)p, &pTagVals) != 0) {
|
if (tTagToValArray((const STag*)p, &pTagVals) != 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
int16_t nCols = taosArrayGetSize(pTagVals);
|
int16_t nCols = taosArrayGetSize(pTagVals);
|
||||||
for (int j = 0; j < nCols; ++j) {
|
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);
|
ret = buildNormalChildTableInfo(&req, pBuf, contLen);
|
||||||
*type = TDMT_VND_CREATE_TABLE;
|
*type = TDMT_VND_CREATE_TABLE;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
tDecoderClear(&dc);
|
tDecoderClear(&dc);
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ static void metaGetEntryInfo(const SMetaEntry *pEntry, SMetaInfo *pInfo) {
|
||||||
pInfo->suid = 0;
|
pInfo->suid = 0;
|
||||||
pInfo->skmVer = pEntry->ntbEntry.schemaRow.version;
|
pInfo->skmVer = pEntry->ntbEntry.schemaRow.version;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -558,7 +558,7 @@ static void metaBuildTtlIdxKey(STtlIdxKey *ttlKey, const SMetaEntry *pME) {
|
||||||
ctime = pME->ntbEntry.ctime;
|
ctime = pME->ntbEntry.ctime;
|
||||||
ttlDays = pME->ntbEntry.ttlDays;
|
ttlDays = pME->ntbEntry.ttlDays;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ttlDays <= 0) return;
|
if (ttlDays <= 0) return;
|
||||||
|
@ -1401,7 +1401,7 @@ static int metaSaveToSkmDb(SMeta *pMeta, const SMetaEntry *pME) {
|
||||||
} else if (pME->type == TSDB_NORMAL_TABLE) {
|
} else if (pME->type == TSDB_NORMAL_TABLE) {
|
||||||
pSW = &pME->ntbEntry.schemaRow;
|
pSW = &pME->ntbEntry.schemaRow;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
skmDbKey.uid = pME->uid;
|
skmDbKey.uid = pME->uid;
|
||||||
|
|
|
@ -250,7 +250,7 @@ static int32_t tdInitSmaStat(SSmaStat **pSmaStat, int8_t smaType, const SSma *pS
|
||||||
} else if (smaType == TSDB_SMA_TYPE_TIME_RANGE) {
|
} else if (smaType == TSDB_SMA_TYPE_TIME_RANGE) {
|
||||||
// TODO
|
// TODO
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TSDB_CODE_SUCCESS;
|
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);
|
smaDebug("vgId:%d, remove refId:%" PRIi64 " from rsmaRef:%" PRIi32 " succeed", vid, refId, smaMgmt.rsetId);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -100,7 +100,7 @@ int smaSetKeepCfg(SVnode *pVnode, STsdbKeepCfg *pKeepCfg, STsdbCfg *pCfg, int ty
|
||||||
pKeepCfg->precision = pCfg->precision;
|
pKeepCfg->precision = pCfg->precision;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case TSDB_TYPE_TSMA:
|
case TSDB_TYPE_TSMA:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
break;
|
break;
|
||||||
case TSDB_TYPE_RSMA_L0:
|
case TSDB_TYPE_RSMA_L0:
|
||||||
SMA_SET_KEEP_CFG(pVnode, 0);
|
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);
|
SMA_SET_KEEP_CFG(pVnode, 2);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -145,7 +145,7 @@ int32_t smaOpen(SVnode *pVnode, int8_t rollback) {
|
||||||
} else if (i == TSDB_RETENTION_L2) {
|
} else if (i == TSDB_RETENTION_L2) {
|
||||||
SMA_OPEN_RSMA_IMPL(pVnode, 2);
|
SMA_OPEN_RSMA_IMPL(pVnode, 2);
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1038,7 +1038,7 @@ static int32_t tdExecuteRSmaAsync(SSma *pSma, const void *pMsg, int32_t inputTyp
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
tdReleaseRSmaInfo(pSma, pRSmaInfo);
|
tdReleaseRSmaInfo(pSma, pRSmaInfo);
|
||||||
|
@ -1567,7 +1567,7 @@ int32_t tdRSmaProcessExecImpl(SSma *pSma, ERsmaExecType type) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (atomic_load_64(&pRSmaStat->nBufItems) <= 0) {
|
if (atomic_load_64(&pRSmaStat->nBufItems) <= 0) {
|
||||||
|
|
|
@ -430,7 +430,7 @@ int32_t rsmaSnapWrite(SRSmaSnapWriter* pWriter, uint8_t* pData, uint32_t nData)
|
||||||
} else if (pHdr->type == SNAP_DATA_QTASK) {
|
} else if (pHdr->type == SNAP_DATA_QTASK) {
|
||||||
code = rsmaSnapWriteQTaskInfo(pWriter, pData, nData);
|
code = rsmaSnapWriteQTaskInfo(pWriter, pData, nData);
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
if (code < 0) goto _err;
|
if (code < 0) goto _err;
|
||||||
|
|
||||||
|
|
|
@ -136,7 +136,7 @@ static int32_t tdProcessTSmaCreateImpl(SSma *pSma, int64_t version, const char *
|
||||||
" dstTb:%s dstVg:%d",
|
" dstTb:%s dstVg:%d",
|
||||||
SMA_VID(pSma), pCfg->indexName, pCfg->indexUid, pCfg->tableUid, pCfg->dstTbUid, pReq.name, pCfg->dstVgId);
|
SMA_VID(pSma), pCfg->indexName, pCfg->indexUid, pCfg->tableUid, pCfg->dstTbUid, pReq.name, pCfg->dstVgId);
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -92,21 +92,21 @@ STQ* tqOpen(const char* path, SVnode* pVnode) {
|
||||||
taosHashSetFreeFp(pTq->pCheckInfo, (FDelete)tDeleteSTqCheckInfo);
|
taosHashSetFreeFp(pTq->pCheckInfo, (FDelete)tDeleteSTqCheckInfo);
|
||||||
|
|
||||||
if (tqMetaOpen(pTq) < 0) {
|
if (tqMetaOpen(pTq) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
pTq->pOffsetStore = tqOffsetOpen(pTq);
|
pTq->pOffsetStore = tqOffsetOpen(pTq);
|
||||||
if (pTq->pOffsetStore == NULL) {
|
if (pTq->pOffsetStore == NULL) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
pTq->pStreamMeta = streamMetaOpen(path, pTq, (FTaskExpand*)tqExpandTask, pTq->pVnode->config.vgId);
|
pTq->pStreamMeta = streamMetaOpen(path, pTq, (FTaskExpand*)tqExpandTask, pTq->pVnode->config.vgId);
|
||||||
if (pTq->pStreamMeta == NULL) {
|
if (pTq->pStreamMeta == NULL) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (streamLoadTasks(pTq->pStreamMeta) < 0) {
|
if (streamLoadTasks(pTq->pStreamMeta) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return pTq;
|
return pTq;
|
||||||
|
@ -348,7 +348,7 @@ int32_t tqProcessOffsetCommitReq(STQ* pTq, int64_t version, char* msg, int32_t m
|
||||||
SDecoder decoder;
|
SDecoder decoder;
|
||||||
tDecoderInit(&decoder, msg, msgLen);
|
tDecoderInit(&decoder, msg, msgLen);
|
||||||
if (tDecodeSTqOffset(&decoder, &offset) < 0) {
|
if (tDecodeSTqOffset(&decoder, &offset) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
tDecoderClear(&decoder);
|
tDecoderClear(&decoder);
|
||||||
|
@ -363,7 +363,7 @@ int32_t tqProcessOffsetCommitReq(STQ* pTq, int64_t version, char* msg, int32_t m
|
||||||
offset.val.version += 1;
|
offset.val.version += 1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
STqOffset* pOffset = tqOffsetRead(pTq->pOffsetStore, offset.subKey);
|
STqOffset* pOffset = tqOffsetRead(pTq->pOffsetStore, offset.subKey);
|
||||||
if (pOffset != NULL && tqOffsetLessOrEqual(&offset, pOffset)) {
|
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) {
|
if (tqOffsetWrite(pTq->pOffsetStore, &offset) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -736,7 +736,7 @@ int32_t tqProcessDeleteSubReq(STQ* pTq, int64_t version, char* msg, int32_t msgL
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tqMetaDeleteHandle(pTq, pReq->subKey) < 0) {
|
if (tqMetaDeleteHandle(pTq, pReq->subKey) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
return 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
|
// TODO version should be assigned and refed during preprocess
|
||||||
SWalRef* pRef = walRefCommittedVer(pTq->pVnode->pWal);
|
SWalRef* pRef = walRefCommittedVer(pTq->pVnode->pWal);
|
||||||
if (pRef == NULL) {
|
if (pRef == NULL) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
int64_t ver = pRef->refVer;
|
int64_t ver = pRef->refVer;
|
||||||
|
@ -862,7 +862,7 @@ 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);
|
tqDebug("try to persist handle %s consumer %" PRId64, req.subKey, pHandle->consumerId);
|
||||||
if (tqMetaSaveHandle(pTq, req.subKey, pHandle) < 0) {
|
if (tqMetaSaveHandle(pTq, req.subKey, pHandle) < 0) {
|
||||||
// TODO
|
// TODO
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/*ASSERT(pExec->consumerId == req.oldConsumerId);*/
|
/*ASSERT(pExec->consumerId == req.oldConsumerId);*/
|
||||||
|
@ -873,7 +873,7 @@ int32_t tqProcessSubscribeReq(STQ* pTq, int64_t version, char* msg, int32_t msgL
|
||||||
taosMemoryFree(req.qmsg);
|
taosMemoryFree(req.qmsg);
|
||||||
if (tqMetaSaveHandle(pTq, req.subKey, pHandle) < 0) {
|
if (tqMetaSaveHandle(pTq, req.subKey, pHandle) < 0) {
|
||||||
// TODO
|
// TODO
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
// close handle
|
// close handle
|
||||||
}
|
}
|
||||||
|
@ -997,7 +997,7 @@ int32_t tqProcessStreamTaskCheckReq(STQ* pTq, SRpcMsg* pMsg) {
|
||||||
int32_t len;
|
int32_t len;
|
||||||
tEncodeSize(tEncodeSStreamTaskCheckRsp, &rsp, len, code);
|
tEncodeSize(tEncodeSStreamTaskCheckRsp, &rsp, len, code);
|
||||||
if (code < 0) {
|
if (code < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
void* buf = rpcMallocCont(sizeof(SMsgHead) + len);
|
void* buf = rpcMallocCont(sizeof(SMsgHead) + len);
|
||||||
((SMsgHead*)buf)->vgId = htonl(req.upstreamNodeId);
|
((SMsgHead*)buf)->vgId = htonl(req.upstreamNodeId);
|
||||||
|
@ -1095,7 +1095,7 @@ int32_t tqProcessTaskRecover1Req(STQ* pTq, SRpcMsg* pMsg) {
|
||||||
// check param
|
// check param
|
||||||
int64_t fillVer1 = pTask->startVer;
|
int64_t fillVer1 = pTask->startVer;
|
||||||
if (fillVer1 <= 0) {
|
if (fillVer1 <= 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
streamMetaReleaseTask(pTq->pStreamMeta, pTask);
|
streamMetaReleaseTask(pTq->pStreamMeta, pTask);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,7 +87,7 @@ int32_t tqScanData(STQ* pTq, const STqHandle* pHandle, SMqDataRsp* pRsp, STqOffs
|
||||||
uint64_t ts = 0;
|
uint64_t ts = 0;
|
||||||
tqDebug("vgId:%d, tmq task start to execute", pTq->pVnode->config.vgId);
|
tqDebug("vgId:%d, tmq task start to execute", pTq->pVnode->config.vgId);
|
||||||
if (qExecTask(task, &pDataBlock, &ts) < 0) {
|
if (qExecTask(task, &pDataBlock, &ts) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
tqDebug("vgId:%d, tmq task executed, get %p", pTq->pVnode->config.vgId, pDataBlock);
|
tqDebug("vgId:%d, tmq task executed, get %p", pTq->pVnode->config.vgId, pDataBlock);
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ int32_t tqScanData(STQ* pTq, const STqHandle* pHandle, SMqDataRsp* pRsp, STqOffs
|
||||||
}
|
}
|
||||||
|
|
||||||
if (qStreamExtractOffset(task, &pRsp->rspOffset) < 0) {
|
if (qStreamExtractOffset(task, &pRsp->rspOffset) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
ASSERT(pRsp->rspOffset.type != 0);
|
ASSERT(pRsp->rspOffset.type != 0);
|
||||||
|
@ -148,7 +148,7 @@ int32_t tqScanTaosx(STQ* pTq, const STqHandle* pHandle, STaosxRsp* pRsp, SMqMeta
|
||||||
uint64_t ts = 0;
|
uint64_t ts = 0;
|
||||||
tqDebug("tmqsnap task start to execute");
|
tqDebug("tmqsnap task start to execute");
|
||||||
if (qExecTask(task, &pDataBlock, &ts) < 0) {
|
if (qExecTask(task, &pDataBlock, &ts) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
tqDebug("tmqsnap task execute end, get %p", pDataBlock);
|
tqDebug("tmqsnap task execute end, get %p", pDataBlock);
|
||||||
|
|
||||||
|
@ -216,7 +216,7 @@ int32_t tqScanTaosx(STQ* pTq, const STqHandle* pHandle, STaosxRsp* pRsp, SMqMeta
|
||||||
}
|
}
|
||||||
|
|
||||||
if (qStreamExtractOffset(task, &pRsp->rspOffset) < 0) {
|
if (qStreamExtractOffset(task, &pRsp->rspOffset) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
ASSERT(pRsp->rspOffset.type != 0);
|
ASSERT(pRsp->rspOffset.type != 0);
|
||||||
|
|
|
@ -71,17 +71,17 @@ int32_t tDecodeSTqHandle(SDecoder* pDecoder, STqHandle* pHandle) {
|
||||||
|
|
||||||
int32_t tqMetaOpen(STQ* pTq) {
|
int32_t tqMetaOpen(STQ* pTq) {
|
||||||
if (tdbOpen(pTq->path, 16 * 1024, 1, &pTq->pMetaDB, 0) < 0) {
|
if (tdbOpen(pTq->path, 16 * 1024, 1, &pTq->pMetaDB, 0) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tdbTbOpen("tq.db", -1, -1, NULL, pTq->pMetaDB, &pTq->pExecStore, 0) < 0) {
|
if (tdbTbOpen("tq.db", -1, -1, NULL, pTq->pMetaDB, &pTq->pExecStore, 0) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tdbTbOpen("tq.check.db", -1, -1, NULL, pTq->pMetaDB, &pTq->pCheckStore, 0) < 0) {
|
if (tdbTbOpen("tq.check.db", -1, -1, NULL, pTq->pMetaDB, &pTq->pCheckStore, 0) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
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) <
|
if (tdbBegin(pTq->pMetaDB, &txn, tdbDefaultMalloc, tdbDefaultFree, NULL, TDB_TXN_WRITE | TDB_TXN_READ_UNCOMMITTED) <
|
||||||
0) {
|
0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tdbTbDelete(pTq->pCheckStore, key, (int)strlen(key), txn) < 0) {
|
if (tdbTbDelete(pTq->pCheckStore, key, (int)strlen(key), txn) < 0) {
|
||||||
/*ASSERT(0);*/
|
/*tAssert(0);*/
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tdbCommit(pTq->pMetaDB, txn) < 0) {
|
if (tdbCommit(pTq->pMetaDB, txn) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tdbPostCommit(pTq->pMetaDB, txn) < 0) {
|
if (tdbPostCommit(pTq->pMetaDB, txn) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -156,7 +156,7 @@ int32_t tqMetaDeleteCheckInfo(STQ* pTq, const char* key) {
|
||||||
int32_t tqMetaRestoreCheckInfo(STQ* pTq) {
|
int32_t tqMetaRestoreCheckInfo(STQ* pTq) {
|
||||||
TBC* pCur = NULL;
|
TBC* pCur = NULL;
|
||||||
if (tdbTbcOpen(pTq->pCheckStore, &pCur, NULL) < 0) {
|
if (tdbTbcOpen(pTq->pCheckStore, &pCur, NULL) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -204,33 +204,33 @@ int32_t tqMetaSaveHandle(STQ* pTq, const char* key, const STqHandle* pHandle) {
|
||||||
|
|
||||||
void* buf = taosMemoryCalloc(1, vlen);
|
void* buf = taosMemoryCalloc(1, vlen);
|
||||||
if (buf == NULL) {
|
if (buf == NULL) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
SEncoder encoder;
|
SEncoder encoder;
|
||||||
tEncoderInit(&encoder, buf, vlen);
|
tEncoderInit(&encoder, buf, vlen);
|
||||||
|
|
||||||
if (tEncodeSTqHandle(&encoder, pHandle) < 0) {
|
if (tEncodeSTqHandle(&encoder, pHandle) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
TXN* txn;
|
TXN* txn;
|
||||||
|
|
||||||
if (tdbBegin(pTq->pMetaDB, &txn, tdbDefaultMalloc, tdbDefaultFree, NULL, TDB_TXN_WRITE | TDB_TXN_READ_UNCOMMITTED) <
|
if (tdbBegin(pTq->pMetaDB, &txn, tdbDefaultMalloc, tdbDefaultFree, NULL, TDB_TXN_WRITE | TDB_TXN_READ_UNCOMMITTED) <
|
||||||
0) {
|
0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tdbTbUpsert(pTq->pExecStore, key, (int)strlen(key), buf, vlen, txn) < 0) {
|
if (tdbTbUpsert(pTq->pExecStore, key, (int)strlen(key), buf, vlen, txn) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tdbCommit(pTq->pMetaDB, txn) < 0) {
|
if (tdbCommit(pTq->pMetaDB, txn) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tdbPostCommit(pTq->pMetaDB, txn) < 0) {
|
if (tdbPostCommit(pTq->pMetaDB, txn) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
tEncoderClear(&encoder);
|
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) <
|
if (tdbBegin(pTq->pMetaDB, &txn, tdbDefaultMalloc, tdbDefaultFree, NULL, TDB_TXN_WRITE | TDB_TXN_READ_UNCOMMITTED) <
|
||||||
0) {
|
0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tdbTbDelete(pTq->pExecStore, key, (int)strlen(key), txn) < 0) {
|
if (tdbTbDelete(pTq->pExecStore, key, (int)strlen(key), txn) < 0) {
|
||||||
/*ASSERT(0);*/
|
/*tAssert(0);*/
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tdbCommit(pTq->pMetaDB, txn) < 0) {
|
if (tdbCommit(pTq->pMetaDB, txn) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tdbPostCommit(pTq->pMetaDB, txn) < 0) {
|
if (tdbPostCommit(pTq->pMetaDB, txn) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -264,7 +264,7 @@ int32_t tqMetaDeleteHandle(STQ* pTq, const char* key) {
|
||||||
int32_t tqMetaRestoreHandle(STQ* pTq) {
|
int32_t tqMetaRestoreHandle(STQ* pTq) {
|
||||||
TBC* pCur = NULL;
|
TBC* pCur = NULL;
|
||||||
if (tdbTbcOpen(pTq->pExecStore, &pCur, NULL) < 0) {
|
if (tdbTbcOpen(pTq->pExecStore, &pCur, NULL) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -284,7 +284,7 @@ int32_t tqMetaRestoreHandle(STQ* pTq) {
|
||||||
|
|
||||||
handle.pRef = walOpenRef(pTq->pVnode->pWal);
|
handle.pRef = walOpenRef(pTq->pVnode->pWal);
|
||||||
if (handle.pRef == NULL) {
|
if (handle.pRef == NULL) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
walRefVer(handle.pRef, handle.snapshotVer);
|
walRefVer(handle.pRef, handle.snapshotVer);
|
||||||
|
|
|
@ -40,25 +40,25 @@ int32_t tqOffsetRestoreFromFile(STqOffsetStore* pStore, const char* fname) {
|
||||||
if (code == 0) {
|
if (code == 0) {
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
// TODO handle error
|
// TODO handle error
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int32_t size = htonl(head.size);
|
int32_t size = htonl(head.size);
|
||||||
void* memBuf = taosMemoryCalloc(1, size);
|
void* memBuf = taosMemoryCalloc(1, size);
|
||||||
if ((code = taosReadFile(pFile, memBuf, size)) != size) {
|
if ((code = taosReadFile(pFile, memBuf, size)) != size) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
// TODO handle error
|
// TODO handle error
|
||||||
}
|
}
|
||||||
STqOffset offset;
|
STqOffset offset;
|
||||||
SDecoder decoder;
|
SDecoder decoder;
|
||||||
tDecoderInit(&decoder, memBuf, size);
|
tDecoderInit(&decoder, memBuf, size);
|
||||||
if (tDecodeSTqOffset(&decoder, &offset) < 0) {
|
if (tDecodeSTqOffset(&decoder, &offset) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
tDecoderClear(&decoder);
|
tDecoderClear(&decoder);
|
||||||
if (taosHashPut(pStore->pHash, offset.subKey, strlen(offset.subKey), &offset, sizeof(STqOffset)) < 0) {
|
if (taosHashPut(pStore->pHash, offset.subKey, strlen(offset.subKey), &offset, sizeof(STqOffset)) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
taosMemoryFree(memBuf);
|
taosMemoryFree(memBuf);
|
||||||
|
@ -85,7 +85,7 @@ STqOffsetStore* tqOffsetOpen(STQ* pTq) {
|
||||||
}
|
}
|
||||||
char* fname = tqOffsetBuildFName(pStore->pTq->path, 0);
|
char* fname = tqOffsetBuildFName(pStore->pTq->path, 0);
|
||||||
if (tqOffsetRestoreFromFile(pStore, fname) < 0) {
|
if (tqOffsetRestoreFromFile(pStore, fname) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
taosMemoryFree(fname);
|
taosMemoryFree(fname);
|
||||||
return pStore;
|
return pStore;
|
||||||
|
@ -124,7 +124,7 @@ int32_t tqOffsetCommitFile(STqOffsetStore* pStore) {
|
||||||
const char* sysErrStr = strerror(errno);
|
const char* sysErrStr = strerror(errno);
|
||||||
tqError("vgId:%d, cannot open file %s when commit offset since %s", pStore->pTq->pVnode->config.vgId, fname,
|
tqError("vgId:%d, cannot open file %s when commit offset since %s", pStore->pTq->pVnode->config.vgId, fname,
|
||||||
sysErrStr);
|
sysErrStr);
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
taosMemoryFree(fname);
|
taosMemoryFree(fname);
|
||||||
|
@ -138,7 +138,7 @@ int32_t tqOffsetCommitFile(STqOffsetStore* pStore) {
|
||||||
tEncodeSize(tEncodeSTqOffset, pOffset, bodyLen, code);
|
tEncodeSize(tEncodeSTqOffset, pOffset, bodyLen, code);
|
||||||
ASSERT(code == 0);
|
ASSERT(code == 0);
|
||||||
if (code < 0) {
|
if (code < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
taosHashCancelIterate(pStore->pHash, pIter);
|
taosHashCancelIterate(pStore->pHash, pIter);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -154,7 +154,7 @@ int32_t tqOffsetCommitFile(STqOffsetStore* pStore) {
|
||||||
// write file
|
// write file
|
||||||
int64_t writeLen;
|
int64_t writeLen;
|
||||||
if ((writeLen = taosWriteFile(pFile, buf, totLen)) != totLen) {
|
if ((writeLen = taosWriteFile(pFile, buf, totLen)) != totLen) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
tqError("write offset incomplete, len %d, write len %" PRId64, bodyLen, writeLen);
|
tqError("write offset incomplete, len %d, write len %" PRId64, bodyLen, writeLen);
|
||||||
taosHashCancelIterate(pStore->pHash, pIter);
|
taosHashCancelIterate(pStore->pHash, pIter);
|
||||||
taosMemoryFree(buf);
|
taosMemoryFree(buf);
|
||||||
|
|
|
@ -61,7 +61,7 @@ int32_t tqOffsetSnapRead(STqOffsetReader* pReader, uint8_t** ppData) {
|
||||||
|
|
||||||
int64_t sz = 0;
|
int64_t sz = 0;
|
||||||
if (taosStatFile(fname, &sz, NULL) < 0) {
|
if (taosStatFile(fname, &sz, NULL) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
taosMemoryFree(fname);
|
taosMemoryFree(fname);
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ int32_t tqOffsetSnapRead(STqOffsetReader* pReader, uint8_t** ppData) {
|
||||||
void* abuf = POINTER_SHIFT(buf, sizeof(SSnapDataHdr));
|
void* abuf = POINTER_SHIFT(buf, sizeof(SSnapDataHdr));
|
||||||
int64_t contLen = taosReadFile(pFile, abuf, sz);
|
int64_t contLen = taosReadFile(pFile, abuf, sz);
|
||||||
if (contLen != sz) {
|
if (contLen != sz) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
buf->size = sz;
|
buf->size = sz;
|
||||||
|
@ -122,14 +122,14 @@ int32_t tqOffsetWriterClose(STqOffsetWriter** ppWriter, int8_t rollback) {
|
||||||
|
|
||||||
if (rollback) {
|
if (rollback) {
|
||||||
if (taosRemoveFile(pWriter->fname) < 0) {
|
if (taosRemoveFile(pWriter->fname) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (taosRenameFile(pWriter->fname, fname) < 0) {
|
if (taosRenameFile(pWriter->fname, fname) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
if (tqOffsetRestoreFromFile(pTq->pOffsetStore, fname) < 0) {
|
if (tqOffsetRestoreFromFile(pTq->pOffsetStore, fname) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
taosMemoryFree(fname);
|
taosMemoryFree(fname);
|
||||||
|
@ -150,10 +150,10 @@ int32_t tqOffsetSnapWrite(STqOffsetWriter* pWriter, uint8_t* pData, uint32_t nDa
|
||||||
if (pFile) {
|
if (pFile) {
|
||||||
int64_t contLen = taosWriteFile(pFile, pHdr->data, size);
|
int64_t contLen = taosWriteFile(pFile, pHdr->data, size);
|
||||||
if (contLen != size) {
|
if (contLen != size) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -27,7 +27,7 @@ static int32_t tqLoopExecFromQueue(STQ* pTq, STqHandle* pHandle, SStreamDataSubm
|
||||||
while (pSubmit != NULL) {
|
while (pSubmit != NULL) {
|
||||||
ASSERT(pSubmit->ver == pHandle->pushHandle.processedVer + 1);
|
ASSERT(pSubmit->ver == pHandle->pushHandle.processedVer + 1);
|
||||||
if (tqLogScanExec(pTq, &pHandle->execHandle, pSubmit->data, pRsp, 0) < 0) {
|
if (tqLogScanExec(pTq, &pHandle->execHandle, pSubmit->data, pRsp, 0) < 0) {
|
||||||
/*ASSERT(0);*/
|
/*tAssert(0);*/
|
||||||
}
|
}
|
||||||
// update processed
|
// update processed
|
||||||
atomic_store_64(&pHandle->pushHandle.processedVer, pSubmit->ver);
|
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);
|
tqLogScanExec(pTq, &pHandle->execHandle, pReq, &rsp, workerId);
|
||||||
} else {
|
} else {
|
||||||
// TODO
|
// TODO
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rsp.blockNum == 0) {
|
if (rsp.blockNum == 0) {
|
||||||
|
@ -263,7 +263,7 @@ int tqPushMsg(STQ* pTq, void* msg, int32_t msgLen, tmsg_t msgType, int64_t ver)
|
||||||
SSDataBlock* pDataBlock = NULL;
|
SSDataBlock* pDataBlock = NULL;
|
||||||
uint64_t ts = 0;
|
uint64_t ts = 0;
|
||||||
if (qExecTask(task, &pDataBlock, &ts) < 0) {
|
if (qExecTask(task, &pDataBlock, &ts) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pDataBlock == NULL) {
|
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);
|
void* key = taosArrayGetP(cachedKeys, i);
|
||||||
size_t kLen = *(size_t*)taosArrayGet(cachedKeyLens, i);
|
size_t kLen = *(size_t*)taosArrayGet(cachedKeyLens, i);
|
||||||
if (taosHashRemove(pTq->pPushMgr, key, kLen) != 0) {
|
if (taosHashRemove(pTq->pPushMgr, key, kLen) != 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
taosArrayDestroyP(cachedKeys, (FDelete)taosMemoryFree);
|
taosArrayDestroyP(cachedKeys, (FDelete)taosMemoryFree);
|
||||||
|
|
|
@ -177,7 +177,7 @@ bool isValValidForTable(STqHandle* pHandle, SWalCont* pHead) {
|
||||||
}
|
}
|
||||||
realTbSuid = req.suid;
|
realTbSuid = req.suid;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
end:
|
end:
|
||||||
|
@ -206,7 +206,7 @@ int64_t tqFetchLog(STQ* pTq, STqHandle* pHandle, int64_t* fetchOffset, SWalCkHea
|
||||||
code = walFetchBody(pHandle->pWalReader, ppCkHead);
|
code = walFetchBody(pHandle->pWalReader, ppCkHead);
|
||||||
|
|
||||||
if (code < 0) {
|
if (code < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
*fetchOffset = offset;
|
*fetchOffset = offset;
|
||||||
code = -1;
|
code = -1;
|
||||||
goto END;
|
goto END;
|
||||||
|
@ -220,7 +220,7 @@ int64_t tqFetchLog(STQ* pTq, STqHandle* pHandle, int64_t* fetchOffset, SWalCkHea
|
||||||
if (IS_META_MSG(pHead->msgType)) {
|
if (IS_META_MSG(pHead->msgType)) {
|
||||||
code = walFetchBody(pHandle->pWalReader, ppCkHead);
|
code = walFetchBody(pHandle->pWalReader, ppCkHead);
|
||||||
if (code < 0) {
|
if (code < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
*fetchOffset = offset;
|
*fetchOffset = offset;
|
||||||
code = -1;
|
code = -1;
|
||||||
goto END;
|
goto END;
|
||||||
|
@ -238,7 +238,7 @@ int64_t tqFetchLog(STQ* pTq, STqHandle* pHandle, int64_t* fetchOffset, SWalCkHea
|
||||||
}
|
}
|
||||||
code = walSkipFetchBody(pHandle->pWalReader, *ppCkHead);
|
code = walSkipFetchBody(pHandle->pWalReader, *ppCkHead);
|
||||||
if (code < 0) {
|
if (code < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
*fetchOffset = offset;
|
*fetchOffset = offset;
|
||||||
code = -1;
|
code = -1;
|
||||||
goto END;
|
goto END;
|
||||||
|
@ -340,7 +340,7 @@ int32_t tqNextBlock(STqReader* pReader, SFetchRet* ret) {
|
||||||
memset(&ret->data, 0, sizeof(SSDataBlock));
|
memset(&ret->data, 0, sizeof(SSDataBlock));
|
||||||
int32_t code = tqRetrieveDataBlock(&ret->data, pReader);
|
int32_t code = tqRetrieveDataBlock(&ret->data, pReader);
|
||||||
if (code != 0 || ret->data.info.rows == 0) {
|
if (code != 0 || ret->data.info.rows == 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
ret->fetchType = FETCH_TYPE__DATA;
|
ret->fetchType = FETCH_TYPE__DATA;
|
||||||
|
@ -453,7 +453,7 @@ int32_t tqRetrieveDataBlock(SSDataBlock* pBlock, STqReader* pReader) {
|
||||||
if (pReader->pSchema == NULL) {
|
if (pReader->pSchema == NULL) {
|
||||||
tqWarn("cannot found tsschema for table: uid:%" PRId64 " (suid:%" PRId64 "), version %d, possibly dropped table",
|
tqWarn("cannot found tsschema for table: uid:%" PRId64 " (suid:%" PRId64 "), version %d, possibly dropped table",
|
||||||
pReader->msgIter.uid, pReader->msgIter.suid, pReader->cachedSchemaVer);
|
pReader->msgIter.uid, pReader->msgIter.suid, pReader->cachedSchemaVer);
|
||||||
/*ASSERT(0);*/
|
/*tAssert(0);*/
|
||||||
pReader->cachedSchemaSuid = 0;
|
pReader->cachedSchemaSuid = 0;
|
||||||
terrno = TSDB_CODE_TQ_TABLE_SCHEMA_NOT_FOUND;
|
terrno = TSDB_CODE_TQ_TABLE_SCHEMA_NOT_FOUND;
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -464,7 +464,7 @@ int32_t tqRetrieveDataBlock(SSDataBlock* pBlock, STqReader* pReader) {
|
||||||
if (pReader->pSchemaWrapper == NULL) {
|
if (pReader->pSchemaWrapper == NULL) {
|
||||||
tqWarn("cannot found schema wrapper for table: suid:%" PRId64 ", version %d, possibly dropped table",
|
tqWarn("cannot found schema wrapper for table: suid:%" PRId64 ", version %d, possibly dropped table",
|
||||||
pReader->msgIter.uid, pReader->cachedSchemaVer);
|
pReader->msgIter.uid, pReader->cachedSchemaVer);
|
||||||
/*ASSERT(0);*/
|
/*tAssert(0);*/
|
||||||
pReader->cachedSchemaSuid = 0;
|
pReader->cachedSchemaSuid = 0;
|
||||||
terrno = TSDB_CODE_TQ_TABLE_SCHEMA_NOT_FOUND;
|
terrno = TSDB_CODE_TQ_TABLE_SCHEMA_NOT_FOUND;
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -566,7 +566,7 @@ int32_t tqRetrieveTaosxBlock(STqReader* pReader, SArray* blocks, SArray* schemas
|
||||||
if (pReader->pSchema == NULL) {
|
if (pReader->pSchema == NULL) {
|
||||||
tqWarn("cannot found tsschema for table: uid:%" PRId64 " (suid:%" PRId64 "), version %d, possibly dropped table",
|
tqWarn("cannot found tsschema for table: uid:%" PRId64 " (suid:%" PRId64 "), version %d, possibly dropped table",
|
||||||
pReader->msgIter.uid, pReader->msgIter.suid, pReader->cachedSchemaVer);
|
pReader->msgIter.uid, pReader->msgIter.suid, pReader->cachedSchemaVer);
|
||||||
/*ASSERT(0);*/
|
/*tAssert(0);*/
|
||||||
pReader->cachedSchemaSuid = 0;
|
pReader->cachedSchemaSuid = 0;
|
||||||
terrno = TSDB_CODE_TQ_TABLE_SCHEMA_NOT_FOUND;
|
terrno = TSDB_CODE_TQ_TABLE_SCHEMA_NOT_FOUND;
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -577,7 +577,7 @@ int32_t tqRetrieveTaosxBlock(STqReader* pReader, SArray* blocks, SArray* schemas
|
||||||
if (pReader->pSchemaWrapper == NULL) {
|
if (pReader->pSchemaWrapper == NULL) {
|
||||||
tqWarn("cannot found schema wrapper for table: suid:%" PRId64 ", version %d, possibly dropped table",
|
tqWarn("cannot found schema wrapper for table: suid:%" PRId64 ", version %d, possibly dropped table",
|
||||||
pReader->msgIter.uid, pReader->cachedSchemaVer);
|
pReader->msgIter.uid, pReader->cachedSchemaVer);
|
||||||
/*ASSERT(0);*/
|
/*tAssert(0);*/
|
||||||
pReader->cachedSchemaSuid = 0;
|
pReader->cachedSchemaSuid = 0;
|
||||||
terrno = TSDB_CODE_TQ_TABLE_SCHEMA_NOT_FOUND;
|
terrno = TSDB_CODE_TQ_TABLE_SCHEMA_NOT_FOUND;
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -790,7 +790,7 @@ int32_t tqUpdateTbUidList(STQ* pTq, const SArray* tbUidList, bool isAdd) {
|
||||||
// TODO handle delete table from stb
|
// TODO handle delete table from stb
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (1) {
|
while (1) {
|
||||||
|
|
|
@ -335,7 +335,7 @@ void tqSinkToTablePipeline(SStreamTask* pTask, void* vnode, int64_t ver, void* d
|
||||||
tEncodeSize(tEncodeSBatchDeleteReq, &deleteReq, len, code);
|
tEncodeSize(tEncodeSBatchDeleteReq, &deleteReq, len, code);
|
||||||
if (code < 0) {
|
if (code < 0) {
|
||||||
//
|
//
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
SEncoder encoder;
|
SEncoder encoder;
|
||||||
void* serializedDeleteReq = rpcMallocCont(len + sizeof(SMsgHead));
|
void* serializedDeleteReq = rpcMallocCont(len + sizeof(SMsgHead));
|
||||||
|
@ -572,7 +572,7 @@ void tqSinkToTableMerge(SStreamTask* pTask, void* vnode, int64_t ver, void* data
|
||||||
tEncodeSize(tEncodeSBatchDeleteReq, &deleteReq, len, code);
|
tEncodeSize(tEncodeSBatchDeleteReq, &deleteReq, len, code);
|
||||||
if (code < 0) {
|
if (code < 0) {
|
||||||
//
|
//
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
SEncoder encoder;
|
SEncoder encoder;
|
||||||
void* serializedDeleteReq = rpcMallocCont(len + sizeof(SMsgHead));
|
void* serializedDeleteReq = rpcMallocCont(len + sizeof(SMsgHead));
|
||||||
|
|
|
@ -168,7 +168,7 @@ int32_t tqSnapWriterClose(STqSnapWriter** ppWriter, int8_t rollback) {
|
||||||
|
|
||||||
if (rollback) {
|
if (rollback) {
|
||||||
tdbAbort(pWriter->pTq->pMetaDB, pWriter->txn);
|
tdbAbort(pWriter->pTq->pMetaDB, pWriter->txn);
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
} else {
|
} else {
|
||||||
code = tdbCommit(pWriter->pTq->pMetaDB, pWriter->txn);
|
code = tdbCommit(pWriter->pTq->pMetaDB, pWriter->txn);
|
||||||
if (code) goto _err;
|
if (code) goto _err;
|
||||||
|
|
|
@ -168,7 +168,7 @@ int32_t tqSnapWriterClose(STqSnapWriter** ppWriter, int8_t rollback) {
|
||||||
|
|
||||||
if (rollback) {
|
if (rollback) {
|
||||||
tdbAbort(pWriter->pTq->pMetaStore, pWriter->txn);
|
tdbAbort(pWriter->pTq->pMetaStore, pWriter->txn);
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
} else {
|
} else {
|
||||||
code = tdbCommit(pWriter->pTq->pMetaStore, pWriter->txn);
|
code = tdbCommit(pWriter->pTq->pMetaStore, pWriter->txn);
|
||||||
if (code) goto _err;
|
if (code) goto _err;
|
||||||
|
|
|
@ -525,7 +525,7 @@ static int32_t getNextRowFromFSLast(void *iter, TSDBROW **ppRow) {
|
||||||
|
|
||||||
return code;
|
return code;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -723,7 +723,7 @@ static int32_t getNextRowFromFS(void *iter, TSDBROW **ppRow) {
|
||||||
|
|
||||||
return code;
|
return code;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -822,7 +822,7 @@ static int32_t getNextRowFromMem(void *iter, TSDBROW **ppRow) {
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1137,7 +1137,7 @@ static int32_t tsdbNextCommitRow(SCommitter *pCommitter) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// compare with min in RB Tree
|
// compare with min in RB Tree
|
||||||
|
|
|
@ -135,7 +135,7 @@ int32_t tsdbDFileRollback(STsdb *pTsdb, SDFileSet *pSet, EDataFileT ftype) {
|
||||||
tPutSmaFile(hdr, pSet->pSmaF);
|
tPutSmaFile(hdr, pSet->pSmaF);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
taosCalcChecksumAppend(0, hdr, TSDB_FHDR_SIZE);
|
taosCalcChecksumAppend(0, hdr, TSDB_FHDR_SIZE);
|
||||||
|
|
|
@ -260,7 +260,7 @@ static void updateBlockSMAInfo(STSchema* pSchema, SBlockLoadSuppInfo* pSupInfo)
|
||||||
// do nothing
|
// do nothing
|
||||||
i += 1;
|
i += 1;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1446,7 +1446,7 @@ static int32_t findFileBlockInfoIndex(SDataBlockIter* pBlockIter, SFileDataBlock
|
||||||
index += step;
|
index += step;
|
||||||
}
|
}
|
||||||
|
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1991,7 +1991,7 @@ static int32_t mergeFileBlockAndLastBlock(STsdbReader* pReader, SLastBlockReader
|
||||||
tRowMergerClear(&merge);
|
tRowMergerClear(&merge);
|
||||||
return code;
|
return code;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
} else { // desc order
|
} else { // desc order
|
||||||
|
@ -3174,7 +3174,7 @@ bool hasBeenDropped(const SArray* pDelList, int32_t* index, TSDBKEY* pKey, int32
|
||||||
} else if (pKey->ts == pFirst->ts) {
|
} else if (pKey->ts == pFirst->ts) {
|
||||||
return pFirst->version >= pKey->version;
|
return pFirst->version >= pKey->version;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
TSDBKEY* pCurrent = taosArrayGet(pDelList, *index);
|
TSDBKEY* pCurrent = taosArrayGet(pDelList, *index);
|
||||||
|
|
|
@ -106,7 +106,7 @@ _exit:
|
||||||
|
|
||||||
_err:
|
_err:
|
||||||
tsdbError("vgId:%d, tsdb do retention failed since %s", TD_VID(pTsdb->pVnode), tstrerror(code));
|
tsdbError("vgId:%d, tsdb do retention failed since %s", TD_VID(pTsdb->pVnode), tstrerror(code));
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
// tsdbFSRollback(pTsdb->pFS);
|
// tsdbFSRollback(pTsdb->pFS);
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
|
@ -239,7 +239,7 @@ static int32_t tsdbSnapNextRow(STsdbSnapReader* pReader) {
|
||||||
|
|
||||||
pReader->pIter = NULL;
|
pReader->pIter = NULL;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -935,7 +935,7 @@ static int32_t tsdbSnapWriteToDataFile(STsdbSnapWriter* pWriter, int32_t iRow, i
|
||||||
code = tBlockDataAppendRow(&pWriter->dWriter.bData, &trow, NULL, id.uid);
|
code = tBlockDataAppendRow(&pWriter->dWriter.bData, &trow, NULL, id.uid);
|
||||||
if (code) goto _err;
|
if (code) goto _err;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pWriter->dWriter.bData.nRow >= pWriter->maxRow) {
|
if (pWriter->dWriter.bData.nRow >= pWriter->maxRow) {
|
||||||
|
@ -1368,7 +1368,7 @@ int32_t tsdbSnapWriterClose(STsdbSnapWriter** ppWriter, int8_t rollback) {
|
||||||
STsdb* pTsdb = pWriter->pTsdb;
|
STsdb* pTsdb = pWriter->pTsdb;
|
||||||
|
|
||||||
if (rollback) {
|
if (rollback) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
// code = tsdbFSRollback(pWriter->pTsdb->pFS);
|
// code = tsdbFSRollback(pWriter->pTsdb->pFS);
|
||||||
// if (code) goto _err;
|
// if (code) goto _err;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -544,7 +544,7 @@ int32_t tsdbFidLevel(int32_t fid, STsdbKeepCfg *pKeepCfg, int64_t now) {
|
||||||
} else if (pKeepCfg->precision == TSDB_TIME_PRECISION_NANO) {
|
} else if (pKeepCfg->precision == TSDB_TIME_PRECISION_NANO) {
|
||||||
now = now * 1000000000l;
|
now = now * 1000000000l;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
key = now - pKeepCfg->keep0 * tsTickPerMin[pKeepCfg->precision];
|
key = now - pKeepCfg->keep0 * tsTickPerMin[pKeepCfg->precision];
|
||||||
|
@ -585,7 +585,7 @@ void tsdbRowGetColVal(TSDBROW *pRow, STSchema *pTSchema, int32_t iCol, SColVal *
|
||||||
*pColVal = COL_VAL_NONE(pTColumn->colId, pTColumn->type);
|
*pColVal = COL_VAL_NONE(pTColumn->colId, pTColumn->type);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -614,7 +614,7 @@ void tsdbRowIterInit(STSDBRowIter *pIter, TSDBROW *pRow, STSchema *pTSchema) {
|
||||||
pIter->pTSchema = NULL;
|
pIter->pTSchema = NULL;
|
||||||
pIter->i = 0;
|
pIter->i = 0;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -797,7 +797,7 @@ int32_t tRowMerge(SRowMerger *pMerger, TSDBROW *pRow) {
|
||||||
taosArraySet(pMerger->pArray, iCol, pColVal);
|
taosArraySet(pMerger->pArray, iCol, pColVal);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1123,7 +1123,7 @@ static int32_t tBlockDataAppendTPRow(SBlockData *pBlockData, STSRow *pRow, STSch
|
||||||
code = tColDataAppendValue(pColData, &COL_VAL_NULL(pColData->cid, pColData->type));
|
code = tColDataAppendValue(pColData, &COL_VAL_NULL(pColData->cid, pColData->type));
|
||||||
if (code) goto _exit;
|
if (code) goto _exit;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cv.flag = CV_FLAG_VALUE;
|
cv.flag = CV_FLAG_VALUE;
|
||||||
|
@ -1211,7 +1211,7 @@ static int32_t tBlockDataAppendKVRow(SBlockData *pBlockData, STSRow *pRow, STSch
|
||||||
code = tColDataAppendValue(pColData, &COL_VAL_NULL(pColData->cid, pColData->type));
|
code = tColDataAppendValue(pColData, &COL_VAL_NULL(pColData->cid, pColData->type));
|
||||||
if (code) goto _exit;
|
if (code) goto _exit;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
iTColumn++;
|
iTColumn++;
|
||||||
|
@ -1253,7 +1253,7 @@ int32_t tBlockDataAppendRow(SBlockData *pBlockData, TSDBROW *pRow, STSchema *pTS
|
||||||
code = tBlockDataAppendKVRow(pBlockData, pRow->pTSRow, pTSchema);
|
code = tBlockDataAppendKVRow(pBlockData, pRow->pTSRow, pTSchema);
|
||||||
if (code) goto _err;
|
if (code) goto _err;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
code = tBlockDataAppendBlockRow(pBlockData, pRow->pBlockData, pRow->iRow);
|
code = tBlockDataAppendBlockRow(pBlockData, pRow->pBlockData, pRow->iRow);
|
||||||
|
@ -1348,7 +1348,7 @@ int32_t tBlockDataMerge(SBlockData *pBlockData1, SBlockData *pBlockData2, SBlock
|
||||||
pRow2 = NULL;
|
pRow2 = NULL;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,7 @@ int vnodeGetTableMeta(SVnode *pVnode, SRpcMsg *pMsg, bool direct) {
|
||||||
} else if (mer1.me.type == TSDB_NORMAL_TABLE) {
|
} else if (mer1.me.type == TSDB_NORMAL_TABLE) {
|
||||||
schema = mer1.me.ntbEntry.schemaRow;
|
schema = mer1.me.ntbEntry.schemaRow;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
metaRsp.numOfTags = schemaTag.nCols;
|
metaRsp.numOfTags = schemaTag.nCols;
|
||||||
|
@ -210,7 +210,7 @@ int vnodeGetTableCfg(SVnode *pVnode, SRpcMsg *pMsg, bool direct) {
|
||||||
cfgRsp.pComment = strdup(mer1.me.ntbEntry.comment);
|
cfgRsp.pComment = strdup(mer1.me.ntbEntry.comment);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
cfgRsp.numOfTags = schemaTag.nCols;
|
cfgRsp.numOfTags = schemaTag.nCols;
|
||||||
|
|
|
@ -321,7 +321,7 @@ int32_t vnodeSnapWriterClose(SVSnapWriter *pWriter, int8_t rollback, SSnapshot *
|
||||||
|
|
||||||
vnodeBegin(pVnode);
|
vnodeBegin(pVnode);
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
_exit:
|
_exit:
|
||||||
|
|
|
@ -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);
|
createResSchema(pType->type, pType->bytes, slotId, pType->scale, pType->precision, pCaseNode->node.aliasName);
|
||||||
pExp->pExpr->_optrRoot.pRootNode = pNode;
|
pExp->pExpr->_optrRoot.pRootNode = pNode;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1572,7 +1572,7 @@ void relocateColumnData(SSDataBlock* pBlock, const SArray* pColMatchInfo, SArray
|
||||||
} else if (p->info.colId < pmInfo->colId) {
|
} else if (p->info.colId < pmInfo->colId) {
|
||||||
i++;
|
i++;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -130,7 +130,7 @@ static int32_t doSetStreamBlock(SOperatorInfo* pOperator, void* input, size_t nu
|
||||||
}
|
}
|
||||||
pInfo->blockType = STREAM_INPUT__DATA_BLOCK;
|
pInfo->blockType = STREAM_INPUT__DATA_BLOCK;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
|
@ -869,7 +869,7 @@ int32_t qStreamSetParamForRecover(qTaskInfo_t tinfo) {
|
||||||
if (pOperator->numOfDownstream != 1 || pOperator->pDownstream[0] == NULL) {
|
if (pOperator->numOfDownstream != 1 || pOperator->pDownstream[0] == NULL) {
|
||||||
if (pOperator->numOfDownstream > 1) {
|
if (pOperator->numOfDownstream > 1) {
|
||||||
qError("unexpected stream, multiple downstream");
|
qError("unexpected stream, multiple downstream");
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -926,7 +926,7 @@ int32_t qStreamRestoreParam(qTaskInfo_t tinfo) {
|
||||||
if (pOperator->numOfDownstream != 1 || pOperator->pDownstream[0] == NULL) {
|
if (pOperator->numOfDownstream != 1 || pOperator->pDownstream[0] == NULL) {
|
||||||
if (pOperator->numOfDownstream > 1) {
|
if (pOperator->numOfDownstream > 1) {
|
||||||
qError("unexpected stream, multiple downstream");
|
qError("unexpected stream, multiple downstream");
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1038,7 +1038,7 @@ int32_t qStreamPrepareScan(qTaskInfo_t tinfo, STqOffsetVal* pOffset, int8_t subT
|
||||||
pInfo->tqReader->pWalReader->curVersion != pOffset->version) {
|
pInfo->tqReader->pWalReader->curVersion != pOffset->version) {
|
||||||
qError("prepare scan ver %" PRId64 " actual ver %" PRId64 ", last %" PRId64, pOffset->version,
|
qError("prepare scan ver %" PRId64 " actual ver %" PRId64 ", last %" PRId64, pOffset->version,
|
||||||
pInfo->tqReader->pWalReader->curVersion, pTaskInfo->streamInfo.lastStatus.version);
|
pInfo->tqReader->pWalReader->curVersion, pTaskInfo->streamInfo.lastStatus.version);
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (tqSeekVer(pInfo->tqReader, pOffset->version + 1) < 0) {
|
if (tqSeekVer(pInfo->tqReader, pOffset->version + 1) < 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,
|
if (tsdbReaderOpen(pTableScanInfo->base.readHandle.vnode, &pTableScanInfo->base.cond, pList, num,
|
||||||
pTableScanInfo->pResBlock, &pTableScanInfo->base.dataReader, NULL) < 0 ||
|
pTableScanInfo->pResBlock, &pTableScanInfo->base.dataReader, NULL) < 0 ||
|
||||||
pTableScanInfo->base.dataReader == NULL) {
|
pTableScanInfo->base.dataReader == NULL) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1107,7 +1107,7 @@ int32_t qStreamPrepareScan(qTaskInfo_t tinfo, STqOffsetVal* pOffset, int8_t subT
|
||||||
ts, pTableScanInfo->currentTable, numOfTables);
|
ts, pTableScanInfo->currentTable, numOfTables);
|
||||||
/*}*/
|
/*}*/
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
} else if (pOffset->type == TMQ_OFFSET__SNAPSHOT_DATA) {
|
} else if (pOffset->type == TMQ_OFFSET__SNAPSHOT_DATA) {
|
||||||
SStreamRawScanInfo* pInfo = pOperator->info;
|
SStreamRawScanInfo* pInfo = pOperator->info;
|
||||||
|
|
|
@ -571,7 +571,7 @@ static int32_t doCreateConstantValColumnAggInfo(SInputColumnInfoData* pInput, SF
|
||||||
} else if (type == TSDB_DATA_TYPE_TIMESTAMP) {
|
} else if (type == TSDB_DATA_TYPE_TIMESTAMP) {
|
||||||
// do nothing
|
// do nothing
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
|
@ -1579,7 +1579,7 @@ void destroyOperatorInfo(SOperatorInfo* pOperator) {
|
||||||
// each operator should be set their own function to return total cost buffer
|
// each operator should be set their own function to return total cost buffer
|
||||||
int32_t optrDefaultBufFn(SOperatorInfo* pOperator) {
|
int32_t optrDefaultBufFn(SOperatorInfo* pOperator) {
|
||||||
if (pOperator->blocking) {
|
if (pOperator->blocking) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -2090,7 +2090,7 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
|
||||||
} else if (QUERY_NODE_PHYSICAL_PLAN_PROJECT == type) {
|
} else if (QUERY_NODE_PHYSICAL_PLAN_PROJECT == type) {
|
||||||
pOperator = createProjectOperatorInfo(NULL, (SProjectPhysiNode*)pPhyNode, pTaskInfo);
|
pOperator = createProjectOperatorInfo(NULL, (SProjectPhysiNode*)pPhyNode, pTaskInfo);
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pOperator != NULL) {
|
if (pOperator != NULL) {
|
||||||
|
@ -2182,7 +2182,7 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
|
||||||
} else if (QUERY_NODE_PHYSICAL_PLAN_INTERP_FUNC == type) {
|
} else if (QUERY_NODE_PHYSICAL_PLAN_INTERP_FUNC == type) {
|
||||||
pOptr = createTimeSliceOperatorInfo(ops[0], pPhyNode, pTaskInfo);
|
pOptr = createTimeSliceOperatorInfo(ops[0], pPhyNode, pTaskInfo);
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
taosMemoryFree(ops);
|
taosMemoryFree(ops);
|
||||||
|
@ -2219,13 +2219,13 @@ int32_t extractTableScanNode(SPhysiNode* pNode, STableScanPhysiNode** ppNode) {
|
||||||
*ppNode = (STableScanPhysiNode*)pNode;
|
*ppNode = (STableScanPhysiNode*)pNode;
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
terrno = TSDB_CODE_APP_ERROR;
|
terrno = TSDB_CODE_APP_ERROR;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (LIST_LENGTH(pNode->pChildren) != 1) {
|
if (LIST_LENGTH(pNode->pChildren) != 1) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
terrno = TSDB_CODE_APP_ERROR;
|
terrno = TSDB_CODE_APP_ERROR;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -2244,7 +2244,7 @@ int32_t rebuildReader(SOperatorInfo* pOperator, SSubplan* plan, SReadHandle* pHa
|
||||||
|
|
||||||
STableScanPhysiNode* pNode = NULL;
|
STableScanPhysiNode* pNode = NULL;
|
||||||
if (extractTableScanNode(plan->pNode, &pNode) < 0) {
|
if (extractTableScanNode(plan->pNode, &pNode) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
tsdbReaderClose(pTableScanInfo->dataReader);
|
tsdbReaderClose(pTableScanInfo->dataReader);
|
||||||
|
@ -2252,7 +2252,7 @@ int32_t rebuildReader(SOperatorInfo* pOperator, SSubplan* plan, SReadHandle* pHa
|
||||||
STableListInfo info = {0};
|
STableListInfo info = {0};
|
||||||
pTableScanInfo->dataReader = doCreateDataReader(pNode, pHandle, &info, NULL);
|
pTableScanInfo->dataReader = doCreateDataReader(pNode, pHandle, &info, NULL);
|
||||||
if (pTableScanInfo->dataReader == NULL) {
|
if (pTableScanInfo->dataReader == NULL) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
qError("failed to create data reader");
|
qError("failed to create data reader");
|
||||||
return TSDB_CODE_APP_ERROR;
|
return TSDB_CODE_APP_ERROR;
|
||||||
}
|
}
|
||||||
|
|
|
@ -680,7 +680,7 @@ void setDeleteFillValueInfo(TSKEY start, TSKEY end, SStreamFillSupporter* pFillS
|
||||||
pFillInfo->pLinearInfo->winIndex = 0;
|
pFillInfo->pLinearInfo->winIndex = 0;
|
||||||
} break;
|
} break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -811,7 +811,7 @@ void setFillValueInfo(SSDataBlock* pBlock, TSKEY ts, int32_t rowId, SStreamFillS
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ASSERT(pFillInfo->pos != FILL_POS_INVALID);
|
ASSERT(pFillInfo->pos != FILL_POS_INVALID);
|
||||||
|
@ -1269,7 +1269,7 @@ static SSDataBlock* doStreamFill(SOperatorInfo* pOperator) {
|
||||||
pInfo->srcRowIndex = 0;
|
pInfo->srcRowIndex = 0;
|
||||||
} break;
|
} break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -662,7 +662,7 @@ static int compareDataGroupInfo(const void* group1, const void* group2) {
|
||||||
const SDataGroupInfo* pGroupInfo2 = group2;
|
const SDataGroupInfo* pGroupInfo2 = group2;
|
||||||
|
|
||||||
if (pGroupInfo1->groupId == pGroupInfo2->groupId) {
|
if (pGroupInfo1->groupId == pGroupInfo2->groupId) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1533,7 +1533,7 @@ static SSDataBlock* doQueueScan(SOperatorInfo* pOperator) {
|
||||||
qError("submit msg messed up when initing stream submit block %p", pSubmit);
|
qError("submit msg messed up when initing stream submit block %p", pSubmit);
|
||||||
pInfo->tqReader->pMsg = NULL;
|
pInfo->tqReader->pMsg = NULL;
|
||||||
pTaskInfo->streamInfo.pReq = NULL;
|
pTaskInfo->streamInfo.pReq = NULL;
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1592,7 +1592,7 @@ static SSDataBlock* doQueueScan(SOperatorInfo* pOperator) {
|
||||||
if (ret.fetchType == FETCH_TYPE__DATA) {
|
if (ret.fetchType == FETCH_TYPE__DATA) {
|
||||||
blockDataCleanup(pInfo->pRes);
|
blockDataCleanup(pInfo->pRes);
|
||||||
if (setBlockIntoRes(pInfo, &ret.data, true) < 0) {
|
if (setBlockIntoRes(pInfo, &ret.data, true) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
if (pInfo->pRes->info.rows > 0) {
|
if (pInfo->pRes->info.rows > 0) {
|
||||||
pOperator->status = OP_EXEC_RECV;
|
pOperator->status = OP_EXEC_RECV;
|
||||||
|
@ -1600,7 +1600,7 @@ static SSDataBlock* doQueueScan(SOperatorInfo* pOperator) {
|
||||||
return pInfo->pRes;
|
return pInfo->pRes;
|
||||||
}
|
}
|
||||||
} else if (ret.fetchType == FETCH_TYPE__META) {
|
} else if (ret.fetchType == FETCH_TYPE__META) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
// pTaskInfo->streamInfo.lastStatus = ret.offset;
|
// pTaskInfo->streamInfo.lastStatus = ret.offset;
|
||||||
// pTaskInfo->streamInfo.metaBlk = ret.meta;
|
// pTaskInfo->streamInfo.metaBlk = ret.meta;
|
||||||
// return NULL;
|
// return NULL;
|
||||||
|
@ -1627,7 +1627,7 @@ static SSDataBlock* doQueueScan(SOperatorInfo* pOperator) {
|
||||||
return NULL;
|
return NULL;
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1701,26 +1701,26 @@ static SSDataBlock* doStreamScan(SOperatorInfo* pOperator) {
|
||||||
};
|
};
|
||||||
char tmp[100] = "abcdefg1";
|
char tmp[100] = "abcdefg1";
|
||||||
if (streamStatePut(pState, &key, &tmp, strlen(tmp) + 1) < 0) {
|
if (streamStatePut(pState, &key, &tmp, strlen(tmp) + 1) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
key.ts = 2;
|
key.ts = 2;
|
||||||
char tmp2[100] = "abcdefg2";
|
char tmp2[100] = "abcdefg2";
|
||||||
if (streamStatePut(pState, &key, &tmp2, strlen(tmp2) + 1) < 0) {
|
if (streamStatePut(pState, &key, &tmp2, strlen(tmp2) + 1) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
key.groupId = 5;
|
key.groupId = 5;
|
||||||
key.ts = 1;
|
key.ts = 1;
|
||||||
char tmp3[100] = "abcdefg3";
|
char tmp3[100] = "abcdefg3";
|
||||||
if (streamStatePut(pState, &key, &tmp3, strlen(tmp3) + 1) < 0) {
|
if (streamStatePut(pState, &key, &tmp3, strlen(tmp3) + 1) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
char* val2 = NULL;
|
char* val2 = NULL;
|
||||||
int32_t sz;
|
int32_t sz;
|
||||||
if (streamStateGet(pState, &key, (void**)&val2, &sz) < 0) {
|
if (streamStateGet(pState, &key, (void**)&val2, &sz) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
printf("stream read %s %d\n", val2, sz);
|
printf("stream read %s %d\n", val2, sz);
|
||||||
streamFreeVal(val2);
|
streamFreeVal(val2);
|
||||||
|
@ -2001,7 +2001,7 @@ FETCH_NEXT_BLOCK:
|
||||||
|
|
||||||
goto NEXT_SUBMIT_BLK;
|
goto NEXT_SUBMIT_BLK;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -272,7 +272,7 @@ static void copyCurrentRowIntoBuf(SFillInfo* pFillInfo, int32_t rowIndex, SRowVa
|
||||||
|
|
||||||
saveColData(pRowVal->pRowVal, i, p, isNull);
|
saveColData(pRowVal->pRowVal, i, p, isNull);
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
#include "scalar.h"
|
#include "scalar.h"
|
||||||
#include "taoserror.h"
|
#include "taoserror.h"
|
||||||
#include "ttime.h"
|
#include "ttime.h"
|
||||||
|
#include "tlog.h"
|
||||||
|
|
||||||
static int32_t buildFuncErrMsg(char* pErrBuf, int32_t len, int32_t errCode, const char* pFormat, ...) {
|
static int32_t buildFuncErrMsg(char* pErrBuf, int32_t len, int32_t errCode, const char* pFormat, ...) {
|
||||||
va_list vArgList;
|
va_list vArgList;
|
||||||
|
@ -1354,7 +1355,7 @@ static int32_t translateCsum(SFunctionNode* pFunc, char* pErrBuf, int32_t len) {
|
||||||
} else if (IS_FLOAT_TYPE(colType)) {
|
} else if (IS_FLOAT_TYPE(colType)) {
|
||||||
resType = TSDB_DATA_TYPE_DOUBLE;
|
resType = TSDB_DATA_TYPE_DOUBLE;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2535,7 +2535,7 @@ static void doSetPrevVal(SDiffInfo* pDiffInfo, int32_t type, const char* pv, int
|
||||||
pDiffInfo->prev.d64 = *(double*)pv;
|
pDiffInfo->prev.d64 = *(double*)pv;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
pDiffInfo->prevTs = ts;
|
pDiffInfo->prevTs = ts;
|
||||||
}
|
}
|
||||||
|
@ -2615,7 +2615,7 @@ static void doHandleDiff(SDiffInfo* pDiffInfo, int32_t type, const char* pv, SCo
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2951,7 +2951,7 @@ static STuplePos doSaveTupleData(SSerializeDataHandle* pHandle, const void* pBuf
|
||||||
} else {
|
} else {
|
||||||
// other tuple save policy
|
// other tuple save policy
|
||||||
if (streamStateFuncPut(pHandle->pState, pKey, pBuf, length) < 0) {
|
if (streamStateFuncPut(pHandle->pState, pKey, pBuf, length) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
p.streamTupleKey = *pKey;
|
p.streamTupleKey = *pKey;
|
||||||
}
|
}
|
||||||
|
@ -4079,7 +4079,7 @@ static bool checkStateOp(int8_t op, SColumnInfoData* pCol, int32_t index, SVaria
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -5104,7 +5104,7 @@ int32_t twaFunction(SqlFunctionCtx* pCtx) {
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// the last interpolated time window value
|
// the last interpolated time window value
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
#include "tdatablock.h"
|
#include "tdatablock.h"
|
||||||
#include "tfunctionInt.h"
|
#include "tfunctionInt.h"
|
||||||
#include "tglobal.h"
|
#include "tglobal.h"
|
||||||
|
#include "tlog.h"
|
||||||
|
|
||||||
#define SET_VAL(_info, numOfElem, res) \
|
#define SET_VAL(_info, numOfElem, res) \
|
||||||
do { \
|
do { \
|
||||||
|
@ -620,7 +621,7 @@ int32_t avgFunction(SqlFunctionCtx* pCtx) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
numOfElem = doAddNumericVector(pCol, type, pInput, pAvgRes);
|
numOfElem = doAddNumericVector(pCol, type, pInput, pAvgRes);
|
||||||
|
|
|
@ -367,7 +367,7 @@ int32_t idxConvertData(void* src, int8_t type, void** dst) {
|
||||||
tlen = taosEncodeBinary(dst, src, strlen(src));
|
tlen = taosEncodeBinary(dst, src, strlen(src));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
*dst = (char*)*dst - tlen;
|
*dst = (char*)*dst - tlen;
|
||||||
|
@ -459,7 +459,7 @@ int32_t idxConvertDataToStr(void* src, int8_t type, void** dst) {
|
||||||
*dst = (char*)*dst - tlen;
|
*dst = (char*)*dst - tlen;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return tlen;
|
return tlen;
|
||||||
|
|
|
@ -393,7 +393,7 @@ char* parseTagDatatoJson(void* p) {
|
||||||
} else if (pTagVal->nData == 0) {
|
} else if (pTagVal->nData == 0) {
|
||||||
value = cJSON_CreateString("");
|
value = cJSON_CreateString("");
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
cJSON_AddItemToObject(json, tagJsonKey, value);
|
cJSON_AddItemToObject(json, tagJsonKey, value);
|
||||||
|
@ -412,7 +412,7 @@ char* parseTagDatatoJson(void* p) {
|
||||||
}
|
}
|
||||||
cJSON_AddItemToObject(json, tagJsonKey, value);
|
cJSON_AddItemToObject(json, tagJsonKey, value);
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
string = cJSON_PrintUnformatted(json);
|
string = cJSON_PrintUnformatted(json);
|
||||||
|
|
|
@ -98,7 +98,7 @@ static FORCE_INLINE _getDoubleValue_fn_t getVectorDoubleValueFn(int32_t srcType)
|
||||||
} else if (srcType == TSDB_DATA_TYPE_NULL) {
|
} else if (srcType == TSDB_DATA_TYPE_NULL) {
|
||||||
p = NULL;
|
p = NULL;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2598,7 +2598,7 @@ static bool checkStateOp(int8_t op, SColumnInfoData *pCol, int32_t index, SScala
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -85,7 +85,7 @@ void convertNumberToNumber(const void *inData, void *outData, int8_t inType, int
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -179,7 +179,7 @@ _getBigintValue_fn_t getVectorBigintValueFn(int32_t srcType) {
|
||||||
} else if (srcType == TSDB_DATA_TYPE_NULL) {
|
} else if (srcType == TSDB_DATA_TYPE_NULL) {
|
||||||
p = NULL;
|
p = NULL;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
@ -409,7 +409,7 @@ int32_t vectorConvertFromVarData(SSclVectorConvCtx *pCtx, int32_t *overflow) {
|
||||||
int32_t convertType = pCtx->inType;
|
int32_t convertType = pCtx->inType;
|
||||||
if (pCtx->inType == TSDB_DATA_TYPE_JSON) {
|
if (pCtx->inType == TSDB_DATA_TYPE_JSON) {
|
||||||
if (*data == TSDB_DATA_TYPE_NULL) {
|
if (*data == TSDB_DATA_TYPE_NULL) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
} else if (*data == TSDB_DATA_TYPE_NCHAR) {
|
} else if (*data == TSDB_DATA_TYPE_NCHAR) {
|
||||||
data += CHAR_BYTES;
|
data += CHAR_BYTES;
|
||||||
convertType = TSDB_DATA_TYPE_NCHAR;
|
convertType = TSDB_DATA_TYPE_NCHAR;
|
||||||
|
@ -543,11 +543,11 @@ bool convertJsonValue(__compar_fn_t *fp, int32_t optr, int8_t typeLeft, int8_t t
|
||||||
|
|
||||||
if (IS_NUMERIC_TYPE(type)) {
|
if (IS_NUMERIC_TYPE(type)) {
|
||||||
if (typeLeft == TSDB_DATA_TYPE_NCHAR) {
|
if (typeLeft == TSDB_DATA_TYPE_NCHAR) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
// convertNcharToDouble(*pLeftData, pLeftOut);
|
// convertNcharToDouble(*pLeftData, pLeftOut);
|
||||||
// *pLeftData = pLeftOut;
|
// *pLeftData = pLeftOut;
|
||||||
} else if (typeLeft == TSDB_DATA_TYPE_BINARY) {
|
} else if (typeLeft == TSDB_DATA_TYPE_BINARY) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
// convertBinaryToDouble(*pLeftData, pLeftOut);
|
// convertBinaryToDouble(*pLeftData, pLeftOut);
|
||||||
// *pLeftData = pLeftOut;
|
// *pLeftData = pLeftOut;
|
||||||
} else if (typeLeft != type) {
|
} else if (typeLeft != type) {
|
||||||
|
@ -556,11 +556,11 @@ bool convertJsonValue(__compar_fn_t *fp, int32_t optr, int8_t typeLeft, int8_t t
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeRight == TSDB_DATA_TYPE_NCHAR) {
|
if (typeRight == TSDB_DATA_TYPE_NCHAR) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
// convertNcharToDouble(*pRightData, pRightOut);
|
// convertNcharToDouble(*pRightData, pRightOut);
|
||||||
// *pRightData = pRightOut;
|
// *pRightData = pRightOut;
|
||||||
} else if (typeRight == TSDB_DATA_TYPE_BINARY) {
|
} else if (typeRight == TSDB_DATA_TYPE_BINARY) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
// convertBinaryToDouble(*pRightData, pRightOut);
|
// convertBinaryToDouble(*pRightData, pRightOut);
|
||||||
// *pRightData = pRightOut;
|
// *pRightData = pRightOut;
|
||||||
} else if (typeRight != type) {
|
} else if (typeRight != type) {
|
||||||
|
@ -577,7 +577,7 @@ bool convertJsonValue(__compar_fn_t *fp, int32_t optr, int8_t typeLeft, int8_t t
|
||||||
*freeRight = true;
|
*freeRight = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -1602,7 +1602,7 @@ int32_t doVectorCompareImpl(SScalarParam *pLeft, SScalarParam *pRight, SScalarPa
|
||||||
bool result = convertJsonValue(&fp, optr, GET_PARAM_TYPE(pLeft), GET_PARAM_TYPE(pRight), &pLeftData, &pRightData,
|
bool result = convertJsonValue(&fp, optr, GET_PARAM_TYPE(pLeft), GET_PARAM_TYPE(pRight), &pLeftData, &pRightData,
|
||||||
&leftOut, &rightOut, &isJsonnull, &freeLeft, &freeRight);
|
&leftOut, &rightOut, &isJsonnull, &freeLeft, &freeRight);
|
||||||
if (isJsonnull) {
|
if (isJsonnull) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pLeftData || !pRightData) {
|
if (!pLeftData || !pRightData) {
|
||||||
|
@ -1913,7 +1913,7 @@ _bin_scalar_fn_t getBinScalarOperatorFn(int32_t binFunctionId) {
|
||||||
case OP_TYPE_JSON_CONTAINS:
|
case OP_TYPE_JSON_CONTAINS:
|
||||||
return vectorJsonContains;
|
return vectorJsonContains;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -224,7 +224,7 @@ int32_t streamProcessDispatchRsp(SStreamTask* pTask, SStreamDispatchRsp* pRsp, i
|
||||||
ASSERT(old == TASK_OUTPUT_STATUS__WAIT);
|
ASSERT(old == TASK_OUTPUT_STATUS__WAIT);
|
||||||
if (pRsp->inputStatus == TASK_INPUT_STATUS__BLOCKED) {
|
if (pRsp->inputStatus == TASK_INPUT_STATUS__BLOCKED) {
|
||||||
// TODO: init recover timer
|
// TODO: init recover timer
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
// continue dispatch
|
// continue dispatch
|
||||||
|
|
|
@ -170,7 +170,7 @@ int32_t streamProcessCheckpointReq(SStreamMeta* pMeta, SStreamTask* pTask, SStre
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (code < 0) {
|
if (code < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -139,7 +139,7 @@ int32_t streamBroadcastToChildren(SStreamTask* pTask, const SSDataBlock* pBlock)
|
||||||
int32_t len;
|
int32_t len;
|
||||||
tEncodeSize(tEncodeStreamRetrieveReq, &req, len, code);
|
tEncodeSize(tEncodeStreamRetrieveReq, &req, len, code);
|
||||||
if (code < 0) {
|
if (code < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,7 +163,7 @@ int32_t streamBroadcastToChildren(SStreamTask* pTask, const SSDataBlock* pBlock)
|
||||||
};
|
};
|
||||||
|
|
||||||
if (tmsgSendReq(&pEpInfo->epSet, &rpcMsg) < 0) {
|
if (tmsgSendReq(&pEpInfo->epSet, &rpcMsg) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
goto CLEAR;
|
goto CLEAR;
|
||||||
}
|
}
|
||||||
buf = NULL;
|
buf = NULL;
|
||||||
|
@ -488,7 +488,7 @@ int32_t streamDispatchAllBlocks(SStreamTask* pTask, const SStreamDataBlock* pDat
|
||||||
}
|
}
|
||||||
return code;
|
return code;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -514,7 +514,7 @@ int32_t streamDispatch(SStreamTask* pTask) {
|
||||||
|
|
||||||
int32_t code = 0;
|
int32_t code = 0;
|
||||||
if (streamDispatchAllBlocks(pTask, pBlock) < 0) {
|
if (streamDispatchAllBlocks(pTask, pBlock) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
code = -1;
|
code = -1;
|
||||||
streamQueueProcessFail(pTask->outputQueue);
|
streamQueueProcessFail(pTask->outputQueue);
|
||||||
atomic_store_8(&pTask->outputStatus, TASK_OUTPUT_STATUS__NORMAL);
|
atomic_store_8(&pTask->outputStatus, TASK_OUTPUT_STATUS__NORMAL);
|
||||||
|
|
|
@ -43,7 +43,7 @@ static int32_t streamTaskExecImpl(SStreamTask* pTask, const void* data, SArray*
|
||||||
const SStreamRefDataBlock* pRefBlock = (const SStreamRefDataBlock*)data;
|
const SStreamRefDataBlock* pRefBlock = (const SStreamRefDataBlock*)data;
|
||||||
qSetMultiStreamInput(exec, pRefBlock->pBlock, 1, STREAM_INPUT__DATA_BLOCK);
|
qSetMultiStreamInput(exec, pRefBlock->pBlock, 1, STREAM_INPUT__DATA_BLOCK);
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// exec
|
// exec
|
||||||
|
@ -108,7 +108,7 @@ int32_t streamScanExec(SStreamTask* pTask, int32_t batchSz) {
|
||||||
SSDataBlock* output = NULL;
|
SSDataBlock* output = NULL;
|
||||||
uint64_t ts = 0;
|
uint64_t ts = 0;
|
||||||
if (qExecTask(exec, &output, &ts) < 0) {
|
if (qExecTask(exec, &output, &ts) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
if (output == NULL) {
|
if (output == NULL) {
|
||||||
finished = true;
|
finished = true;
|
||||||
|
|
|
@ -107,7 +107,7 @@ int32_t streamMetaAddSerializedTask(SStreamMeta* pMeta, int64_t ver, char* msg,
|
||||||
tDecoderClear(&decoder);
|
tDecoderClear(&decoder);
|
||||||
|
|
||||||
if (pMeta->expandFunc(pMeta->ahandle, pTask, ver) < 0) {
|
if (pMeta->expandFunc(pMeta->ahandle, pTask, ver) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
goto FAIL;
|
goto FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ int32_t streamMetaAddSerializedTask(SStreamMeta* pMeta, int64_t ver, char* msg,
|
||||||
|
|
||||||
if (tdbTbUpsert(pMeta->pTaskDb, &pTask->taskId, sizeof(int32_t), msg, msgLen, pMeta->txn) < 0) {
|
if (tdbTbUpsert(pMeta->pTaskDb, &pTask->taskId, sizeof(int32_t), msg, msgLen, pMeta->txn) < 0) {
|
||||||
taosHashRemove(pMeta->pTasks, &pTask->taskId, sizeof(int32_t));
|
taosHashRemove(pMeta->pTasks, &pTask->taskId, sizeof(int32_t));
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
goto FAIL;
|
goto FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -153,7 +153,7 @@ int32_t streamMetaAddTask(SStreamMeta* pMeta, int64_t ver, SStreamTask* pTask) {
|
||||||
tEncoderClear(&encoder);
|
tEncoderClear(&encoder);
|
||||||
|
|
||||||
if (tdbTbUpsert(pMeta->pTaskDb, &pTask->taskId, sizeof(int32_t), buf, len, pMeta->txn) < 0) {
|
if (tdbTbUpsert(pMeta->pTaskDb, &pTask->taskId, sizeof(int32_t), buf, len, pMeta->txn) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -257,7 +257,7 @@ int32_t streamMetaAbort(SStreamMeta* pMeta) {
|
||||||
int32_t streamLoadTasks(SStreamMeta* pMeta) {
|
int32_t streamLoadTasks(SStreamMeta* pMeta) {
|
||||||
TBC* pCur = NULL;
|
TBC* pCur = NULL;
|
||||||
if (tdbTbcOpen(pMeta->pTaskDb, &pCur, NULL) < 0) {
|
if (tdbTbcOpen(pMeta->pTaskDb, &pCur, NULL) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ int32_t streamTaskLaunchRecover(SStreamTask* pTask, int64_t version) {
|
||||||
};
|
};
|
||||||
|
|
||||||
if (tmsgPutToQueue(pTask->pMsgCb, STREAM_QUEUE, &rpcMsg) < 0) {
|
if (tmsgPutToQueue(pTask->pMsgCb, STREAM_QUEUE, &rpcMsg) < 0) {
|
||||||
/*ASSERT(0);*/
|
/*tAssert(0);*/
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (pTask->taskLevel == TASK_LEVEL__AGG) {
|
} else if (pTask->taskLevel == TASK_LEVEL__AGG) {
|
||||||
|
@ -149,7 +149,7 @@ int32_t streamProcessTaskCheckRsp(SStreamTask* pTask, const SStreamTaskCheckRsp*
|
||||||
if (pRsp->reqId != pTask->checkReqId) return -1;
|
if (pRsp->reqId != pTask->checkReqId) return -1;
|
||||||
streamTaskLaunchRecover(pTask, version);
|
streamTaskLaunchRecover(pTask, version);
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
streamRecheckOneDownstream(pTask, pRsp);
|
streamRecheckOneDownstream(pTask, pRsp);
|
||||||
|
@ -199,7 +199,7 @@ int32_t streamBuildSourceRecover2Req(SStreamTask* pTask, SStreamRecoverStep2Req*
|
||||||
int32_t streamSourceRecoverScanStep2(SStreamTask* pTask, int64_t ver) {
|
int32_t streamSourceRecoverScanStep2(SStreamTask* pTask, int64_t ver) {
|
||||||
void* exec = pTask->exec.executor;
|
void* exec = pTask->exec.executor;
|
||||||
if (qStreamSourceRecoverStep2(exec, ver) < 0) {
|
if (qStreamSourceRecoverStep2(exec, ver) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
return streamScanExec(pTask, 100);
|
return streamScanExec(pTask, 100);
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,7 +72,7 @@ void syncIndexMgrSetIndex(SSyncIndexMgr *pSyncIndexMgr, const SRaftId *pRaftId,
|
||||||
}
|
}
|
||||||
|
|
||||||
// maybe config change
|
// maybe config change
|
||||||
// ASSERT(0);
|
// tAssert(0);
|
||||||
|
|
||||||
char host[128];
|
char host[128];
|
||||||
uint16_t port;
|
uint16_t port;
|
||||||
|
@ -114,7 +114,7 @@ void syncIndexMgrSetStartTime(SSyncIndexMgr *pSyncIndexMgr, const SRaftId *pRaft
|
||||||
}
|
}
|
||||||
|
|
||||||
// maybe config change
|
// maybe config change
|
||||||
// ASSERT(0);
|
// tAssert(0);
|
||||||
char host[128];
|
char host[128];
|
||||||
uint16_t port;
|
uint16_t port;
|
||||||
syncUtilU642Addr(pRaftId->addr, host, sizeof(host), &port);
|
syncUtilU642Addr(pRaftId->addr, host, sizeof(host), &port);
|
||||||
|
@ -129,7 +129,7 @@ int64_t syncIndexMgrGetStartTime(SSyncIndexMgr *pSyncIndexMgr, const SRaftId *pR
|
||||||
return startTime;
|
return startTime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,7 +142,7 @@ void syncIndexMgrSetRecvTime(SSyncIndexMgr *pSyncIndexMgr, const SRaftId *pRaftI
|
||||||
}
|
}
|
||||||
|
|
||||||
// maybe config change
|
// maybe config change
|
||||||
// ASSERT(0);
|
// tAssert(0);
|
||||||
char host[128];
|
char host[128];
|
||||||
uint16_t port;
|
uint16_t port;
|
||||||
syncUtilU642Addr(pRaftId->addr, host, sizeof(host), &port);
|
syncUtilU642Addr(pRaftId->addr, host, sizeof(host), &port);
|
||||||
|
@ -170,7 +170,7 @@ void syncIndexMgrSetTerm(SSyncIndexMgr *pSyncIndexMgr, const SRaftId *pRaftId, S
|
||||||
}
|
}
|
||||||
|
|
||||||
// maybe config change
|
// maybe config change
|
||||||
// ASSERT(0);
|
// tAssert(0);
|
||||||
char host[128];
|
char host[128];
|
||||||
uint16_t port;
|
uint16_t port;
|
||||||
syncUtilU642Addr(pRaftId->addr, host, sizeof(host), &port);
|
syncUtilU642Addr(pRaftId->addr, host, sizeof(host), &port);
|
||||||
|
@ -184,6 +184,6 @@ SyncTerm syncIndexMgrGetTerm(SSyncIndexMgr *pSyncIndexMgr, const SRaftId *pRaftI
|
||||||
return term;
|
return term;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -140,7 +140,7 @@ int32_t raftCfgIndexCreateFile(const char *path) {
|
||||||
const char *sysErrStr = strerror(errno);
|
const char *sysErrStr = strerror(errno);
|
||||||
sError("create raft cfg index file error, err:%d %X, msg:%s, syserr:%d, sysmsg:%s", err, err, errStr, sysErr,
|
sError("create raft cfg index file error, err:%d %X, msg:%s, syserr:%d, sysmsg:%s", err, err, errStr, sysErr,
|
||||||
sysErrStr);
|
sysErrStr);
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -198,7 +198,7 @@ int32_t raftCfgPersist(SRaftCfg *pRaftCfg) {
|
||||||
|
|
||||||
if (strlen(s) + 1 > CONFIG_FILE_LEN) {
|
if (strlen(s) + 1 > CONFIG_FILE_LEN) {
|
||||||
sError("too long config str:%s", s);
|
sError("too long config str:%s", s);
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "%s", s);
|
snprintf(buf, sizeof(buf), "%s", s);
|
||||||
|
|
|
@ -370,7 +370,7 @@ int32_t raftEntryCacheGetEntryP(struct SRaftEntryCache* pCache, SyncIndex index,
|
||||||
code = 0;
|
code = 0;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
|
|
||||||
code = -1;
|
code = -1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -188,7 +188,7 @@ int tdbBtreeInsert(SBTree *pBt, const void *pKey, int kLen, const void *pVal, in
|
||||||
ret = tdbBtcMoveTo(&btc, pKey, kLen, &c);
|
ret = tdbBtcMoveTo(&btc, pKey, kLen, &c);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
tdbBtcClose(&btc);
|
tdbBtcClose(&btc);
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -200,14 +200,14 @@ int tdbBtreeInsert(SBTree *pBt, const void *pKey, int kLen, const void *pVal, in
|
||||||
} else if (c == 0) {
|
} else if (c == 0) {
|
||||||
// dup key not allowed
|
// dup key not allowed
|
||||||
tdbError("unable to insert dup key. pKey: %p, kLen: %d, btc: %p, pTxn: %p", pKey, kLen, &btc, pTxn);
|
tdbError("unable to insert dup key. pKey: %p, kLen: %d, btc: %p, pTxn: %p", pKey, kLen, &btc, pTxn);
|
||||||
// ASSERT(0);
|
// tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = tdbBtcUpsert(&btc, pKey, kLen, pVal, vLen, 1);
|
ret = tdbBtcUpsert(&btc, pKey, kLen, pVal, vLen, 1);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
tdbBtcClose(&btc);
|
tdbBtcClose(&btc);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -229,7 +229,7 @@ int tdbBtreeDelete(SBTree *pBt, const void *pKey, int kLen, TXN *pTxn) {
|
||||||
ret = tdbBtcMoveTo(&btc, pKey, kLen, &c);
|
ret = tdbBtcMoveTo(&btc, pKey, kLen, &c);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
tdbBtcClose(&btc);
|
tdbBtcClose(&btc);
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -260,7 +260,7 @@ int tdbBtreeUpsert(SBTree *pBt, const void *pKey, int nKey, const void *pData, i
|
||||||
// move the cursor
|
// move the cursor
|
||||||
ret = tdbBtcMoveTo(&btc, pKey, nKey, &c);
|
ret = tdbBtcMoveTo(&btc, pKey, nKey, &c);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
tdbBtcClose(&btc);
|
tdbBtcClose(&btc);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -276,7 +276,7 @@ int tdbBtreeUpsert(SBTree *pBt, const void *pKey, int nKey, const void *pData, i
|
||||||
|
|
||||||
ret = tdbBtcUpsert(&btc, pKey, nKey, pData, nData, c);
|
ret = tdbBtcUpsert(&btc, pKey, nKey, pData, nData, c);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
tdbBtcClose(&btc);
|
tdbBtcClose(&btc);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -305,7 +305,7 @@ int tdbBtreePGet(SBTree *pBt, const void *pKey, int kLen, void **ppKey, int *pkL
|
||||||
ret = tdbBtcMoveTo(&btc, pKey, kLen, &cret);
|
ret = tdbBtcMoveTo(&btc, pKey, kLen, &cret);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
tdbBtcClose(&btc);
|
tdbBtcClose(&btc);
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (btc.idx < 0 || cret) {
|
if (btc.idx < 0 || cret) {
|
||||||
|
@ -321,7 +321,7 @@ int tdbBtreePGet(SBTree *pBt, const void *pKey, int kLen, void **ppKey, int *pkL
|
||||||
pTKey = tdbRealloc(*ppKey, cd.kLen);
|
pTKey = tdbRealloc(*ppKey, cd.kLen);
|
||||||
if (pTKey == NULL) {
|
if (pTKey == NULL) {
|
||||||
tdbBtcClose(&btc);
|
tdbBtcClose(&btc);
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
*ppKey = pTKey;
|
*ppKey = pTKey;
|
||||||
|
@ -333,7 +333,7 @@ int tdbBtreePGet(SBTree *pBt, const void *pKey, int kLen, void **ppKey, int *pkL
|
||||||
pTVal = tdbRealloc(*ppVal, cd.vLen);
|
pTVal = tdbRealloc(*ppVal, cd.vLen);
|
||||||
if (pTVal == NULL) {
|
if (pTVal == NULL) {
|
||||||
tdbBtcClose(&btc);
|
tdbBtcClose(&btc);
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
*ppVal = pTVal;
|
*ppVal = pTVal;
|
||||||
|
@ -398,7 +398,7 @@ static int tdbBtreeOpenImpl(SBTree *pBt) {
|
||||||
// Try to create a new database
|
// Try to create a new database
|
||||||
ret = tdbPagerAllocPage(pBt->pPager, &pgno);
|
ret = tdbPagerAllocPage(pBt->pPager, &pgno);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -556,7 +556,7 @@ static int tdbBtreeBalanceNonRoot(SBTree *pBt, SPage *pParent, int idx, TXN *pTx
|
||||||
ret = tdbPagerFetchPage(pBt->pPager, &pgno, pOlds + i, tdbBtreeInitPage,
|
ret = tdbPagerFetchPage(pBt->pPager, &pgno, pOlds + i, tdbBtreeInitPage,
|
||||||
&((SBtreeInitPageArg){.pBt = pBt, .flags = 0}), pTxn);
|
&((SBtreeInitPageArg){.pBt = pBt, .flags = 0}), pTxn);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -718,7 +718,7 @@ static int tdbBtreeBalanceNonRoot(SBTree *pBt, SPage *pParent, int idx, TXN *pTx
|
||||||
iarg.flags = flags;
|
iarg.flags = flags;
|
||||||
ret = tdbPagerFetchPage(pBt->pPager, &pgno, pNews + iNew, tdbBtreeInitPage, &iarg, pTxn);
|
ret = tdbPagerFetchPage(pBt->pPager, &pgno, pNews + iNew, tdbBtreeInitPage, &iarg, pTxn);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = tdbPagerWrite(pBt->pPager, pNews[iNew]);
|
ret = tdbPagerWrite(pBt->pPager, pNews[iNew]);
|
||||||
|
@ -1212,7 +1212,7 @@ static int tdbBtreeEncodeCell(SPage *pPage, const void *pKey, int kLen, const vo
|
||||||
ret = tdbBtreeEncodePayload(pPage, pCell, nHeader, pKey, kLen, pVal, vLen, &nPayload, pTxn, pBt);
|
ret = tdbBtreeEncodePayload(pPage, pCell, nHeader, pKey, kLen, pVal, vLen, &nPayload, pTxn, pBt);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
// TODO
|
// TODO
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1573,7 +1573,7 @@ int tdbBtcMoveToFirst(SBTC *pBtc) {
|
||||||
ret = tdbPagerFetchPage(pPager, &pBt->root, &(pBtc->pPage), tdbBtreeInitPage,
|
ret = tdbPagerFetchPage(pPager, &pBt->root, &(pBtc->pPage), tdbBtreeInitPage,
|
||||||
&((SBtreeInitPageArg){.pBt = pBt, .flags = TDB_BTREE_ROOT | TDB_BTREE_LEAF}), pBtc->pTxn);
|
&((SBtreeInitPageArg){.pBt = pBt, .flags = TDB_BTREE_ROOT | TDB_BTREE_LEAF}), pBtc->pTxn);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1589,7 +1589,7 @@ int tdbBtcMoveToFirst(SBTC *pBtc) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
#if 0
|
#if 0
|
||||||
// move from a position
|
// move from a position
|
||||||
int iPage = 0;
|
int iPage = 0;
|
||||||
|
@ -1617,7 +1617,7 @@ int tdbBtcMoveToFirst(SBTC *pBtc) {
|
||||||
|
|
||||||
ret = tdbBtcMoveDownward(pBtc);
|
ret = tdbBtcMoveDownward(pBtc);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1642,7 +1642,7 @@ int tdbBtcMoveToLast(SBTC *pBtc) {
|
||||||
ret = tdbPagerFetchPage(pPager, &pBt->root, &(pBtc->pPage), tdbBtreeInitPage,
|
ret = tdbPagerFetchPage(pPager, &pBt->root, &(pBtc->pPage), tdbBtreeInitPage,
|
||||||
&((SBtreeInitPageArg){.pBt = pBt, .flags = TDB_BTREE_ROOT | TDB_BTREE_LEAF}), pBtc->pTxn);
|
&((SBtreeInitPageArg){.pBt = pBt, .flags = TDB_BTREE_ROOT | TDB_BTREE_LEAF}), pBtc->pTxn);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1657,7 +1657,7 @@ int tdbBtcMoveToLast(SBTC *pBtc) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
#if 0
|
#if 0
|
||||||
int iPage = 0;
|
int iPage = 0;
|
||||||
|
|
||||||
|
@ -1690,7 +1690,7 @@ int tdbBtcMoveToLast(SBTC *pBtc) {
|
||||||
|
|
||||||
ret = tdbBtcMoveDownward(pBtc);
|
ret = tdbBtcMoveDownward(pBtc);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1748,7 +1748,7 @@ int tdbBtreeNext(SBTC *pBtc, void **ppKey, int *kLen, void **ppVal, int *vLen) {
|
||||||
|
|
||||||
ret = tdbBtcMoveToNext(pBtc);
|
ret = tdbBtcMoveToNext(pBtc);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1794,7 +1794,7 @@ int tdbBtreePrev(SBTC *pBtc, void **ppKey, int *kLen, void **ppVal, int *vLen) {
|
||||||
|
|
||||||
ret = tdbBtcMoveToPrev(pBtc);
|
ret = tdbBtcMoveToPrev(pBtc);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1837,7 +1837,7 @@ int tdbBtcMoveToNext(SBTC *pBtc) {
|
||||||
|
|
||||||
ret = tdbBtcMoveDownward(pBtc);
|
ret = tdbBtcMoveDownward(pBtc);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1910,7 +1910,7 @@ static int tdbBtcMoveDownward(SBTC *pBtc) {
|
||||||
ret = tdbPagerFetchPage(pBtc->pBt->pPager, &pgno, &pBtc->pPage, tdbBtreeInitPage,
|
ret = tdbPagerFetchPage(pBtc->pBt->pPager, &pgno, &pBtc->pPage, tdbBtreeInitPage,
|
||||||
&((SBtreeInitPageArg){.pBt = pBtc->pBt, .flags = 0}), pBtc->pTxn);
|
&((SBtreeInitPageArg){.pBt = pBtc->pBt, .flags = 0}), pBtc->pTxn);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2003,7 +2003,7 @@ int tdbBtcDelete(SBTC *pBtc) {
|
||||||
ret = tdbPageUpdateCell(pPage, idx, pCell, szCell, pBtc->pTxn, pBtc->pBt);
|
ret = tdbPageUpdateCell(pPage, idx, pCell, szCell, pBtc->pTxn, pBtc->pBt);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
tdbOsFree(pCell);
|
tdbOsFree(pCell);
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
tdbOsFree(pCell);
|
tdbOsFree(pCell);
|
||||||
|
@ -2018,7 +2018,7 @@ int tdbBtcDelete(SBTC *pBtc) {
|
||||||
|
|
||||||
ret = tdbBtreeBalance(pBtc);
|
ret = tdbBtreeBalance(pBtc);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2041,7 +2041,7 @@ int tdbBtcUpsert(SBTC *pBtc, const void *pKey, int kLen, const void *pData, int
|
||||||
szBuf = kLen + nData + 14;
|
szBuf = kLen + nData + 14;
|
||||||
pBuf = tdbRealloc(pBtc->pBt->pBuf, pBtc->pBt->pageSize > szBuf ? szBuf : pBtc->pBt->pageSize);
|
pBuf = tdbRealloc(pBtc->pBt->pBuf, pBtc->pBt->pageSize > szBuf ? szBuf : pBtc->pBt->pageSize);
|
||||||
if (pBuf == NULL) {
|
if (pBuf == NULL) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
pBtc->pBt->pBuf = pBuf;
|
pBtc->pBt->pBuf = pBuf;
|
||||||
|
@ -2050,7 +2050,7 @@ int tdbBtcUpsert(SBTC *pBtc, const void *pKey, int kLen, const void *pData, int
|
||||||
// encode cell
|
// encode cell
|
||||||
ret = tdbBtreeEncodeCell(pBtc->pPage, pKey, kLen, pData, nData, pCell, &szCell, pBtc->pTxn, pBtc->pBt);
|
ret = tdbBtreeEncodeCell(pBtc->pPage, pKey, kLen, pData, nData, pCell, &szCell, pBtc->pTxn, pBtc->pBt);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2072,7 +2072,7 @@ int tdbBtcUpsert(SBTC *pBtc, const void *pKey, int kLen, const void *pData, int
|
||||||
ret = tdbPageUpdateCell(pBtc->pPage, pBtc->idx, pCell, szCell, pBtc->pTxn, pBtc->pBt);
|
ret = tdbPageUpdateCell(pBtc->pPage, pBtc->idx, pCell, szCell, pBtc->pTxn, pBtc->pBt);
|
||||||
}
|
}
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2080,7 +2080,7 @@ int tdbBtcUpsert(SBTC *pBtc, const void *pKey, int kLen, const void *pData, int
|
||||||
if (pBtc->pPage->nOverflow > 0) {
|
if (pBtc->pPage->nOverflow > 0) {
|
||||||
ret = tdbBtreeBalance(pBtc);
|
ret = tdbBtreeBalance(pBtc);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2105,7 +2105,7 @@ int tdbBtcMoveTo(SBTC *pBtc, const void *pKey, int kLen, int *pCRst) {
|
||||||
&((SBtreeInitPageArg){.pBt = pBt, .flags = TDB_BTREE_ROOT | TDB_BTREE_LEAF}), pBtc->pTxn);
|
&((SBtreeInitPageArg){.pBt = pBt, .flags = TDB_BTREE_ROOT | TDB_BTREE_LEAF}), pBtc->pTxn);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
// TODO
|
// TODO
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2114,7 +2114,7 @@ int tdbBtcMoveTo(SBTC *pBtc, const void *pKey, int kLen, int *pCRst) {
|
||||||
// for empty tree, just return with an invalid position
|
// for empty tree, just return with an invalid position
|
||||||
if (TDB_PAGE_TOTAL_CELLS(pBtc->pPage) == 0) return 0;
|
if (TDB_PAGE_TOTAL_CELLS(pBtc->pPage) == 0) return 0;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
#if 0
|
#if 0
|
||||||
SPage *pPage;
|
SPage *pPage;
|
||||||
int idx;
|
int idx;
|
||||||
|
|
|
@ -271,7 +271,7 @@ static SPage *tdbPCacheFetchImpl(SPCache *pCache, const SPgid *pPgid, TXN *pTxn)
|
||||||
ret = tdbPageCreate(pCache->szPage, &pPage, pTxn->xMalloc, pTxn->xArg);
|
ret = tdbPageCreate(pCache->szPage, &pPage, pTxn->xMalloc, pTxn->xArg);
|
||||||
if (ret < 0 || pPage == NULL) {
|
if (ret < 0 || pPage == NULL) {
|
||||||
// TODO
|
// TODO
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -387,7 +387,7 @@ static int tdbPageFree(SPage *pPage, int idx, SCell *pCell, int szCell) {
|
||||||
pPage->pPageMethods->setFreeCellInfo(pCell, szCell, cellFree);
|
pPage->pPageMethods->setFreeCellInfo(pCell, szCell, cellFree);
|
||||||
TDB_PAGE_FCELL_SET(pPage, pCell - pPage->pData);
|
TDB_PAGE_FCELL_SET(pPage, pCell - pPage->pData);
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -632,7 +632,7 @@ int tdbPagerFetchPage(SPager *pPager, SPgno *ppgno, SPage **ppPage, int (*initPa
|
||||||
loadPage = 0;
|
loadPage = 0;
|
||||||
ret = tdbPagerAllocPage(pPager, &pgno);
|
ret = tdbPagerAllocPage(pPager, &pgno);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -651,7 +651,7 @@ int tdbPagerFetchPage(SPager *pPager, SPgno *ppgno, SPage **ppPage, int (*initPa
|
||||||
if (!TDB_PAGE_INITIALIZED(pPage)) {
|
if (!TDB_PAGE_INITIALIZED(pPage)) {
|
||||||
ret = tdbPagerInitPage(pPager, pPage, initPage, arg, loadPage);
|
ret = tdbPagerInitPage(pPager, pPage, initPage, arg, loadPage);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -732,7 +732,7 @@ static int tdbPagerInitPage(SPager *pPager, SPage *pPage, int (*initPage)(SPage
|
||||||
nRead = tdbOsPRead(pPager->fd, pPage->pData, pPage->pageSize, ((i64)pPage->pageSize) * (pgno - 1));
|
nRead = tdbOsPRead(pPager->fd, pPage->pData, pPage->pageSize, ((i64)pPage->pageSize) * (pgno - 1));
|
||||||
tdbTrace("tdbttl pager:%p, pgno:%d, nRead:%" PRId64, pPager, pgno, nRead);
|
tdbTrace("tdbttl pager:%p, pgno:%d, nRead:%" PRId64, pPager, pgno, nRead);
|
||||||
if (nRead < pPage->pageSize) {
|
if (nRead < pPage->pageSize) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -741,7 +741,7 @@ static int tdbPagerInitPage(SPager *pPager, SPage *pPage, int (*initPage)(SPage
|
||||||
|
|
||||||
ret = (*initPage)(pPage, arg, init);
|
ret = (*initPage)(pPage, arg, init);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
TDB_UNLOCK_PAGE(pPage);
|
TDB_UNLOCK_PAGE(pPage);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -760,7 +760,7 @@ static int tdbPagerInitPage(SPager *pPager, SPage *pPage, int (*initPage)(SPage
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -310,7 +310,7 @@ static inline int tdbTryLockPage(tdb_spinlock_t *pLock) {
|
||||||
} else if (ret == EBUSY) {
|
} else if (ret == EBUSY) {
|
||||||
return P_LOCK_BUSY;
|
return P_LOCK_BUSY;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return P_LOCK_FAIL;
|
return P_LOCK_FAIL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -241,7 +241,7 @@ static int32_t walFetchHeadNew(SWalReader *pRead, int64_t fetchVer) {
|
||||||
|
|
||||||
if (pRead->curInvalid || pRead->curVersion != fetchVer) {
|
if (pRead->curInvalid || pRead->curVersion != fetchVer) {
|
||||||
if (walReadSeekVer(pRead, fetchVer) < 0) {
|
if (walReadSeekVer(pRead, fetchVer) < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
pRead->curVersion = fetchVer;
|
pRead->curVersion = fetchVer;
|
||||||
pRead->curInvalid = 1;
|
pRead->curInvalid = 1;
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -262,7 +262,7 @@ static int32_t walFetchHeadNew(SWalReader *pRead, int64_t fetchVer) {
|
||||||
} else {
|
} else {
|
||||||
terrno = TSDB_CODE_WAL_FILE_CORRUPTED;
|
terrno = TSDB_CODE_WAL_FILE_CORRUPTED;
|
||||||
}
|
}
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
pRead->curInvalid = 1;
|
pRead->curInvalid = 1;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -299,7 +299,7 @@ static int32_t walFetchBodyNew(SWalReader *pRead) {
|
||||||
terrno = TSDB_CODE_WAL_FILE_CORRUPTED;
|
terrno = TSDB_CODE_WAL_FILE_CORRUPTED;
|
||||||
}
|
}
|
||||||
pRead->curInvalid = 1;
|
pRead->curInvalid = 1;
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -308,7 +308,7 @@ static int32_t walFetchBodyNew(SWalReader *pRead) {
|
||||||
pRead->pHead->head.version, ver);
|
pRead->pHead->head.version, ver);
|
||||||
pRead->curInvalid = 1;
|
pRead->curInvalid = 1;
|
||||||
terrno = TSDB_CODE_WAL_FILE_CORRUPTED;
|
terrno = TSDB_CODE_WAL_FILE_CORRUPTED;
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -316,7 +316,7 @@ static int32_t walFetchBodyNew(SWalReader *pRead) {
|
||||||
wError("vgId:%d, wal fetch body error:%" PRId64 ", since body checksum not passed", pRead->pWal->cfg.vgId, ver);
|
wError("vgId:%d, wal fetch body error:%" PRId64 ", since body checksum not passed", pRead->pWal->cfg.vgId, ver);
|
||||||
pRead->curInvalid = 1;
|
pRead->curInvalid = 1;
|
||||||
terrno = TSDB_CODE_WAL_FILE_CORRUPTED;
|
terrno = TSDB_CODE_WAL_FILE_CORRUPTED;
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -335,7 +335,7 @@ static int32_t walSkipFetchBodyNew(SWalReader *pRead) {
|
||||||
if (code < 0) {
|
if (code < 0) {
|
||||||
terrno = TAOS_SYSTEM_ERROR(errno);
|
terrno = TAOS_SYSTEM_ERROR(errno);
|
||||||
pRead->curInvalid = 1;
|
pRead->curInvalid = 1;
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -384,7 +384,7 @@ int32_t walFetchHead(SWalReader *pRead, int64_t ver, SWalCkHead *pHead) {
|
||||||
} else {
|
} else {
|
||||||
terrno = TSDB_CODE_WAL_FILE_CORRUPTED;
|
terrno = TSDB_CODE_WAL_FILE_CORRUPTED;
|
||||||
}
|
}
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
pRead->curInvalid = 1;
|
pRead->curInvalid = 1;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -447,7 +447,7 @@ int32_t walFetchBody(SWalReader *pRead, SWalCkHead **ppHead) {
|
||||||
|
|
||||||
if (pReadHead->bodyLen != taosReadFile(pRead->pLogFile, pReadHead->body, pReadHead->bodyLen)) {
|
if (pReadHead->bodyLen != taosReadFile(pRead->pLogFile, pReadHead->body, pReadHead->bodyLen)) {
|
||||||
if (pReadHead->bodyLen < 0) {
|
if (pReadHead->bodyLen < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
terrno = TAOS_SYSTEM_ERROR(errno);
|
terrno = TAOS_SYSTEM_ERROR(errno);
|
||||||
wError("vgId:%d, wal fetch body error:%" PRId64 ", read request index:%" PRId64 ", since %s",
|
wError("vgId:%d, wal fetch body error:%" PRId64 ", read request index:%" PRId64 ", since %s",
|
||||||
pRead->pWal->cfg.vgId, pReadHead->version, ver, tstrerror(terrno));
|
pRead->pWal->cfg.vgId, pReadHead->version, ver, tstrerror(terrno));
|
||||||
|
@ -457,12 +457,12 @@ int32_t walFetchBody(SWalReader *pRead, SWalCkHead **ppHead) {
|
||||||
terrno = TSDB_CODE_WAL_FILE_CORRUPTED;
|
terrno = TSDB_CODE_WAL_FILE_CORRUPTED;
|
||||||
}
|
}
|
||||||
pRead->curInvalid = 1;
|
pRead->curInvalid = 1;
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pReadHead->version != ver) {
|
if (pReadHead->version != ver) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
wError("vgId:%d, wal fetch body error, index:%" PRId64 ", read request index:%" PRId64, pRead->pWal->cfg.vgId,
|
wError("vgId:%d, wal fetch body error, index:%" PRId64 ", read request index:%" PRId64, pRead->pWal->cfg.vgId,
|
||||||
pReadHead->version, ver);
|
pReadHead->version, ver);
|
||||||
pRead->curInvalid = 1;
|
pRead->curInvalid = 1;
|
||||||
|
@ -471,7 +471,7 @@ int32_t walFetchBody(SWalReader *pRead, SWalCkHead **ppHead) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (walValidBodyCksum(*ppHead) != 0) {
|
if (walValidBodyCksum(*ppHead) != 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
wError("vgId:%d, wal fetch body error, index:%" PRId64 ", since body checksum not passed", pRead->pWal->cfg.vgId,
|
wError("vgId:%d, wal fetch body error, index:%" PRId64 ", since body checksum not passed", pRead->pWal->cfg.vgId,
|
||||||
ver);
|
ver);
|
||||||
pRead->curInvalid = 1;
|
pRead->curInvalid = 1;
|
||||||
|
|
|
@ -138,21 +138,21 @@ int32_t walRollback(SWal *pWal, int64_t ver) {
|
||||||
TdFilePtr pIdxFile = taosOpenFile(fnameStr, TD_FILE_WRITE | TD_FILE_READ | TD_FILE_APPEND);
|
TdFilePtr pIdxFile = taosOpenFile(fnameStr, TD_FILE_WRITE | TD_FILE_READ | TD_FILE_APPEND);
|
||||||
|
|
||||||
if (pIdxFile == NULL) {
|
if (pIdxFile == NULL) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
taosThreadMutexUnlock(&pWal->mutex);
|
taosThreadMutexUnlock(&pWal->mutex);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
int64_t idxOff = walGetVerIdxOffset(pWal, ver);
|
int64_t idxOff = walGetVerIdxOffset(pWal, ver);
|
||||||
code = taosLSeekFile(pIdxFile, idxOff, SEEK_SET);
|
code = taosLSeekFile(pIdxFile, idxOff, SEEK_SET);
|
||||||
if (code < 0) {
|
if (code < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
taosThreadMutexUnlock(&pWal->mutex);
|
taosThreadMutexUnlock(&pWal->mutex);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
// read idx file and get log file pos
|
// read idx file and get log file pos
|
||||||
SWalIdxEntry entry;
|
SWalIdxEntry entry;
|
||||||
if (taosReadFile(pIdxFile, &entry, sizeof(SWalIdxEntry)) != sizeof(SWalIdxEntry)) {
|
if (taosReadFile(pIdxFile, &entry, sizeof(SWalIdxEntry)) != sizeof(SWalIdxEntry)) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
taosThreadMutexUnlock(&pWal->mutex);
|
taosThreadMutexUnlock(&pWal->mutex);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -179,7 +179,7 @@ int32_t walRollback(SWal *pWal, int64_t ver) {
|
||||||
ASSERT(taosValidFile(pLogFile));
|
ASSERT(taosValidFile(pLogFile));
|
||||||
int64_t size = taosReadFile(pLogFile, &head, sizeof(SWalCkHead));
|
int64_t size = taosReadFile(pLogFile, &head, sizeof(SWalCkHead));
|
||||||
if (size != sizeof(SWalCkHead)) {
|
if (size != sizeof(SWalCkHead)) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
taosThreadMutexUnlock(&pWal->mutex);
|
taosThreadMutexUnlock(&pWal->mutex);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -188,12 +188,12 @@ int32_t walRollback(SWal *pWal, int64_t ver) {
|
||||||
ASSERT(code == 0);
|
ASSERT(code == 0);
|
||||||
if (code != 0) {
|
if (code != 0) {
|
||||||
terrno = TSDB_CODE_WAL_FILE_CORRUPTED;
|
terrno = TSDB_CODE_WAL_FILE_CORRUPTED;
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
taosThreadMutexUnlock(&pWal->mutex);
|
taosThreadMutexUnlock(&pWal->mutex);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (head.head.version != ver) {
|
if (head.head.version != ver) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
terrno = TSDB_CODE_WAL_FILE_CORRUPTED;
|
terrno = TSDB_CODE_WAL_FILE_CORRUPTED;
|
||||||
taosThreadMutexUnlock(&pWal->mutex);
|
taosThreadMutexUnlock(&pWal->mutex);
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -202,14 +202,14 @@ int32_t walRollback(SWal *pWal, int64_t ver) {
|
||||||
// truncate old files
|
// truncate old files
|
||||||
code = taosFtruncateFile(pLogFile, entry.offset);
|
code = taosFtruncateFile(pLogFile, entry.offset);
|
||||||
if (code < 0) {
|
if (code < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
terrno = TAOS_SYSTEM_ERROR(errno);
|
terrno = TAOS_SYSTEM_ERROR(errno);
|
||||||
taosThreadMutexUnlock(&pWal->mutex);
|
taosThreadMutexUnlock(&pWal->mutex);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
code = taosFtruncateFile(pIdxFile, idxOff);
|
code = taosFtruncateFile(pIdxFile, idxOff);
|
||||||
if (code < 0) {
|
if (code < 0) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
terrno = TAOS_SYSTEM_ERROR(errno);
|
terrno = TAOS_SYSTEM_ERROR(errno);
|
||||||
taosThreadMutexUnlock(&pWal->mutex);
|
taosThreadMutexUnlock(&pWal->mutex);
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -386,7 +386,7 @@ int32_t walEndSnapshot(SWal *pWal) {
|
||||||
walBuildIdxName(pWal, pInfo->firstVer, fnameStr);
|
walBuildIdxName(pWal, pInfo->firstVer, fnameStr);
|
||||||
wDebug("vgId:%d, wal remove file %s", pWal->cfg.vgId, fnameStr);
|
wDebug("vgId:%d, wal remove file %s", pWal->cfg.vgId, fnameStr);
|
||||||
if (taosRemoveFile(fnameStr) < 0 && errno != ENOENT) {
|
if (taosRemoveFile(fnameStr) < 0 && errno != ENOENT) {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
taosArrayClear(pWal->toDeleteFiles);
|
taosArrayClear(pWal->toDeleteFiles);
|
||||||
|
|
|
@ -143,15 +143,17 @@ SConv *gConv = NULL;
|
||||||
int32_t convUsed = 0;
|
int32_t convUsed = 0;
|
||||||
int32_t gConvMaxNum = 0;
|
int32_t gConvMaxNum = 0;
|
||||||
|
|
||||||
void taosConvInit(void) {
|
int32_t taosConvInit(void) {
|
||||||
gConvMaxNum = 512;
|
gConvMaxNum = 512;
|
||||||
gConv = taosMemoryCalloc(gConvMaxNum, sizeof(SConv));
|
gConv = taosMemoryCalloc(gConvMaxNum, sizeof(SConv));
|
||||||
for (int32_t i = 0; i < gConvMaxNum; ++i) {
|
for (int32_t i = 0; i < gConvMaxNum; ++i) {
|
||||||
gConv[i].conv = iconv_open(DEFAULT_UNICODE_ENCODEC, tsCharset);
|
gConv[i].conv = iconv_open(DEFAULT_UNICODE_ENCODEC, tsCharset);
|
||||||
if ((iconv_t)-1 == gConv[i].conv || (iconv_t)0 == gConv[i].conv) {
|
if ((iconv_t)-1 == gConv[i].conv || (iconv_t)0 == gConv[i].conv) {
|
||||||
ASSERT(0);
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void taosConvDestroy() {
|
void taosConvDestroy() {
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
|
|
||||||
#define _DEFAULT_SOURCE
|
#define _DEFAULT_SOURCE
|
||||||
#include "talgo.h"
|
#include "talgo.h"
|
||||||
|
#include "tlog.h"
|
||||||
|
|
||||||
#define doswap(__left, __right, __size, __buf) \
|
#define doswap(__left, __right, __size, __buf) \
|
||||||
do { \
|
do { \
|
||||||
|
@ -200,7 +201,7 @@ void *taosbsearch(const void *key, const void *base, int32_t nmemb, int32_t size
|
||||||
} else if (flags == TD_LT) {
|
} else if (flags == TD_LT) {
|
||||||
return (c > 0) ? p : (midx > 0 ? p - size : NULL);
|
return (c > 0) ? p : (midx > 0 ? p - size : NULL);
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1416,7 +1416,7 @@ static int32_t tCompTimestampEnd(SCompressor *pCmprsor, const uint8_t **ppData,
|
||||||
*ppData = pCmprsor->pBuf;
|
*ppData = pCmprsor->pBuf;
|
||||||
*nData = pCmprsor->nBuf;
|
*nData = pCmprsor->nBuf;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return code;
|
return code;
|
||||||
|
@ -1659,7 +1659,7 @@ static int32_t tCompIntEnd(SCompressor *pCmprsor, const uint8_t **ppData, int32_
|
||||||
*ppData = pCmprsor->pBuf;
|
*ppData = pCmprsor->pBuf;
|
||||||
*nData = pCmprsor->nBuf;
|
*nData = pCmprsor->nBuf;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return code;
|
return code;
|
||||||
|
@ -1812,7 +1812,7 @@ static int32_t tCompFloatEnd(SCompressor *pCmprsor, const uint8_t **ppData, int3
|
||||||
*ppData = pCmprsor->pBuf;
|
*ppData = pCmprsor->pBuf;
|
||||||
*nData = pCmprsor->nBuf;
|
*nData = pCmprsor->nBuf;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return code;
|
return code;
|
||||||
|
@ -1965,7 +1965,7 @@ static int32_t tCompDoubleEnd(SCompressor *pCmprsor, const uint8_t **ppData, int
|
||||||
*ppData = pCmprsor->pBuf;
|
*ppData = pCmprsor->pBuf;
|
||||||
*nData = pCmprsor->nBuf;
|
*nData = pCmprsor->nBuf;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return code;
|
return code;
|
||||||
|
@ -2059,7 +2059,7 @@ static int32_t tCompBoolEnd(SCompressor *pCmprsor, const uint8_t **ppData, int32
|
||||||
*ppData = pCmprsor->pBuf;
|
*ppData = pCmprsor->pBuf;
|
||||||
*nData = pCmprsor->nBuf;
|
*nData = pCmprsor->nBuf;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return code;
|
return code;
|
||||||
|
|
|
@ -137,7 +137,7 @@ void *taosProcessSchedQueue(void *scheduler) {
|
||||||
while (1) {
|
while (1) {
|
||||||
if ((ret = tsem_wait(&pSched->fullSem)) != 0) {
|
if ((ret = tsem_wait(&pSched->fullSem)) != 0) {
|
||||||
uFatal("wait %s fullSem failed(%s)", pSched->label, strerror(errno));
|
uFatal("wait %s fullSem failed(%s)", pSched->label, strerror(errno));
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
if (atomic_load_8(&pSched->stop)) {
|
if (atomic_load_8(&pSched->stop)) {
|
||||||
break;
|
break;
|
||||||
|
@ -145,7 +145,7 @@ void *taosProcessSchedQueue(void *scheduler) {
|
||||||
|
|
||||||
if ((ret = taosThreadMutexLock(&pSched->queueMutex)) != 0) {
|
if ((ret = taosThreadMutexLock(&pSched->queueMutex)) != 0) {
|
||||||
uFatal("lock %s queueMutex failed(%s)", pSched->label, strerror(errno));
|
uFatal("lock %s queueMutex failed(%s)", pSched->label, strerror(errno));
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
msg = pSched->queue[pSched->fullSlot];
|
msg = pSched->queue[pSched->fullSlot];
|
||||||
|
@ -154,12 +154,12 @@ void *taosProcessSchedQueue(void *scheduler) {
|
||||||
|
|
||||||
if ((ret = taosThreadMutexUnlock(&pSched->queueMutex)) != 0) {
|
if ((ret = taosThreadMutexUnlock(&pSched->queueMutex)) != 0) {
|
||||||
uFatal("unlock %s queueMutex failed(%s)", pSched->label, strerror(errno));
|
uFatal("unlock %s queueMutex failed(%s)", pSched->label, strerror(errno));
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((ret = tsem_post(&pSched->emptySem)) != 0) {
|
if ((ret = tsem_post(&pSched->emptySem)) != 0) {
|
||||||
uFatal("post %s emptySem failed(%s)", pSched->label, strerror(errno));
|
uFatal("post %s emptySem failed(%s)", pSched->label, strerror(errno));
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (msg.fp)
|
if (msg.fp)
|
||||||
|
@ -187,12 +187,12 @@ int taosScheduleTask(void *queueScheduler, SSchedMsg *pMsg) {
|
||||||
|
|
||||||
if ((ret = tsem_wait(&pSched->emptySem)) != 0) {
|
if ((ret = tsem_wait(&pSched->emptySem)) != 0) {
|
||||||
uFatal("wait %s emptySem failed(%s)", pSched->label, strerror(errno));
|
uFatal("wait %s emptySem failed(%s)", pSched->label, strerror(errno));
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((ret = taosThreadMutexLock(&pSched->queueMutex)) != 0) {
|
if ((ret = taosThreadMutexLock(&pSched->queueMutex)) != 0) {
|
||||||
uFatal("lock %s queueMutex failed(%s)", pSched->label, strerror(errno));
|
uFatal("lock %s queueMutex failed(%s)", pSched->label, strerror(errno));
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
pSched->queue[pSched->emptySlot] = *pMsg;
|
pSched->queue[pSched->emptySlot] = *pMsg;
|
||||||
|
@ -200,12 +200,12 @@ int taosScheduleTask(void *queueScheduler, SSchedMsg *pMsg) {
|
||||||
|
|
||||||
if ((ret = taosThreadMutexUnlock(&pSched->queueMutex)) != 0) {
|
if ((ret = taosThreadMutexUnlock(&pSched->queueMutex)) != 0) {
|
||||||
uFatal("unlock %s queueMutex failed(%s)", pSched->label, strerror(errno));
|
uFatal("unlock %s queueMutex failed(%s)", pSched->label, strerror(errno));
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((ret = tsem_post(&pSched->fullSem)) != 0) {
|
if ((ret = tsem_post(&pSched->fullSem)) != 0) {
|
||||||
uFatal("post %s fullSem failed(%s)", pSched->label, strerror(errno));
|
uFatal("post %s fullSem failed(%s)", pSched->label, strerror(errno));
|
||||||
ASSERT(0);
|
tAssert(0);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1045,7 +1045,7 @@ int smlProcess_18784_Test() {
|
||||||
// ASSERT_EQ(grade, 0);
|
// ASSERT_EQ(grade, 0);
|
||||||
// ASSERT_EQ(fuel_consumption, 25);
|
// ASSERT_EQ(fuel_consumption, 25);
|
||||||
}else{
|
}else{
|
||||||
// ASSERT(0);
|
// tAssert(0);
|
||||||
}
|
}
|
||||||
rowIndex++;
|
rowIndex++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue