diff --git a/cmake/cmake.version b/cmake/cmake.version index 0e4785f643..fa6ec4df17 100644 --- a/cmake/cmake.version +++ b/cmake/cmake.version @@ -2,7 +2,7 @@ IF (DEFINED VERNUMBER) SET(TD_VER_NUMBER ${VERNUMBER}) ELSE () - SET(TD_VER_NUMBER "3.2.0.0.alpha") + SET(TD_VER_NUMBER "3.2.1.0.alpha") ENDIF () IF (DEFINED VERCOMPATIBLE) diff --git a/docs/en/28-releases/01-tdengine.md b/docs/en/28-releases/01-tdengine.md index 6f863d8c25..e43cd638f6 100644 --- a/docs/en/28-releases/01-tdengine.md +++ b/docs/en/28-releases/01-tdengine.md @@ -10,6 +10,10 @@ For TDengine 2.x installation packages by version, please visit [here](https://t import Release from "/components/ReleaseV3"; +## 3.2.0.0 + + + ## 3.1.1.0 diff --git a/docs/zh/28-releases/01-tdengine.md b/docs/zh/28-releases/01-tdengine.md index 89bb8aaf8f..5ebf3af1eb 100644 --- a/docs/zh/28-releases/01-tdengine.md +++ b/docs/zh/28-releases/01-tdengine.md @@ -10,6 +10,10 @@ TDengine 2.x 各版本安装包请访问[这里](https://www.taosdata.com/all-do import Release from "/components/ReleaseV3"; +## 3.2.0.0 + + + ## 3.1.1.0 diff --git a/packaging/tools/install.sh b/packaging/tools/install.sh index e8798ed16b..f646009b21 100755 --- a/packaging/tools/install.sh +++ b/packaging/tools/install.sh @@ -377,13 +377,14 @@ function add_newHostname_to_hosts() { } function set_hostname() { - echo -e -n "${GREEN}Please enter one hostname(must not be 'localhost')${NC}:" + echo -e -n "${GREEN}Enter the public accessible IP address or fully qualified domain name TDengine will expose to users or applications (must not be 'localhost') :${NC}" read newHostname while true; do if [[ ! -z "$newHostname" && "$newHostname" != "localhost" ]]; then break else - read -p "Please enter one hostname(must not be 'localhost'):" newHostname + echo -e -n "${GREEN}Enter the public accessible IP address or fully qualified domain name TDengine will expose to users or applications (must not be 'localhost') :${NC}" + read newHostname fi done @@ -476,34 +477,7 @@ function local_fqdn_check() { echo echo -e -n "System hostname is: ${GREEN}$serverFqdn${NC}" echo - if [[ "$serverFqdn" == "" ]] || [[ "$serverFqdn" == "localhost" ]]; then - echo -e -n "${GREEN}It is strongly recommended to configure a hostname for this machine ${NC}" - echo - - while true; do - read -r -p "Set hostname now? [Y/n] " input - if [ ! -n "$input" ]; then - set_hostname - break - else - case $input in - [yY][eE][sS] | [yY]) - set_hostname - break - ;; - - [nN][oO] | [nN]) - set_ipAsFqdn - break - ;; - - *) - echo "Invalid input..." - ;; - esac - fi - done - fi + set_hostname } function install_adapter_config() { @@ -525,11 +499,19 @@ function install_adapter_config() { function install_config() { + local_fqdn_check + if [ ! -f "${cfg_install_dir}/${configFile2}" ]; then ${csudo}mkdir -p ${cfg_install_dir} - [ -f ${script_dir}/cfg/${configFile2} ] && ${csudo}cp ${script_dir}/cfg/${configFile2} ${cfg_install_dir} + if [ -f ${script_dir}/cfg/${configFile2} ]; then + ${csudo} echo "monitor 1" >> ${script_dir}/cfg/${configFile2} + ${csudo} echo "monitorFQDN ${serverFqdn}" >> ${script_dir}/cfg/${configFile2} + ${csudo}cp ${script_dir}/cfg/${configFile2} ${cfg_install_dir} + fi ${csudo}chmod 644 ${cfg_install_dir}/* else + ${csudo} echo "monitor 1" >> ${script_dir}/cfg/${configFile2} + ${csudo} echo "monitorFQDN ${serverFqdn}" >> ${script_dir}/cfg/${configFile2} ${csudo}cp -f ${script_dir}/cfg/${configFile2} ${cfg_install_dir}/${configFile2}.new fi @@ -537,15 +519,15 @@ function install_config() { [ ! -z $1 ] && return 0 || : # only install client - if ((${update_flag} == 1)); then - return 0 - fi + - if [ "$interactiveFqdn" == "no" ]; then - return 0 - fi + # if ((${update_flag} == 1)); then + # return 0 + # fi - local_fqdn_check + # if [ "$interactiveFqdn" == "no" ]; then + # return 0 + # fi echo echo -e -n "${GREEN}Enter FQDN:port (like h1.${emailName2}:6030) of an existing ${productName2} cluster node to join${NC}" @@ -629,7 +611,7 @@ function install_taosx() { if [ -f "${script_dir}/taosx/install_taosx.sh" ]; then cd ${script_dir}/taosx chmod a+x install_taosx.sh - bash install_taosx.sh + bash install_taosx.sh -e $serverFqdn fi } @@ -712,30 +694,7 @@ function clean_service_on_systemd() { ${csudo}systemctl stop tarbitratord &>/dev/null || echo &>/dev/null fi ${csudo}systemctl disable tarbitratord &>/dev/null || echo &>/dev/null - ${csudo}rm -f ${tarbitratord_service_config} - - if [ "$verMode" == "cluster" ] && [ "$clientName" != "$clientName2" ]; then - x_service_config="${service_config_dir}/${xName2}.service" - if [ -e "$x_service_config" ]; then - if systemctl is-active --quiet ${xName2}; then - echo "${productName2} ${xName2} is running, stopping it..." - ${csudo}systemctl stop ${xName2} &>/dev/null || echo &>/dev/null - fi - ${csudo}systemctl disable ${xName2} &>/dev/null || echo &>/dev/null - ${csudo}rm -f ${x_service_config} - fi - - explorer_service_config="${service_config_dir}/${explorerName2}.service" - if [ -e "$explorer_service_config" ]; then - if systemctl is-active --quiet ${explorerName2}; then - echo "${productName2} ${explorerName2} is running, stopping it..." - ${csudo}systemctl stop ${explorerName2} &>/dev/null || echo &>/dev/null - fi - ${csudo}systemctl disable ${explorerName2} &>/dev/null || echo &>/dev/null - ${csudo}rm -f ${explorer_service_config} - ${csudo}rm -f /etc/${clientName2}/explorer.toml - fi - fi + ${csudo}rm -f ${tarbitratord_service_config} } function install_service_on_systemd() { @@ -756,15 +715,27 @@ function install_service_on_systemd() { ${csudo}systemctl daemon-reload ${csudo}systemctl enable ${serverName2} - ${csudo}systemctl daemon-reload } function install_adapter_service() { if ((${service_mod} == 0)); then - [ -f ${script_dir}/cfg/${adapterName}.service ] && - ${csudo}cp ${script_dir}/cfg/${adapterName}.service \ + [ -f ${script_dir}/cfg/${adapterName2}.service ] && + ${csudo}cp ${script_dir}/cfg/${adapterName2}.service \ ${service_config_dir}/ || : + + ${csudo}systemctl enable ${adapterName2} + ${csudo}systemctl daemon-reload + fi +} + +function install_keeper_service() { + if ((${service_mod} == 0)); then + [ -f ${script_dir}/cfg/${clientName2}keeper.service ] && + ${csudo}cp ${script_dir}/cfg/${clientName2}keeper.service \ + ${service_config_dir}/ || : + + ${csudo}systemctl enable ${clientName2}keeper ${csudo}systemctl daemon-reload fi } @@ -901,6 +872,7 @@ function updateProduct() { install_log install_header install_lib + install_config if [ "$verMode" == "cluster" ]; then install_connector @@ -912,9 +884,9 @@ function updateProduct() { if [ -z $1 ]; then install_bin install_service - install_adapter_service - install_config + install_adapter_service install_adapter_config + install_keeper_service openresty_work=false @@ -957,19 +929,18 @@ function updateProduct() { # fi echo - echo -e "\033[44;32;1m${productName2} is updated successfully!${NC}" + echo "${productName2} is updated successfully!" echo if [ "$verMode" == "cluster" ];then - echo -e "\033[44;32;1mTo start all the components \t: sudo ./start-all.sh${NC}" + echo -e "\033[44;32;1mTo start all the components : sudo ./start-all.sh${NC}" fi - echo -e "\033[44;32;1mTo access ${productName2} \t\t: ${clientName2} -h $serverFqdn${NC}" + echo -e "\033[44;32;1mTo access ${productName2} : ${clientName2} -h $serverFqdn${NC}" if [ "$verMode" == "cluster" ];then - echo -e "\033[44;32;1mTo access the management system \t: http://$serverFqdn:6060${NC}" - echo -e "\033[44;32;1mTo read the user manual \t: http://$serverFqdn:6060/docs${NC}" + echo -e "\033[44;32;1mTo access the management system : http://$serverFqdn:6060${NC}" + echo -e "\033[44;32;1mTo read the user manual : http://$serverFqdn:6060/docs${NC}" fi else - install_bin - install_config + install_bin echo echo -e "\033[44;32;1m${productName2} client is updated successfully!${NC}" @@ -1001,6 +972,7 @@ function installProduct() { install_jemalloc #install_avro lib #install_avro lib64 + install_config if [ "$verMode" == "cluster" ]; then install_connector @@ -1014,10 +986,10 @@ function installProduct() { install_service install_adapter_service install_adapter_config + install_keeper_service openresty_work=false - install_config # Ask if to start the service echo @@ -1068,20 +1040,20 @@ function installProduct() { # echo # fi echo - echo -e "\033[44;32;1m${productName2} is installed successfully!${NC}" + echo "${productName2} is installed successfully!" echo if [ "$verMode" == "cluster" ];then - echo -e "\033[44;32;1mTo start all the components \t: sudo ./start-all.sh${NC}" + echo -e "\033[44;32;1mTo start all the components : sudo ./start-all.sh${NC}" fi - echo -e "\033[44;32;1mTo access ${productName2} \t\t: ${clientName2} -h $serverFqdn${NC}" + echo -e "\033[44;32;1mTo access ${productName2} : ${clientName2} -h $serverFqdn${NC}" if [ "$verMode" == "cluster" ];then - echo -e "\033[44;32;1mTo access the management system \t: http://$serverFqdn:6060${NC}" - echo -e "\033[44;32;1mTo read the user manual \t: http://$serverFqdn:6060/docs${NC}" + echo -e "\033[44;32;1mTo access the management system : http://$serverFqdn:6060${NC}" + echo -e "\033[44;32;1mTo read the user manual : http://$serverFqdn:6060/docs${NC}" fi echo else # Only install client install_bin - install_config + echo echo -e "\033[44;32;1m${productName2} client is installed successfully!${NC}" fi @@ -1117,4 +1089,6 @@ elif [ "$verType" == "client" ]; then fi else echo "please input correct verType" -fi \ No newline at end of file +fi + + diff --git a/packaging/tools/makepkg.sh b/packaging/tools/makepkg.sh index d94e6f566d..1be8e23e56 100755 --- a/packaging/tools/makepkg.sh +++ b/packaging/tools/makepkg.sh @@ -374,6 +374,7 @@ if [ "$verMode" == "cluster" ]; then cp -r ${top_dir}/../enterprise/src/plugins/taosx/release/taosx ${install_dir} cp ${top_dir}/../enterprise/packaging/install_taosx.sh ${install_dir}/taosx cp ${top_dir}/../enterprise/src/plugins/taosx/packaging/uninstall.sh ${install_dir}/taosx + sed -i 's/target=\"\"/target=\"taosx\"/g' ${install_dir}/taosx/uninstall.sh else echo "taox package not found" exit 1 diff --git a/packaging/tools/remove.sh b/packaging/tools/remove.sh index 37cc357065..a32788bbd0 100755 --- a/packaging/tools/remove.sh +++ b/packaging/tools/remove.sh @@ -175,7 +175,7 @@ function clean_log() { function clean_service_on_systemd() { taosd_service_config="${service_config_dir}/${taos_service_name}.service" if systemctl is-active --quiet ${taos_service_name}; then - echo "${productName2} ${serverName2} is running, stopping it..." + echo "${taos_service_name} ${taos_service_name} is running, stopping it..." ${csudo}systemctl stop ${taos_service_name} &>/dev/null || echo &>/dev/null fi ${csudo}systemctl disable ${taos_service_name} &>/dev/null || echo &>/dev/null @@ -196,28 +196,6 @@ function clean_service_on_systemd() { fi ${csudo}systemctl disable ${tarbitrator_service_name} &>/dev/null || echo &>/dev/null - if [ "$verMode" == "cluster" ] && [ "$clientName" != "$clientName2" ]; then - x_service_config="${service_config_dir}/${xName2}.service" - if [ -e "$x_service_config" ]; then - if systemctl is-active --quiet ${xName2}; then - echo "${productName2} ${xName2} is running, stopping it..." - ${csudo}systemctl stop ${xName2} &>/dev/null || echo &>/dev/null - fi - ${csudo}systemctl disable ${xName2} &>/dev/null || echo &>/dev/null - ${csudo}rm -f ${x_service_config} - fi - - explorer_service_config="${service_config_dir}/${explorerName2}.service" - if [ -e "$explorer_service_config" ]; then - if systemctl is-active --quiet ${explorerName2}; then - echo "${productName2} ${explorerName2} is running, stopping it..." - ${csudo}systemctl stop ${explorerName2} &>/dev/null || echo &>/dev/null - fi - ${csudo}systemctl disable ${explorerName2} &>/dev/null || echo &>/dev/null - ${csudo}rm -f ${explorer_service_config} - ${csudo}rm -f /etc/${clientName2}/explorer.toml - fi - fi } function clean_service_on_sysvinit() { @@ -287,10 +265,7 @@ function clean_service() { function uninstall_taosx() { if [ -f /usr/local/taosx/uninstall.sh ]; then cd /usr/local/taosx - bash uninstall.sh > /dev/null - - echo -e "${GREEN}${xName2} is removed successfully!${NC}" - echo -e "${GREEN}${explorerName2} is removed successfully!${NC}" + bash uninstall.sh fi } @@ -332,8 +307,10 @@ if [ "$osType" = "Darwin" ]; then ${csudo}rm -rf /Applications/TDengine.app fi -echo -e "${GREEN}${productName2} is removed successfully!${NC}" if [ "$verMode" == "cluster" ]; then uninstall_taosx fi + +echo +echo "${productName2} is removed successfully!" echo \ No newline at end of file diff --git a/source/dnode/vnode/src/tq/tqStreamTaskSnap.c b/source/dnode/vnode/src/tq/tqStreamTaskSnap.c index 09fffa1f74..f22ecc3daf 100644 --- a/source/dnode/vnode/src/tq/tqStreamTaskSnap.c +++ b/source/dnode/vnode/src/tq/tqStreamTaskSnap.c @@ -198,8 +198,6 @@ int32_t streamTaskSnapWriterClose(SStreamTaskWriter* pWriter, int8_t rollback) { taosWLockLatch(&pTq->pStreamMeta->lock); tqDebug("vgId:%d, vnode stream-task snapshot writer closed", TD_VID(pTq->pVnode)); - - taosWLockLatch(&pTq->pStreamMeta->lock); if (rollback) { tdbAbort(pTq->pStreamMeta->db, pTq->pStreamMeta->txn); } else { @@ -208,21 +206,13 @@ int32_t streamTaskSnapWriterClose(SStreamTaskWriter* pWriter, int8_t rollback) { code = tdbPostCommit(pTq->pStreamMeta->db, pTq->pStreamMeta->txn); if (code) goto _err; } - if (tdbBegin(pTq->pStreamMeta->db, &pTq->pStreamMeta->txn, tdbDefaultMalloc, tdbDefaultFree, NULL, 0) < 0) { - code = -1; - goto _err; - } - - taosWUnLockLatch(&pTq->pStreamMeta->lock); if (tdbBegin(pTq->pStreamMeta->db, &pTq->pStreamMeta->txn, tdbDefaultMalloc, tdbDefaultFree, NULL, 0) < 0) { code = -1; taosMemoryFree(pWriter); goto _err; } - taosWUnLockLatch(&pTq->pStreamMeta->lock); - taosMemoryFree(pWriter); return code; diff --git a/source/libs/executor/inc/executorInt.h b/source/libs/executor/inc/executorInt.h index d5d144ee65..c5f077d57f 100644 --- a/source/libs/executor/inc/executorInt.h +++ b/source/libs/executor/inc/executorInt.h @@ -636,6 +636,7 @@ typedef struct SStreamFillSupporter { SSHashObj* pResMap; bool hasDelete; SStorageAPI* pAPI; + STimeWindow winRange; } SStreamFillSupporter; typedef struct SStreamFillOperatorInfo { @@ -770,6 +771,7 @@ SSDataBlock* getNextBlockFromDownstreamImpl(struct SOperatorInfo* pOperator, int bool inSlidingWindow(SInterval* pInterval, STimeWindow* pWin, SDataBlockInfo* pBlockInfo); bool inCalSlidingWindow(SInterval* pInterval, STimeWindow* pWin, TSKEY calStart, TSKEY calEnd, EStreamType blockType); bool compareVal(const char* v, const SStateKeys* pKey); +bool inWinRange(STimeWindow* range, STimeWindow* cur); int32_t getNextQualifiedWindow(SInterval* pInterval, STimeWindow* pNext, SDataBlockInfo* pDataBlockInfo, TSKEY* primaryKeys, int32_t prevPosition, int32_t order); diff --git a/source/libs/executor/src/filloperator.c b/source/libs/executor/src/filloperator.c index 9fce058c4c..ecc2526dd9 100644 --- a/source/libs/executor/src/filloperator.c +++ b/source/libs/executor/src/filloperator.c @@ -950,7 +950,10 @@ static bool hasRemainCalc(SStreamFillInfo* pFillInfo) { static void doStreamFillNormal(SStreamFillSupporter* pFillSup, SStreamFillInfo* pFillInfo, SSDataBlock* pBlock) { while (hasRemainCalc(pFillInfo) && pBlock->info.rows < pBlock->info.capacity) { - buildFillResult(pFillInfo->pResRow, pFillSup, pFillInfo->current, pBlock); + STimeWindow st = {.skey = pFillInfo->current, .ekey = pFillInfo->current}; + if (inWinRange(&pFillSup->winRange, &st)) { + buildFillResult(pFillInfo->pResRow, pFillSup, pFillInfo->current, pBlock); + } pFillInfo->current = taosTimeAdd(pFillInfo->current, pFillSup->interval.sliding, pFillSup->interval.slidingUnit, pFillSup->interval.precision); } @@ -960,7 +963,8 @@ static void doStreamFillLinear(SStreamFillSupporter* pFillSup, SStreamFillInfo* while (hasRemainCalc(pFillInfo) && pBlock->info.rows < pBlock->info.capacity) { uint64_t groupId = pBlock->info.id.groupId; SWinKey key = {.groupId = groupId, .ts = pFillInfo->current}; - if (pFillSup->hasDelete && !checkResult(pFillSup, pFillInfo->current, groupId)) { + STimeWindow st = {.skey = pFillInfo->current, .ekey = pFillInfo->current}; + if ( ( pFillSup->hasDelete && !checkResult(pFillSup, pFillInfo->current, groupId) ) || !inWinRange(&pFillSup->winRange, &st) ) { pFillInfo->current = taosTimeAdd(pFillInfo->current, pFillSup->interval.sliding, pFillSup->interval.slidingUnit, pFillSup->interval.precision); pFillInfo->pLinearInfo->winIndex++; @@ -1345,6 +1349,11 @@ static SSDataBlock* doStreamFill(SOperatorInfo* pOperator) { pInfo->pFillInfo->preRowKey = INT64_MIN; } + pInfo->pFillSup->winRange = pTaskInfo->streamInfo.fillHistoryWindow; + if (pInfo->pFillSup->winRange.ekey <= 0) { + pInfo->pFillSup->winRange.ekey = INT64_MAX; + } + switch (pBlock->info.type) { case STREAM_RETRIEVE: return pBlock; diff --git a/tests/script/tsim/stream/ignoreCheckUpdate.sim b/tests/script/tsim/stream/ignoreCheckUpdate.sim index 725251b081..108c845e4d 100644 --- a/tests/script/tsim/stream/ignoreCheckUpdate.sim +++ b/tests/script/tsim/stream/ignoreCheckUpdate.sim @@ -206,6 +206,8 @@ print create stream streams3 trigger at_once ignore update 1 into streamt3 as se sql create stream streams3 trigger at_once ignore update 1 into streamt3 as select _wstart c1, count(*) c2, max(b) c3 from st interval(10s); +sleep 2000 + sql insert into t1 values(1648791213000,1,1,1); sql insert into t1 values(1648791213000,2,2,2);