diff --git a/packaging/docker/Dockerfile b/packaging/docker/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..b01f375db0bc49e07ddb6b9d5e3c1692455857a7 --- /dev/null +++ b/packaging/docker/Dockerfile @@ -0,0 +1,18 @@ +FROM centos:7 + +WORKDIR /root + +COPY tdengine.tar.gz /root/ +RUN tar -zxf tdengine.tar.gz +WORKDIR /root/tdengine/ +RUN sh install.sh + + +ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib" +ENV LANG=en_US.UTF-8 +ENV LANGUAGE=en_US:en +ENV LC_ALL=en_US.UTF-8 +EXPOSE 6020 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 +EXPOSE 6043 6044 6045 6046 6047 6048 6049 6050 +CMD ["taosd"] +VOLUME [ "/var/lib/taos", "/var/log/taos","/etc/taos/" ] diff --git a/packaging/docker/dockerbuild.sh b/packaging/docker/dockerbuild.sh new file mode 100755 index 0000000000000000000000000000000000000000..280c27d7aa10248a73874518c30639b83203590b --- /dev/null +++ b/packaging/docker/dockerbuild.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -x +$1 +tar -zxf $1 +DIR=`echo $1|awk -F . '{print($1"."$2"."$3"."$4)}'` +mv $DIR tdengine +tar -czf tdengine.tar.gz tdengine +TMP=`echo $1|awk -F . '{print($2"."$3"."$4)}'` +TAG="1."$TMP +docker build --rm -f "Dockerfile" -t tdengine/tdengine:$TAG "." +docker login -u tdengine -p ******** #replace the docker registry username and password +docker push tdengine/tdengine:$TAG \ No newline at end of file diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index 6981c16e9e1a5faf62453c56e454f4839fa45c43..9151159042e4b4a1b86486a81e88e65f9d8aea57 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -1090,7 +1090,9 @@ static void tscHandleSubRetrievalError(SRetrieveSupport *trsupport, SSqlObj *pSq } } - if (atomic_add_fetch_32(&trsupport->pState->numOfCompleted, 1) < trsupport->pState->numOfTotal) { + int32_t numOfTotal = trsupport->pState->numOfTotal; + int32_t finished = atomic_add_fetch_32(&trsupport->pState->numOfCompleted, 1); + if (finished < numOfTotal) { // pState may be released by otherthreads, so keep the value in a local variable. return tscFreeSubSqlObj(trsupport, pSql); } @@ -1215,7 +1217,14 @@ void tscRetrieveFromVnodeCallBack(void *param, TAOS_RES *tres, int numOfRows) { return tscAbortFurtherRetryRetrieval(trsupport, tres, TSDB_CODE_CLI_NO_DISKSPACE); } - if (atomic_add_fetch_32(&trsupport->pState->numOfCompleted, 1) < trsupport->pState->numOfTotal) { + // keep this value local variable, since the pState variable may be released by other threads, if atomic_add opertion + // increases the finished value up to pState->numOfTotal value, which means all subqueries are completed. + // In this case, the comparsion between finished value and released pState->numOfTotal is not safe. + int32_t numOfTotal = trsupport->pState->numOfTotal; + + int32_t finished = atomic_add_fetch_32(&trsupport->pState->numOfCompleted, 1); + if (finished < numOfTotal) { + tscTrace("%p sub:%p orderOfSub:%d freed, finished subqueries:%d", pPObj, pSql, trsupport->vnodeIdx, finished); return tscFreeSubSqlObj(trsupport, pSql); } @@ -1223,7 +1232,7 @@ void tscRetrieveFromVnodeCallBack(void *param, TAOS_RES *tres, int numOfRows) { pDesc->pSchema->maxCapacity = trsupport->pExtMemBuffer[idx]->numOfElemsPerPage; tscTrace("%p retrieve from %d vnodes completed.final NumOfRows:%d,start to build loser tree", pPObj, - trsupport->pState->numOfTotal, trsupport->pState->numOfCompleted); + trsupport->pState->numOfTotal, trsupport->pState->numOfRetrievedRows); tscClearInterpInfo(&pPObj->cmd); tscCreateLocalReducer(trsupport->pExtMemBuffer, trsupport->pState->numOfTotal, pDesc, trsupport->pFinalColModel,