opti: async->sync for schemaless
This commit is contained in:
parent
443aa2ee3f
commit
a4d03b43a0
|
@ -58,7 +58,6 @@ typedef struct SParseContext {
|
||||||
bool isSuperUser;
|
bool isSuperUser;
|
||||||
bool enableSysInfo;
|
bool enableSysInfo;
|
||||||
bool async;
|
bool async;
|
||||||
int8_t schemalessType;
|
|
||||||
const char* svrVer;
|
const char* svrVer;
|
||||||
bool nodeOffline;
|
bool nodeOffline;
|
||||||
SArray* pTableMetaPos; // sql table pos => catalog data pos
|
SArray* pTableMetaPos; // sql table pos => catalog data pos
|
||||||
|
|
|
@ -149,7 +149,7 @@ typedef struct STscObj {
|
||||||
int32_t numOfReqs; // number of sqlObj bound to this connection
|
int32_t numOfReqs; // number of sqlObj bound to this connection
|
||||||
SAppInstInfo* pAppInfo;
|
SAppInstInfo* pAppInfo;
|
||||||
SHashObj* pRequests;
|
SHashObj* pRequests;
|
||||||
int8_t schemalessType; // todo remove it, this attribute should be move to request
|
void* smlHandle;
|
||||||
} STscObj;
|
} STscObj;
|
||||||
|
|
||||||
typedef struct SResultColumn {
|
typedef struct SResultColumn {
|
||||||
|
@ -323,6 +323,7 @@ void destroyTscObj(void* pObj);
|
||||||
STscObj* acquireTscObj(int64_t rid);
|
STscObj* acquireTscObj(int64_t rid);
|
||||||
int32_t releaseTscObj(int64_t rid);
|
int32_t releaseTscObj(int64_t rid);
|
||||||
void destroyAppInst(SAppInstInfo* pAppInfo);
|
void destroyAppInst(SAppInstInfo* pAppInfo);
|
||||||
|
void smlDestroyInfo(void *data);
|
||||||
|
|
||||||
uint64_t generateRequestId();
|
uint64_t generateRequestId();
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ extern "C" {
|
||||||
#define tscDebug(...) do { if (cDebugFlag & DEBUG_DEBUG) { taosPrintLog("TSC ", DEBUG_DEBUG, cDebugFlag, __VA_ARGS__); }} while(0)
|
#define tscDebug(...) do { if (cDebugFlag & DEBUG_DEBUG) { taosPrintLog("TSC ", DEBUG_DEBUG, cDebugFlag, __VA_ARGS__); }} while(0)
|
||||||
#define tscTrace(...) do { if (cDebugFlag & DEBUG_TRACE) { taosPrintLog("TSC ", DEBUG_TRACE, cDebugFlag, __VA_ARGS__); }} while(0)
|
#define tscTrace(...) do { if (cDebugFlag & DEBUG_TRACE) { taosPrintLog("TSC ", DEBUG_TRACE, cDebugFlag, __VA_ARGS__); }} while(0)
|
||||||
#define tscDebugL(...) do { if (cDebugFlag & DEBUG_DEBUG) { taosPrintLongString("TSC ", DEBUG_DEBUG, cDebugFlag, __VA_ARGS__); }} while(0)
|
#define tscDebugL(...) do { if (cDebugFlag & DEBUG_DEBUG) { taosPrintLongString("TSC ", DEBUG_DEBUG, cDebugFlag, __VA_ARGS__); }} while(0)
|
||||||
//#define tscPerf(...) do { if (cDebugFlag & DEBUG_INFO) { taosPrintLog("TSC ", DEBUG_INFO, cDebugFlag, __VA_ARGS__); }} while(0)
|
#define tscPerf(...) do { if (cDebugFlag & DEBUG_INFO) { taosPrintLog("TSC ", 0, cDebugFlag, __VA_ARGS__); }} while(0)
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -77,11 +77,11 @@ static void deregisterRequest(SRequestObj *pRequest) {
|
||||||
pRequest->self, pTscObj->id, pRequest->requestId, duration / 1000.0, num, currentInst);
|
pRequest->self, pTscObj->id, pRequest->requestId, duration / 1000.0, num, currentInst);
|
||||||
|
|
||||||
if (QUERY_NODE_VNODE_MODIF_STMT == pRequest->stmtType) {
|
if (QUERY_NODE_VNODE_MODIF_STMT == pRequest->stmtType) {
|
||||||
// tscPerf("insert duration %" PRId64 "us: syntax:%" PRId64 "us, ctg:%" PRId64 "us, semantic:%" PRId64
|
tscPerf("insert duration %" PRId64 "us: syntax:%" PRId64 "us, ctg:%" PRId64 "us, semantic:%" PRId64
|
||||||
// "us, exec:%" PRId64 "us",
|
"us, exec:%" PRId64 "us",
|
||||||
// duration, pRequest->metric.syntaxEnd - pRequest->metric.syntaxStart,
|
duration, pRequest->metric.syntaxEnd - pRequest->metric.syntaxStart,
|
||||||
// pRequest->metric.ctgEnd - pRequest->metric.ctgStart, pRequest->metric.semanticEnd -
|
pRequest->metric.ctgEnd - pRequest->metric.ctgStart, pRequest->metric.semanticEnd -
|
||||||
// pRequest->metric.ctgEnd, pRequest->metric.execEnd - pRequest->metric.semanticEnd);
|
pRequest->metric.ctgEnd, pRequest->metric.execEnd - pRequest->metric.semanticEnd);
|
||||||
atomic_add_fetch_64((int64_t *)&pActivity->insertElapsedTime, duration);
|
atomic_add_fetch_64((int64_t *)&pActivity->insertElapsedTime, duration);
|
||||||
} else if (QUERY_NODE_SELECT_STMT == pRequest->stmtType) {
|
} else if (QUERY_NODE_SELECT_STMT == pRequest->stmtType) {
|
||||||
// tscPerf("select duration %" PRId64 "us: syntax:%" PRId64 "us, ctg:%" PRId64 "us, semantic:%" PRId64
|
// tscPerf("select duration %" PRId64 "us: syntax:%" PRId64 "us, ctg:%" PRId64 "us, semantic:%" PRId64
|
||||||
|
@ -237,6 +237,7 @@ void destroyTscObj(void *pObj) {
|
||||||
}
|
}
|
||||||
taosThreadMutexDestroy(&pTscObj->mutex);
|
taosThreadMutexDestroy(&pTscObj->mutex);
|
||||||
taosMemoryFree(pTscObj);
|
taosMemoryFree(pTscObj);
|
||||||
|
smlDestroyInfo(pTscObj->smlHandle);
|
||||||
|
|
||||||
tscTrace("end to destroy tscObj %" PRIx64 " p:%p", tscId, pTscObj);
|
tscTrace("end to destroy tscObj %" PRIx64 " p:%p", tscId, pTscObj);
|
||||||
}
|
}
|
||||||
|
@ -266,7 +267,6 @@ void *createTscObj(const char *user, const char *auth, const char *db, int32_t c
|
||||||
|
|
||||||
taosThreadMutexInit(&pObj->mutex, NULL);
|
taosThreadMutexInit(&pObj->mutex, NULL);
|
||||||
pObj->id = taosAddRef(clientConnRefPool, pObj);
|
pObj->id = taosAddRef(clientConnRefPool, pObj);
|
||||||
pObj->schemalessType = 1;
|
|
||||||
|
|
||||||
atomic_add_fetch_64(&pObj->pAppInfo->numOfConns, 1);
|
atomic_add_fetch_64(&pObj->pAppInfo->numOfConns, 1);
|
||||||
|
|
||||||
|
|
|
@ -232,7 +232,6 @@ int32_t parseSql(SRequestObj* pRequest, bool topicQuery, SQuery** pQuery, SStmtC
|
||||||
.pTransporter = pTscObj->pAppInfo->pTransporter,
|
.pTransporter = pTscObj->pAppInfo->pTransporter,
|
||||||
.pStmtCb = pStmtCb,
|
.pStmtCb = pStmtCb,
|
||||||
.pUser = pTscObj->user,
|
.pUser = pTscObj->user,
|
||||||
.schemalessType = pTscObj->schemalessType,
|
|
||||||
.isSuperUser = (0 == strcmp(pTscObj->user, TSDB_DEFAULT_USER)),
|
.isSuperUser = (0 == strcmp(pTscObj->user, TSDB_DEFAULT_USER)),
|
||||||
.enableSysInfo = pTscObj->sysInfo,
|
.enableSysInfo = pTscObj->sysInfo,
|
||||||
.svrVer = pTscObj->sVer,
|
.svrVer = pTscObj->sVer,
|
||||||
|
|
|
@ -862,7 +862,6 @@ int32_t createParseContext(const SRequestObj *pRequest, SParseContext **pCxt) {
|
||||||
.pTransporter = pTscObj->pAppInfo->pTransporter,
|
.pTransporter = pTscObj->pAppInfo->pTransporter,
|
||||||
.pStmtCb = NULL,
|
.pStmtCb = NULL,
|
||||||
.pUser = pTscObj->user,
|
.pUser = pTscObj->user,
|
||||||
.schemalessType = pTscObj->schemalessType,
|
|
||||||
.isSuperUser = (0 == strcmp(pTscObj->user, TSDB_DEFAULT_USER)),
|
.isSuperUser = (0 == strcmp(pTscObj->user, TSDB_DEFAULT_USER)),
|
||||||
.enableSysInfo = pTscObj->sysInfo,
|
.enableSysInfo = pTscObj->sysInfo,
|
||||||
.async = true,
|
.async = true,
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1142,8 +1142,8 @@ int sml_ttl_Test() {
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
// ret = sml_ttl_Test();
|
ret = sml_ttl_Test();
|
||||||
// ASSERT(!ret);
|
ASSERT(!ret);
|
||||||
ret = sml_ts2164_Test();
|
ret = sml_ts2164_Test();
|
||||||
ASSERT(!ret);
|
ASSERT(!ret);
|
||||||
ret = smlProcess_influx_Test();
|
ret = smlProcess_influx_Test();
|
||||||
|
|
Loading…
Reference in New Issue