diff --git a/.github/workflows/2.x-aarch64.yml b/.github/workflows/2.x-aarch64.yml index 4adeb404..eaae6533 100644 --- a/.github/workflows/2.x-aarch64.yml +++ b/.github/workflows/2.x-aarch64.yml @@ -92,6 +92,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' uses: actions/checkout@v2 with: submodules: recursive @@ -104,6 +105,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | echo "The uname output was ${{ steps.setup.outputs.uname }}" sudo timedatectl set-timezone Asia/Shanghai @@ -131,6 +133,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' uses: uraimo/run-on-arch-action@v2 with: arch: aarch64 @@ -156,6 +159,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' uses: uraimo/run-on-arch-action@v2 with: arch: aarch64 @@ -182,6 +186,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' uses: uraimo/run-on-arch-action@v2 with: arch: aarch64 diff --git a/.github/workflows/2.x-archlinux-release.yml b/.github/workflows/2.x-archlinux-release.yml index 061ba74a..b982846a 100644 --- a/.github/workflows/2.x-archlinux-release.yml +++ b/.github/workflows/2.x-archlinux-release.yml @@ -83,6 +83,7 @@ jobs: (needs.check-changed.outputs.changedflag == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | pacman -Syu --noconfirm > /dev/null pacman -Sy git --noconfirm > /dev/null @@ -92,6 +93,7 @@ jobs: (needs.check-changed.outputs.changedflag == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' uses: actions/checkout@v2 with: submodules: recursive @@ -104,6 +106,7 @@ jobs: (needs.check-changed.outputs.changedflag == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | echo "disable timezone changing" #timedatectl set-timezone Asia/Shanghai @@ -123,6 +126,7 @@ jobs: (needs.check-changed.outputs.changedflag == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' uses: actions/setup-go@v3 with: go-version: 1.17 @@ -132,6 +136,7 @@ jobs: (needs.check-changed.outputs.changedflag == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' uses: actions-rs/toolchain@v1 with: toolchain: stable @@ -141,6 +146,7 @@ jobs: (needs.check-changed.outputs.changedflag == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' id: cache-rust with: path: | @@ -155,6 +161,7 @@ jobs: (needs.check-changed.outputs.changedflag == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | pacman -Sy --noconfirm gcc make cmake zlib snappy gcc-libs pkg-config python3 python-pip > /dev/null gcc --version @@ -171,6 +178,7 @@ jobs: (needs.check-changed.outputs.changedflag == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | pip3 install decorator numpy fabric2 psutil pandas faker toml > /dev/null pip3 install taospy > /dev/null @@ -187,6 +195,7 @@ jobs: (needs.check-changed.outputs.changedflag == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | if [ -f ~/taosdump-failed.txt ]; then cat ~/taosdump-failed.txt; diff --git a/.github/workflows/2.x-armv7.yml b/.github/workflows/2.x-armv7.yml index a22f30cd..21a71c5d 100644 --- a/.github/workflows/2.x-armv7.yml +++ b/.github/workflows/2.x-armv7.yml @@ -92,6 +92,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' uses: actions/checkout@v2 with: submodules: recursive @@ -104,6 +105,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | echo "The uname output was ${{ steps.setup.outputs.uname }}" sudo timedatectl set-timezone Asia/Shanghai @@ -131,6 +133,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' uses: uraimo/run-on-arch-action@v2 with: arch: armv7 diff --git a/.github/workflows/2.x-centos-release.yml b/.github/workflows/2.x-centos-release.yml index 7bdb9b1e..337803a3 100644 --- a/.github/workflows/2.x-centos-release.yml +++ b/.github/workflows/2.x-centos-release.yml @@ -83,6 +83,7 @@ jobs: (needs.check-changed.outputs.changedflag == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | echo "yum update" yum update -y > /dev/null @@ -99,6 +100,7 @@ jobs: (needs.check-changed.outputs.changedflag == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' uses: actions/checkout@v2 with: submodules: recursive @@ -111,6 +113,7 @@ jobs: (needs.check-changed.outputs.changedflag == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | echo "disable timezone changing" #timedatectl set-timezone Asia/Shanghai @@ -130,6 +133,7 @@ jobs: (needs.check-changed.outputs.changedflag == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' uses: actions/setup-go@v3 with: go-version: 1.17 @@ -139,6 +143,7 @@ jobs: (needs.check-changed.outputs.changedflag == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' uses: actions-rs/toolchain@v1 with: toolchain: stable @@ -148,6 +153,7 @@ jobs: (needs.check-changed.outputs.changedflag == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' id: cache-rust with: path: | @@ -162,6 +168,7 @@ jobs: (needs.check-changed.outputs.changedflag == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | yum install -y python3 python3-pip zlib-devel zlib-static xz-devel snappy-devel jansson jansson-devel pkgconfig libatomic libatomic-static libstdc++-static openssl-devel > /dev/null python3 -m pip install --upgrade pip > /dev/null 2>&1 @@ -177,6 +184,7 @@ jobs: (needs.check-changed.outputs.changedflag == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | pip3 install decorator numpy fabric2 psutil pandas faker toml > /dev/null pip3 install taospy > /dev/null @@ -193,6 +201,7 @@ jobs: (needs.check-changed.outputs.changedflag == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | if [ -f ~/taosdump-failed.txt ]; then cat ~/taosdump-failed.txt; diff --git a/.github/workflows/2.x-macos-debug.yml b/.github/workflows/2.x-macos-debug.yml index 85110fde..7dde0740 100644 --- a/.github/workflows/2.x-macos-debug.yml +++ b/.github/workflows/2.x-macos-debug.yml @@ -73,8 +73,8 @@ jobs: - name: Checkout TDengine's taos-tools to PR number if: | - github.event_name == 'pull_request' && - steps.changed-files-specific.outputs.any_changed == 'true' + (github.event_name == 'pull_request' + && steps.changed-files-specific.outputs.any_changed == 'true') run: | cd TDengine/src/kit/taos-tools git fetch origin +refs/pull/${{env.PR_NUMBER}}/merge diff --git a/.github/workflows/2.x-macos-release.yml b/.github/workflows/2.x-macos-release.yml index 064d2568..7023fb88 100644 --- a/.github/workflows/2.x-macos-release.yml +++ b/.github/workflows/2.x-macos-release.yml @@ -73,8 +73,8 @@ jobs: - name: Checkout TDengine's taos-tools to PR number if: | - github.event_name == 'pull_request' && - steps.changed-files-specific.outputs.any_changed == 'true' + (github.event_name == 'pull_request' + && steps.changed-files-specific.outputs.any_changed == 'true') run: | cd TDengine/src/kit/taos-tools git fetch origin +refs/pull/${{env.PR_NUMBER}}/merge diff --git a/.github/workflows/2.x-taosbenchmark-debug.yml b/.github/workflows/2.x-taosbenchmark-debug.yml index bec9d897..71d28ff1 100644 --- a/.github/workflows/2.x-taosbenchmark-debug.yml +++ b/.github/workflows/2.x-taosbenchmark-debug.yml @@ -73,8 +73,8 @@ jobs: - name: Checkout TDengine's taos-tools to PR number if: | - steps.changed-files-specific.outputs.any_changed == 'true' && - github.event_name == 'pull_request' + (steps.changed-files-specific.outputs.any_changed == 'true' && + github.event_name == 'pull_request') run: | cd TDengine/src/kit/taos-tools git fetch origin +refs/pull/${{env.PR_NUMBER}}/merge diff --git a/.github/workflows/2.x-taosbenchmark-release.yml b/.github/workflows/2.x-taosbenchmark-release.yml index 6c16bc82..51796d31 100644 --- a/.github/workflows/2.x-taosbenchmark-release.yml +++ b/.github/workflows/2.x-taosbenchmark-release.yml @@ -73,8 +73,8 @@ jobs: - name: Checkout TDengine's taos-tools to PR number if: | - steps.changed-files-specific.outputs.any_changed == 'true' && - github.event_name == 'pull_request' + (steps.changed-files-specific.outputs.any_changed == 'true' + && github.event_name == 'pull_request') run: | cd TDengine/src/kit/taos-tools git fetch origin +refs/pull/${{env.PR_NUMBER}}/merge diff --git a/.github/workflows/2.x-taosdump-debug.yml b/.github/workflows/2.x-taosdump-debug.yml index 115b334b..e6f8f444 100644 --- a/.github/workflows/2.x-taosdump-debug.yml +++ b/.github/workflows/2.x-taosdump-debug.yml @@ -74,8 +74,8 @@ jobs: - name: Checkout TDengine's taos-tools to PR number if: | - steps.changed-files-specific.outputs.any_changed == 'true' && - github.event_name == 'pull_request' + (steps.changed-files-specific.outputs.any_changed == 'true' + && github.event_name == 'pull_request') run: | cd TDengine/src/kit/taos-tools git fetch origin +refs/pull/${{env.PR_NUMBER}}/merge diff --git a/.github/workflows/2.x-taosdump-release.yml b/.github/workflows/2.x-taosdump-release.yml index a684a395..52d8f98f 100644 --- a/.github/workflows/2.x-taosdump-release.yml +++ b/.github/workflows/2.x-taosdump-release.yml @@ -83,8 +83,8 @@ jobs: - name: Checkout TDengine's taos-tools to PR number if: | - steps.changed-files-specific.outputs.any_changed == 'true' && - github.event_name == 'pull_request' + (steps.changed-files-specific.outputs.any_changed == 'true' + && github.event_name == 'pull_request') run: | cd TDengine/src/kit/taos-tools git fetch origin +refs/pull/${{env.PR_NUMBER}}/merge diff --git a/.github/workflows/2.x-windows-build.yml b/.github/workflows/2.x-windows-build.yml index 99e17fe4..0726feac 100644 --- a/.github/workflows/2.x-windows-build.yml +++ b/.github/workflows/2.x-windows-build.yml @@ -60,6 +60,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' uses: actions/checkout@v2 with: submodules: recursive @@ -69,8 +70,8 @@ jobs: - name: Checkout TDengine's taos-tools to PR number if: | - github.event_name == 'pull_request' && - steps.changed-files-specific.outputs.any_changed == 'true' + (github.event_name == 'pull_request' + && steps.changed-files-specific.outputs.any_changed == 'true') run: | cd TDengine/src/kit/taos-tools git fetch origin +refs/pull/${{env.PR_NUMBER}}/merge @@ -82,6 +83,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | choco install jom gawk grep -y #cd TDengine && mkdir debug && cd debug && cmake .. -G "NMake Makefiles JOM" -DBUILD_JDBC=false -DBUILD_TOOLS=true && jom && jom install diff --git a/.github/workflows/3.0-alpine.yml b/.github/workflows/3.0-alpine.yml index 94647343..5b99b1b1 100644 --- a/.github/workflows/3.0-alpine.yml +++ b/.github/workflows/3.0-alpine.yml @@ -78,6 +78,7 @@ jobs: (needs.check-changed.outputs.changedflag == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' uses: jirutka/setup-alpine@v1 @@ -86,9 +87,10 @@ jobs: (needs.check-changed.outputs.changedflag == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | cat /etc/alpine-release - apk add argp-standalone bash curl cmake gcc make g++ git go procps lsof valgrind linux-headers libunwind libunwind-dev tzdata wget jansson-dev snappy-dev xz-dev zlib-dev + apk add argp-standalone bash curl cmake gcc g++ geos-dev git go procps lsof make valgrind linux-headers libunwind libunwind-dev tzdata wget jansson-dev snappy-dev xz-dev zlib-dev shell: alpine.sh --root {0} - name: Build & Install TDengine @@ -96,11 +98,12 @@ jobs: (needs.check-changed.outputs.changedflag == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' shell: alpine.sh --root {0} run: | git clone --branch main --depth 1 https://github.com/taosdata/TDengine > /dev/null || exit 1 - cd TDengine && mkdir debug && cd debug && cmake .. -DBUILD_TOOLS=true -DTOOLS_BUILD_TYPE=${{env.TOOLS_BUILD_TYPE}} -DBUILD_HTTP=false && make -j8 && make install + cd TDengine && mkdir debug && cd debug && cmake .. -DBUILD_TOOLS=true -DTOOLS_BUILD_TYPE=${{env.TOOLS_BUILD_TYPE}} -DBUILD_HTTP=false && make -j2 && make install if [[ ! -f /usr/local/taos/bin/taosd ]] || [[ ! -f /usr/local/taos/bin/taos ]] then echo "TDengien build failure" diff --git a/.github/workflows/3.0-archlinux-release.yml b/.github/workflows/3.0-archlinux-release.yml index c05585e3..639815cc 100644 --- a/.github/workflows/3.0-archlinux-release.yml +++ b/.github/workflows/3.0-archlinux-release.yml @@ -82,6 +82,7 @@ jobs: (needs.check-changed.outputs.changedflag == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | pacman -Syu --noconfirm > /dev/null pacman -Sy git --noconfirm > /dev/null @@ -91,6 +92,7 @@ jobs: (needs.check-changed.outputs.changedflag == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' uses: actions/checkout@v2 with: submodules: recursive @@ -103,6 +105,7 @@ jobs: (needs.check-changed.outputs.changedflag == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | echo "disable timezone changing" #timedatectl set-timezone Asia/Shanghai @@ -113,6 +116,7 @@ jobs: (needs.check-changed.outputs.changedflag == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' uses: actions/setup-go@v3 with: go-version: 1.17 @@ -122,6 +126,7 @@ jobs: (needs.check-changed.outputs.changedflag == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' uses: actions-rs/toolchain@v1 with: toolchain: stable @@ -131,6 +136,7 @@ jobs: (needs.check-changed.outputs.changedflag == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' id: cache-rust with: path: | @@ -145,11 +151,12 @@ jobs: (needs.check-changed.outputs.changedflag == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | - pacman -Sy --noconfirm gcc make cmake zlib snappy gcc-libs pkg-config python3 python-pip > /dev/null + pacman -Sy --noconfirm gcc make cmake gcc-libs gflags pkg-config python3 python-pip snappy zlib > /dev/null gcc --version python3 -m pip install --upgrade pip > /dev/null 2>&1 - cd TDengine && mkdir debug && cd debug && cmake .. -DBUILD_HTTP=false -DWEBSOCKET=true > /dev/null && make -j8 > /dev/null && make install > /dev/null + cd TDengine && mkdir debug && cd debug && cmake .. -DBUILD_HTTP=false -DWEBSOCKET=true && make -j2 > /dev/null && make install > /dev/null if [[ ! -f /usr/local/taos/bin/taosd ]] || [[ ! -f /usr/local/taos/bin/taosadapter ]] then echo "TDengine build failure" @@ -161,6 +168,7 @@ jobs: (needs.check-changed.outputs.changedflag == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' uses: actions/checkout@v3 with: fetch-depth: 0 # OR "2" -> To retrieve the preceding commit. @@ -179,6 +187,7 @@ jobs: (needs.check-changed.outputs.changedflag == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | mkdir debug ||: cd debug diff --git a/.github/workflows/3.0-coveralls.yml b/.github/workflows/3.0-coveralls.yml index 37de1fad..8c064d37 100644 --- a/.github/workflows/3.0-coveralls.yml +++ b/.github/workflows/3.0-coveralls.yml @@ -66,6 +66,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' uses: actions/checkout@v2 with: repository: 'taosdata/TDengine' @@ -77,6 +78,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | sudo timedatectl set-timezone Asia/Shanghai sudo date @@ -115,13 +117,16 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | whoami + sudo apt update > /dev/null + sudo apt install libgflags2.2 libgflags-dev libgeos-dev -y > /dev/null cd TDengine mkdir debug ||: cd debug cmake .. -DBUILD_JDBC=false -DBUILD_HTTP=false -DWEBSOCKET=true > /dev/null - make -j8 > /dev/null && sudo make install > /dev/null && cd .. && rm -rf debug + make -j2 > /dev/null && sudo make install > /dev/null && cd .. && rm -rf debug if [[ ! -f /usr/local/taos/bin/taosd ]] || [[ ! -f /usr/local/taos/bin/taosadapter ]] then echo "TDengine build failure" @@ -130,8 +135,10 @@ jobs: - name: show TDengine's taosws commit if: | - steps.changed-files-specific.outputs.any_changed == 'true' && - github.event_name == 'pull_request' + (steps.changed-files-specific.outputs.any_changed == 'true' + && github.event_name == 'pull_request') + || github.event_name == 'push' + || github.event_name == 'schedule' run: | cd TDengine/tools/taosws-rs git log --oneline | head -1 @@ -141,6 +148,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | sudo apt update > /dev/null sudo apt-get install lzma-dev liblzma-dev libjansson-dev libz-dev zlib1g libsnappy-dev pkg-config lcov expect -y > /dev/null @@ -158,6 +166,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | mkdir debug ||: cd debug @@ -175,6 +184,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | echo "TEST: taodump -p" cd tests/taosdump @@ -185,6 +195,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | sudo pkill -9 taosadapter || : sudo pkill -9 taosd || : @@ -219,6 +230,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | sudo pkill -9 taosadapter || : sudo pkill -9 taosd || : @@ -263,6 +275,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | sudo pkill -9 taosadapter || : sudo pkill -9 taosd || : @@ -330,6 +343,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | sudo pkill -9 taosadapter || : sudo pkill -9 taosd || : @@ -353,6 +367,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | sudo pkill -9 taosadapter || : sudo pkill -9 taosd || : @@ -383,6 +398,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | sudo pkill -9 taosadapter || : sudo pkill -9 taosd || : @@ -427,6 +443,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | sudo pkill -9 taosadapter || : sudo pkill -9 taosd || : @@ -449,6 +466,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | sudo pkill -9 taosadapter || : sudo pkill -9 taosd || : @@ -494,6 +512,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | sudo pkill -9 taosadapter || : sudo pkill -9 taosd || : @@ -526,6 +545,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | sudo pkill -9 taosadapter || : sudo pkill -9 taosd || : @@ -572,6 +592,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | sudo pkill -9 taosadapter || : sudo pkill -9 taosd || : @@ -593,6 +614,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | cd tests sudo pkill -9 taosadapter || : @@ -611,6 +633,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | cd tests sudo pkill -9 taosadapter || : @@ -628,6 +651,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | sudo pkill -9 taosadapter || : sudo pkill -9 taosd || : @@ -651,6 +675,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | sudo pkill -9 taosadapter || : sudo pkill -9 taosd || : @@ -668,6 +693,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | sudo pkill -9 taosadapter || : sudo pkill -9 taosd || : @@ -686,6 +712,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | cd tests @@ -703,6 +730,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | cd tests @@ -716,6 +744,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | topdir=`pwd` cd debug @@ -739,6 +768,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' uses: coverallsapp/github-action@master with: github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/3.0-macos-debug.yml b/.github/workflows/3.0-macos-debug.yml index 96b4dc0a..9514b448 100644 --- a/.github/workflows/3.0-macos-debug.yml +++ b/.github/workflows/3.0-macos-debug.yml @@ -62,6 +62,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' uses: actions/checkout@v2 with: repository: 'taosdata/TDengine' @@ -73,6 +74,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | #sudo timedatectl set-timezone Asia/Shanghai #sudo date @@ -82,9 +84,10 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | brew update - brew install argp-standalone pkg-config + brew install argp-standalone pkg-config geos brew info argp-standalone - name: Set up Go @@ -92,6 +95,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' uses: actions/setup-go@v3 with: go-version: 1.17 @@ -101,6 +105,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' uses: actions-rs/toolchain@v1.0.6 with: toolchain: stable @@ -110,6 +115,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' id: cache-rust with: path: | @@ -124,8 +130,9 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | - cd TDengine && mkdir debug && cd debug && cmake .. -DBUILD_HTTP=false -DWEBSOCKET=true > /dev/null && make -j8 > /dev/null && sudo make install > /dev/null + cd TDengine && mkdir debug && cd debug && cmake .. -DBUILD_HTTP=false -DWEBSOCKET=true > /dev/null && make -j2 > /dev/null && sudo make install > /dev/null if [[ ! -f /usr/local/bin/taosd ]] || [[ ! -f /usr/local/bin/taosadapter ]] then echo "TDengine build failure" @@ -137,6 +144,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | echo "install package for taos-tools" @@ -153,6 +161,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | mkdir debug ||: cd debug diff --git a/.github/workflows/3.0-macos-release.yml b/.github/workflows/3.0-macos-release.yml index c6323e1b..1fda8b12 100644 --- a/.github/workflows/3.0-macos-release.yml +++ b/.github/workflows/3.0-macos-release.yml @@ -62,6 +62,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' uses: actions/checkout@v2 with: repository: 'taosdata/TDengine' @@ -73,6 +74,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | #sudo timedatectl set-timezone Asia/Shanghai #sudo date @@ -82,9 +84,10 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | brew update - brew install argp-standalone pkg-config + brew install argp-standalone pkg-config geos brew info argp-standalone - name: Set up Go @@ -92,6 +95,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' uses: actions/setup-go@v3 with: go-version: 1.17 @@ -101,6 +105,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' uses: actions-rs/toolchain@v1.0.6 with: toolchain: stable @@ -110,6 +115,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' id: cache-rust with: path: | @@ -124,8 +130,9 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | - cd TDengine && mkdir debug && cd debug && cmake .. -DBUILD_HTTP=false -DWEBSOCKET=true > /dev/null && make -j8 > /dev/null && sudo make install > /dev/null + cd TDengine && mkdir debug && cd debug && cmake .. -DBUILD_HTTP=false -DWEBSOCKET=true > /dev/null && make -j2 > /dev/null && sudo make install > /dev/null if [[ ! -f /usr/local/bin/taosd ]] || [[ ! -f /usr/local/bin/taosadapter ]] then echo "TDengine build failure" @@ -137,6 +144,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | echo "install package for taos-tools" @@ -153,6 +161,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | mkdir debug ||: cd debug diff --git a/.github/workflows/3.0-non-x64.yml b/.github/workflows/3.0-non-x64.yml index 67eb7c50..ed645232 100644 --- a/.github/workflows/3.0-non-x64.yml +++ b/.github/workflows/3.0-non-x64.yml @@ -57,6 +57,7 @@ jobs: env: BASE_BRANCH: ${{ github.base_ref }} if: github.event_name == 'pull_request' + || github.event_name == 'schedule' - uses: actions/checkout@v3 with: @@ -125,6 +126,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' uses: uraimo/run-on-arch-action@v2.1.1 with: arch: aarch64 @@ -133,6 +135,7 @@ jobs: echo "Install packages on ${{ steps.setup.outputs.uname }}" apt update -y > /dev/null apt install -y cmake build-essential git libjansson-dev libsnappy-dev liblzma-dev libz-dev zlib1g pkg-config libssl-dev > /dev/null + apt install libgeos-dev libgflags2.2 libgflags-dev -y > /dev/null echo "clone TDengine 3.0 on ${{ steps.setup.outputs.uname }}" @@ -142,7 +145,7 @@ jobs: cd TDengine || exit 1 mkdir debug ||: cd debug || exit 1 - cmake .. > /dev/null && make -j8 > /dev/null && make install > /dev/null + cmake .. > /dev/null && make -j2 > /dev/null && make install > /dev/null if [[ ! -f /usr/local/taos/bin/taosd ]] then echo "TDengine build failure" @@ -160,7 +163,7 @@ jobs: mkdir debug ||: cd debug - cmake .. -DTOOLS_BUILD_TYPE=${{env.TOOLS_BUILD_TYPE}} > /dev/null && make -j8 > /dev/null && make install > /dev/null + cmake .. -DTOOLS_BUILD_TYPE=${{env.TOOLS_BUILD_TYPE}} > /dev/null && make -j2 > /dev/null && make install > /dev/null if [[ ! -f /usr/local/taos/bin/taosdump ]] || [[ ! -f /usr/local/taos/bin/taosBenchmark ]] then echo "taos-tools build failure" diff --git a/.github/workflows/3.0-taosbenchmark-debug.yml b/.github/workflows/3.0-taosbenchmark-debug.yml index e5737b5e..ba31ec4d 100644 --- a/.github/workflows/3.0-taosbenchmark-debug.yml +++ b/.github/workflows/3.0-taosbenchmark-debug.yml @@ -70,6 +70,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | sudo timedatectl set-timezone Asia/Shanghai sudo date @@ -79,6 +80,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' uses: actions/setup-go@v3 with: go-version: 1.17 @@ -88,6 +90,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' uses: actions-rs/toolchain@v1 with: toolchain: stable @@ -107,8 +110,14 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | - cd TDengine && mkdir debug && cd debug && cmake .. -DBUILD_HTTP=false -DWEBSOCKET=true > /dev/null && make -j8 > /dev/null && sudo make install > /dev/null && cd .. && rm -rf debug + sudo apt update > /dev/null + sudo apt install libgeos-dev libgflags2.2 libgflags-dev -y > /dev/null + cd TDengine && mkdir debug && cd debug \ + && cmake .. -DBUILD_HTTP=false -DWEBSOCKET=true > /dev/null \ + && make -j2 > /dev/null && sudo make install > /dev/null \ + && cd .. && rm -rf debug if [[ ! -f /usr/local/taos/bin/taosd ]] || [[ ! -f /usr/local/taos/bin/taosadapter ]] then echo "TDengine build failure" @@ -120,6 +129,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | sudo apt update > /dev/null sudo apt install lzma-dev liblzma-dev libjansson-dev libz-dev zlib1g libsnappy-dev pkg-config expect -y > /dev/null @@ -137,10 +147,11 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | mkdir debug ||: cd debug - cmake .. -DTOOLS_BUILD_TYPE=${{env.TOOLS_BUILD_TYPE}} -DTOOLS_SANITIZE=true -DWEBSOCKET=true > /dev/null && make -j8 > /dev/null && sudo make install > /dev/null + cmake .. -DTOOLS_BUILD_TYPE=${{env.TOOLS_BUILD_TYPE}} -DTOOLS_SANITIZE=true -DWEBSOCKET=true > /dev/null && make -j2 > /dev/null && sudo make install > /dev/null if [[ ! -f /usr/local/taos/bin/taosdump ]] || [[ ! -f /usr/local/taos/bin/taosBenchmark ]] then echo "taos-tools build failure" @@ -152,6 +163,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | pip3 install decorator numpy fabric2 psutil pandas faker toml taospy > /dev/null @@ -160,6 +172,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | cd tests @@ -179,6 +192,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' env: TDENGINE_CLOUD_DSN: ${{ secrets.TDENGINE_CLOUD_DSN }} run: | @@ -200,6 +214,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | cd tests @@ -219,6 +234,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | cd tests @@ -245,6 +261,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | if [ -f ~/taosbenchmark-release-failed.txt ]; then cat ~/taosbenchmark-release-failed.txt diff --git a/.github/workflows/3.0-taosbenchmark-release.yml b/.github/workflows/3.0-taosbenchmark-release.yml index 3d2110ac..e870eeae 100644 --- a/.github/workflows/3.0-taosbenchmark-release.yml +++ b/.github/workflows/3.0-taosbenchmark-release.yml @@ -70,6 +70,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | sudo timedatectl set-timezone Asia/Shanghai sudo date @@ -79,6 +80,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' uses: actions/setup-go@v3 with: go-version: 1.17 @@ -88,6 +90,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' uses: actions-rs/toolchain@v1 with: toolchain: stable @@ -107,8 +110,14 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | - cd TDengine && mkdir debug && cd debug && cmake .. -DBUILD_HTTP=false -DWEBSOCKET=true > /dev/null && make -j8 > /dev/null && sudo make install > /dev/null && cd .. && rm -rf debug + sudo apt update > /dev/null + sudo apt install libgeos-dev libgflags2.2 libgflags-dev -y > /dev/null + cd TDengine && mkdir debug && cd debug \ + && cmake .. -DBUILD_HTTP=false -DWEBSOCKET=true > /dev/null \ + && make -j2 > /dev/null && sudo make install > /dev/null \ + && cd .. && rm -rf debug if [[ ! -f /usr/local/taos/bin/taosd ]] || [[ ! -f /usr/local/taos/bin/taosadapter ]] then echo "TDengine build failure" @@ -120,6 +129,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | sudo apt update > /dev/null sudo apt install lzma-dev liblzma-dev libjansson-dev libz-dev zlib1g libsnappy-dev pkg-config expect -y > /dev/null @@ -137,10 +147,11 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | mkdir debug ||: cd debug - cmake .. -DTOOLS_BUILD_TYPE=${{env.TOOLS_BUILD_TYPE}} -DWEBSOCKET=true > /dev/null && make -j8 > /dev/null && sudo make install > /dev/null + cmake .. -DTOOLS_BUILD_TYPE=${{env.TOOLS_BUILD_TYPE}} -DWEBSOCKET=true > /dev/null && make -j2 > /dev/null && sudo make install > /dev/null if [[ ! -f /usr/local/taos/bin/taosdump ]] || [[ ! -f /usr/local/taos/bin/taosBenchmark ]] then echo "taos-tools build failure" @@ -152,6 +163,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | pip3 install decorator numpy fabric2 psutil pandas faker toml taospy > /dev/null @@ -160,6 +172,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | cd tests @@ -179,6 +192,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' env: TDENGINE_CLOUD_DSN: ${{ secrets.TDENGINE_CLOUD_DSN }} run: | @@ -200,6 +214,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | cd tests @@ -219,6 +234,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | cd tests @@ -252,6 +268,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | if [ -f ~/taosbenchmark-release-failed.txt ]; then cat ~/taosbenchmark-release-failed.txt diff --git a/.github/workflows/3.0-taosdump-debug.yml b/.github/workflows/3.0-taosdump-debug.yml index 32815f89..7498acf5 100644 --- a/.github/workflows/3.0-taosdump-debug.yml +++ b/.github/workflows/3.0-taosdump-debug.yml @@ -63,6 +63,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' uses: actions/checkout@v2 with: repository: 'taosdata/TDengine' @@ -74,6 +75,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | sudo timedatectl set-timezone Asia/Shanghai sudo date @@ -83,6 +85,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' uses: actions/setup-go@v3 with: go-version: 1.17 @@ -92,11 +95,14 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | + sudo apt update > /dev/null + sudo apt install libgeos-dev libgflags2.2 libgflags-dev -y > /dev/null cd TDengine mkdir debug && cd debug cmake .. -DBUILD_HTTP=false > /dev/null - make -j8 > /dev/null && sudo make install > /dev/null && cd .. && rm -rf debug + make -j2 > /dev/null && sudo make install > /dev/null && cd .. && rm -rf debug if [[ ! -f /usr/local/taos/bin/taosd ]] || [[ ! -f /usr/local/taos/bin/taosadapter ]] then echo "TDengine build failure" @@ -108,7 +114,8 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' - run: sudo apt-get install lzma-dev liblzma-dev libjansson-dev libz-dev zlib1g libsnappy-dev pkg-config lcov expect -y > /dev/null + || github.event_name == 'schedule' + run: sudo apt install lzma-dev libgeos-dev liblzma-dev libjansson-dev libz-dev zlib1g libsnappy-dev pkg-config lcov expect -y > /dev/null - name: Checkout taos-tools to PR number if: | @@ -123,11 +130,12 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | mkdir debug ||: cd debug cmake .. -DTOOLS_BUILD_TYPE=${{env.TOOLS_BUILD_TYPE}} -DTOOLS_SANITIZE=true > /dev/null - make -j8 > /dev/null && sudo make install > /dev/null + make -j2 > /dev/null && sudo make install > /dev/null if [[ ! -f /usr/local/taos/bin/taosdump ]] || [[ ! -f /usr/local/taos/bin/taosBenchmark ]] then echo "taos-tools build failure" @@ -139,6 +147,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | pip3 install decorator numpy fabric2 psutil pandas faker toml taospy > /dev/null @@ -147,6 +156,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | cd tests sudo pkill -9 taosadapter || : @@ -175,6 +185,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | cd tests sudo pkill -9 taosadapter || : @@ -204,6 +215,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | if [ -f ~/taosdump-failed.txt ]; then cat ~/taosdump-failed.txt; diff --git a/.github/workflows/3.0-taosdump-release-ws.yml b/.github/workflows/3.0-taosdump-release-ws.yml index f2644566..63932437 100644 --- a/.github/workflows/3.0-taosdump-release-ws.yml +++ b/.github/workflows/3.0-taosdump-release-ws.yml @@ -63,6 +63,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' uses: actions/checkout@v2 with: repository: 'taosdata/TDengine' @@ -74,6 +75,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | sudo timedatectl set-timezone Asia/Shanghai sudo date @@ -83,6 +85,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' uses: actions/setup-go@v3 with: go-version: 1.17 @@ -92,6 +95,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' uses: actions-rs/toolchain@v1.0.6 with: toolchain: stable @@ -118,12 +122,15 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | + sudo apt update > /dev/null + sudo apt install libgeos-dev libgflags2.2 libgflags-dev -y > /dev/null cd TDengine mkdir debug cd debug cmake .. -DBUILD_HTTP=false -DWEBSOCKET=true > /dev/null - make -j8 > /dev/null && sudo make install > /dev/null && cd .. && rm -rf debug + make -j2 > /dev/null && sudo make install > /dev/null && cd .. && rm -rf debug if [[ ! -f /usr/local/taos/bin/taosd ]] || [[ ! -f /usr/local/taos/bin/taosadapter ]] then echo "TDengine build failure" @@ -143,7 +150,8 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' - run: sudo apt-get install lzma-dev liblzma-dev libjansson-dev libz-dev zlib1g libsnappy-dev pkg-config lcov expect -y > /dev/null + || github.event_name == 'schedule' + run: sudo apt install lzma-dev liblzma-dev libjansson-dev libz-dev zlib1g libsnappy-dev pkg-config lcov expect -y > /dev/null - name: Checkout taos-tools to PR number if: | @@ -158,11 +166,12 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | mkdir debug ||: cd debug cmake .. -DTOOLS_BUILD_TYPE=${{env.TOOLS_BUILD_TYPE}} -DWEBSOCKET=true > /dev/null - make -j8 > /dev/null && sudo make install > /dev/null + make -j2 > /dev/null && sudo make install > /dev/null if [[ ! -f /usr/local/taos/bin/taosdump ]] || [[ ! -f /usr/local/taos/bin/taosBenchmark ]] then echo "taos-tools build failure" @@ -174,6 +183,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | pip3 install decorator numpy fabric2 psutil pandas faker toml taospy > /dev/null @@ -182,6 +192,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | cd tests sudo pkill -9 taosadapter || : @@ -203,6 +214,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | cd debug ./build/bin/taosdump -C https://not-exist.com:80/cloud -D test ||: @@ -214,6 +226,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | if [ -f ~/taosdump-failed.txt ]; then if [ -f ~/taosa.log ]; then diff --git a/.github/workflows/3.0-taosdump-release.yml b/.github/workflows/3.0-taosdump-release.yml index 9118672c..f1d2c5f2 100644 --- a/.github/workflows/3.0-taosdump-release.yml +++ b/.github/workflows/3.0-taosdump-release.yml @@ -63,6 +63,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' uses: actions/checkout@v2 with: repository: 'taosdata/TDengine' @@ -74,6 +75,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | sudo timedatectl set-timezone Asia/Shanghai sudo date @@ -83,6 +85,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' uses: actions/setup-go@v3 with: go-version: 1.17 @@ -92,11 +95,14 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | + sudo apt update > /dev/null + sudo apt install libgeos-dev libgflags2.2 libgflags-dev -y > /dev/null cd TDengine mkdir debug && cd debug cmake .. -DBUILD_HTTP=false > /dev/null - make -j8 > /dev/null && sudo make install > /dev/null && cd .. && rm -rf debug + make -j2 > /dev/null && sudo make install > /dev/null && cd .. && rm -rf debug if [[ ! -f /usr/local/taos/bin/taosd ]] || [[ ! -f /usr/local/taos/bin/taosadapter ]] then echo "TDengine build failure" @@ -108,7 +114,8 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' - run: sudo apt-get install lzma-dev liblzma-dev libjansson-dev libz-dev zlib1g libsnappy-dev pkg-config lcov expect -y > /dev/null + || github.event_name == 'schedule' + run: sudo apt install lzma-dev liblzma-dev libjansson-dev libz-dev zlib1g libsnappy-dev pkg-config lcov expect -y > /dev/null - name: Checkout taos-tools to PR number if: | @@ -123,11 +130,12 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | mkdir debug ||: cd debug cmake .. -DTOOLS_BUILD_TYPE=${{env.TOOLS_BUILD_TYPE}} > /dev/null - make -j8 > /dev/null && sudo make install > /dev/null + make -j2 > /dev/null && sudo make install > /dev/null if [[ ! -f /usr/local/taos/bin/taosdump ]] || [[ ! -f /usr/local/taos/bin/taosBenchmark ]] then echo "taos-tools build failure" @@ -139,6 +147,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | pip3 install decorator numpy fabric2 psutil pandas faker toml taospy > /dev/null @@ -147,6 +156,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | cd tests sudo pkill -9 taosadapter || : @@ -163,6 +173,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | cd tests sudo pkill -9 taosadapter || : @@ -192,6 +203,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | if [ -f ~/taosdump-failed.txt ]; then cat ~/taosdump-failed.txt diff --git a/.github/workflows/3.0-windows-build.yml b/.github/workflows/3.0-windows-build.yml index 59489e82..0d782e0c 100644 --- a/.github/workflows/3.0-windows-build.yml +++ b/.github/workflows/3.0-windows-build.yml @@ -60,6 +60,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' uses: actions/checkout@v2 with: repository: 'taosdata/TDengine' @@ -71,6 +72,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | choco install jom gawk grep -y cd TDengine @@ -82,6 +84,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | cd TDengine/debug cmake .. -G "NMake Makefiles JOM" -DBUILD_TOOLS=true -DTOOLS_BUILD_TYPE=${{env.TOOLS_BUILD_TYPE}} && jom -j 8 && jom install @@ -106,6 +109,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' uses: actions-rs/toolchain@v1 with: toolchain: stable @@ -116,6 +120,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | cd TDengine/debug cmake .. -G "NMake Makefiles JOM" -DBUILD_HTTP=false -DBUILD_TOOLS=true -DTOOLS_BUILD_TYPE=${{env.TOOLS_BUILD_TYPE}} -DWEBSOCKET=true && jom -j8 && jom install @@ -125,6 +130,7 @@ jobs: #(steps.changed-files-specific.outputs.any_changed == 'true' #&& github.event_name == 'pull_request') #|| github.event_name == 'push' + #|| github.event_name == 'schedule' # run: | #cd TDengine/debug diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index a8958d8c..02ac9f01 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -57,6 +57,7 @@ jobs: run: | sudo apt update -y > /dev/null sudo apt install -y cmake build-essential git \ + libgeos-dev libgflags2.2 libgflags-dev \ libjansson-dev libsnappy-dev liblzma-dev libz-dev pkg-config \ libssl-dev > /dev/null @@ -67,7 +68,7 @@ jobs: cd TDengine || exit 1 mkdir debug || exit 1 cd debug || exit 1 - cmake .. > /dev/null && make -j8 > /dev/null && sudo make install > /dev/null + cmake .. > /dev/null && make -j2 > /dev/null && sudo make install > /dev/null if [[ ! -f /usr/local/taos/bin/taosd ]] then echo "TDengine build failure" @@ -80,7 +81,7 @@ jobs: mkdir debug || exit 1 cd debug || exit 1 - cmake .. > /dev/null && make -j8 > /dev/null && sudo make install > /dev/null + cmake .. > /dev/null && make -j2 > /dev/null && sudo make install > /dev/null if [[ ! -f /usr/local/taos/bin/taosdump ]] || [[ ! -f /usr/local/taos/bin/taosBenchmark ]] then echo "taos-tools build failure" diff --git a/.github/workflows/cppcheck.yml b/.github/workflows/cppcheck.yml index c7a5e870..6b8bb56a 100644 --- a/.github/workflows/cppcheck.yml +++ b/.github/workflows/cppcheck.yml @@ -53,6 +53,7 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | sudo apt update -y > /dev/null sudo apt install -y cppcheck @@ -62,5 +63,6 @@ jobs: (steps.changed-files-specific.outputs.any_changed == 'true' && github.event_name == 'pull_request') || github.event_name == 'push' + || github.event_name == 'schedule' run: | for f in `find src inc -type f -name "*.[c,h]" ! -path "src/benchUtilDs.c"`; do cppcheck $f || exit $?; done diff --git a/VERSION b/VERSION index 64ca3db9..94933678 100644 --- a/VERSION +++ b/VERSION @@ -1,3 +1,3 @@ -taosbenchmark-3.2.0 -taosdump-2.5.0 -2.5.0 +taosbenchmark-3.2.1 +taosdump-2.5.1 +2.5.1 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f78a52e8..07174fb7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -317,7 +317,7 @@ IF (${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin INCLUDE_DIRECTORIES(/opt/homebrew/opt/argp-standalone/include/) ELSE () SET_PROPERTY(TARGET argp PROPERTY IMPORTED_LOCATION "/usr/local/lib/libargp.a") - INCLUDE_DIRECTORIES(/usr/local/include/include/) + INCLUDE_DIRECTORIES(/usr/local/include/) ENDIF () TARGET_LINK_LIBRARIES(taosBenchmark taos pthread toolscJson argp ${WEBSOCKET_LINK_FLAGS}) ElSE () diff --git a/src/benchInsert.c b/src/benchInsert.c index aa4f381c..be34a76d 100644 --- a/src/benchInsert.c +++ b/src/benchInsert.c @@ -1002,7 +1002,7 @@ static int startMultiThreadCreateChildTable( pthread_create(pids + i, NULL, createTable, pThreadInfo); } - for (int i = 0; (i < threads && !g_arguments->terminate); i++) { + for (int i = 0; (i < threads && pids[i] !=0); i++) { pthread_join(pids[i], NULL); } @@ -1447,6 +1447,7 @@ static void *syncWriteInterlace(void *sarg) { int64_t pos = 0; uint32_t batchPerTblTimes = g_arguments->reqPerReq / interlaceRows; uint64_t lastPrintTime = toolsGetTimestampMs(); + uint64_t lastTotalInsertRows = 0; int64_t startTs = toolsGetTimestampUs(); int64_t endTs; uint64_t tableSeq = pThreadInfo->start_table_from; @@ -1731,9 +1732,11 @@ static void *syncWriteInterlace(void *sarg) { if (currentPrintTime - lastPrintTime > 30 * 1000) { infoPrint( "thread[%d] has currently inserted rows: %" PRIu64 - "\n", - pThreadInfo->threadID, pThreadInfo->totalInsertRows); + ", peroid insert rate: %.3f rows/s \n", + pThreadInfo->threadID, pThreadInfo->totalInsertRows, + (double)(pThreadInfo->totalInsertRows - lastTotalInsertRows) * 1000.0/(currentPrintTime - lastPrintTime)); lastPrintTime = currentPrintTime; + lastTotalInsertRows = pThreadInfo->totalInsertRows; } } free_of_interlace: @@ -2152,6 +2155,7 @@ void *syncWriteProgressive(void *sarg) { pThreadInfo->end_table_to + 1); #endif uint64_t lastPrintTime = toolsGetTimestampMs(); + uint64_t lastTotalInsertRows = 0; int64_t startTs = toolsGetTimestampUs(); int64_t endTs; @@ -2354,9 +2358,11 @@ void *syncWriteProgressive(void *sarg) { if (currentPrintTime - lastPrintTime > 30 * 1000) { infoPrint( "thread[%d] has currently inserted rows: " - "%" PRId64 "\n", - pThreadInfo->threadID, pThreadInfo->totalInsertRows); + "%" PRId64 ", peroid insert rate: %.3f rows/s \n", + pThreadInfo->threadID, pThreadInfo->totalInsertRows, + (double)(pThreadInfo->totalInsertRows - lastTotalInsertRows) * 1000.0/(currentPrintTime - lastPrintTime)); lastPrintTime = currentPrintTime; + lastTotalInsertRows = pThreadInfo->totalInsertRows; } if (i >= stbInfo->insertRows) { break; @@ -3173,8 +3179,13 @@ static int startMultiThreadInsertData(SDataBase* database, int64_t start = toolsGetTimestampUs(); // wait threads - for (int i = 0; (i < threads && !g_arguments->terminate); i++) { - pthread_join(pids[i], NULL); + for (int i = 0; (i < threads); i++) { + if(pids[i] != 0) { + infoPrint(" pthread_join %d ...\n", i); + pthread_join(pids[i], NULL); + } else { + infoPrint(" pthread_join %d is null , not wait.\n", i); + } } int64_t end = toolsGetTimestampUs()+1; diff --git a/src/benchInsertMix.c b/src/benchInsertMix.c index 5bd09a09..55d74dd3 100644 --- a/src/benchInsertMix.c +++ b/src/benchInsertMix.c @@ -48,13 +48,13 @@ typedef struct { // need generate count , calc from stb->insertRows * ratio uint64_t genCnt[MCNT]; - // status aleady done count + // status already done count uint64_t doneCnt[MCNT]; // task out from batch to list buffer TSKEY* buf[MCNT]; - // bufer cnt + // buffer cnt uint64_t capacity[MCNT]; // capacity size for buf uint64_t bufCnt[MCNT]; // current valid cnt in buf @@ -124,7 +124,7 @@ void mixRatioExit(SMixRatio* mix) { // --------------------- util ---------------- // -// return true can do execute delelte sql +// return true can do execute delete sql bool needExecDel(SMixRatio* mix) { if (mix->genCnt[MDEL] == 0 || mix->doneCnt[MDEL] >= mix->genCnt[MDEL]) { return false; @@ -708,7 +708,7 @@ bool checkCorrect(threadInfo* info, SDataBase* db, SSuperTable* stb, char* tbNam return false; } if (count != calcCount) { - errorPrint("checkCorrect query count unexpect, tbname=%s query=%" PRId64 " expect=%" PRId64, tbName, count, + errorPrint("checkCorrect query count unexpected, tbname=%s query=%" PRId64 " expect=%" PRId64, tbName, count, calcCount); return false; @@ -735,7 +735,7 @@ bool checkCorrect(threadInfo* info, SDataBase* db, SSuperTable* stb, char* tbNam // check count correct if (ts != lastTs) { - errorPrint("checkCorrect query last unexpect, tbname=%s query last=%" PRId64 " expect=%" PRId64, tbName, ts, + errorPrint("checkCorrect query last unexpected, tbname=%s query last=%" PRId64 " expect=%" PRId64, tbName, ts, lastTs); return false; } diff --git a/src/benchJsonOpt.c b/src/benchJsonOpt.c index da4de9be..41592b42 100644 --- a/src/benchJsonOpt.c +++ b/src/benchJsonOpt.c @@ -322,7 +322,7 @@ static int getDatabaseInfo(tools_cJSON *dbinfos, int index) { SDbCfg* cfg = benchCalloc(1, sizeof(SDbCfg), true); cfg->name = cfg_object->string; - // get duration vallue + // get duration value if (0 == strcasecmp(cfg_object->string, "duration")) { database->durMinute = getDurationVal(cfg_object); } @@ -707,7 +707,7 @@ static int getStableInfo(tools_cJSON *dbinfos, int index) { superTable->startTimestamp = toolsGetTimestamp(database->precision); superTable->useNow = true; - // fill time with now conflict wih check_sql + // fill time with now conflict with check_sql g_arguments->check_sql = false; } else { if (toolsParseTime(ts->valuestring, diff --git a/src/benchQuery.c b/src/benchQuery.c index 87096796..63816b81 100644 --- a/src/benchQuery.c +++ b/src/benchQuery.c @@ -184,9 +184,13 @@ static void *specifiedTableQuery(void *sarg) { } while (index < queryTimes) { - if (g_queryInfo.specifiedQueryInfo.queryInterval - && (et - st) < - (int64_t)g_queryInfo.specifiedQueryInfo.queryInterval*1000) { + // check cancel + if (g_arguments->terminate) { + return NULL; + } + + if (g_queryInfo.specifiedQueryInfo.queryInterval && + (et - st) < (int64_t)g_queryInfo.specifiedQueryInfo.queryInterval * 1000) { toolsMsleep((int32_t)( g_queryInfo.specifiedQueryInfo.queryInterval*1000 - (et - st))); // ms @@ -392,144 +396,187 @@ static int multi_thread_super_table_query(uint16_t iface, char* dbName) { return ret; } +// free g_queryInfo.specailQueryInfo memory , can re-call +void freeSpecialQueryInfo() { + // can re-call + if (g_queryInfo.specifiedQueryInfo.sqls == NULL) { + return; + } + + // loop free each item memory + for (int i = 0; i < g_queryInfo.specifiedQueryInfo.sqls->size; ++i) { + SSQL *sql = benchArrayGet(g_queryInfo.specifiedQueryInfo.sqls, i); + tmfree(sql->command); + tmfree(sql->delay_list); + } + + // free Array + benchArrayDestroy(g_queryInfo.specifiedQueryInfo.sqls); + g_queryInfo.specifiedQueryInfo.sqls = NULL; +} + + static int multi_thread_specified_table_query(uint16_t iface, char* dbName) { pthread_t * pids = NULL; threadInfo *infos = NULL; //==== create sub threads for query from specify table int nConcurrent = g_queryInfo.specifiedQueryInfo.concurrent; uint64_t nSqlCount = g_queryInfo.specifiedQueryInfo.sqls->size; - if ((nSqlCount > 0) && (nConcurrent > 0)) { - pids = benchCalloc(1, nConcurrent*nSqlCount*sizeof(pthread_t), false); - infos = benchCalloc(1, nConcurrent*nSqlCount*sizeof(threadInfo), false); - for (uint64_t i = 0; i < nSqlCount; i++) { - SSQL * sql = benchArrayGet(g_queryInfo.specifiedQueryInfo.sqls, i); - for (int j = 0; j < nConcurrent; j++) { - uint64_t seq = i * nConcurrent + j; - threadInfo *pThreadInfo = infos + seq; - pThreadInfo->threadID = (int)seq; - pThreadInfo->querySeq = i; - if (iface == REST_IFACE) { - int sockfd = createSockFd(); - // int iMode = 1; - // ioctl(sockfd, FIONBIO, &iMode); - if (sockfd < 0) { - tmfree((char *)pids); - tmfree((char *)infos); - return -1; - } - pThreadInfo->sockfd = sockfd; - } else { - pThreadInfo->conn = initBenchConn(); - if (pThreadInfo->conn == NULL) { - destroySockFd(pThreadInfo->sockfd); - tmfree((char *)pids); - tmfree((char *)infos); - return -1; - } + + // check invaid + if(nSqlCount == 0 || nConcurrent == 0 ) { + if(nSqlCount == 0) + infoPrint(" query sql count is %" PRIu64 ". must set query sqls. \n", nSqlCount); + if(nConcurrent == 0) + infoPrint(" concurrent is %d , specified_table_query->concurrent must not zero. \n", nConcurrent); + return 0; + } + + // malloc funciton global memory + pids = benchCalloc(1, nConcurrent * sizeof(pthread_t), false); + infos = benchCalloc(1, nConcurrent * sizeof(threadInfo), false); + + bool exeError = false; + for (uint64_t i = 0; i < nSqlCount; i++) { + // reset + memset(pids, 0, nConcurrent * sizeof(pthread_t)); + memset(infos, 0, nConcurrent * sizeof(threadInfo)); + + // get execute sql + SSQL *sql = benchArrayGet(g_queryInfo.specifiedQueryInfo.sqls, i); + + // create threads + for (int j = 0; j < nConcurrent; j++) { + threadInfo *pThreadInfo = infos + j; + pThreadInfo->threadID = i * nConcurrent + j; + pThreadInfo->querySeq = i; + if (iface == REST_IFACE) { + int sockfd = createSockFd(); + // int iMode = 1; + // ioctl(sockfd, FIONBIO, &iMode); + if (sockfd < 0) { + exeError = true; + + break; } + pThreadInfo->sockfd = sockfd; + } else { + pThreadInfo->conn = initBenchConn(); + if (pThreadInfo->conn == NULL) { + destroySockFd(pThreadInfo->sockfd); + exeError = true; + break; + } + } - pthread_create(pids + seq, NULL, specifiedTableQuery, - pThreadInfo); - } - for (int j = 0; j < nConcurrent; j++) { - uint64_t seq = i * nConcurrent + j; - pthread_join(pids[seq], NULL); - threadInfo *pThreadInfo = infos + seq; - if (iface == REST_IFACE) { + pthread_create(pids + j, NULL, specifiedTableQuery, pThreadInfo); + } + + // if failed, set termainte flag true like ctrl+c exit + if (exeError) { + errorPrint(" i=%" PRIu64 " create thread occur error, so wait exit ...\n", i); + g_arguments->terminate = true; + } + + // wait threads execute finished one by one + for (int j = 0; (j < nConcurrent && pids[j] > 0) ; j++) { + pthread_join(pids[j], NULL); + threadInfo *pThreadInfo = infos + j; + if (iface == REST_IFACE) { #ifdef WINDOWS - closesocket(pThreadInfo->sockfd); - WSACleanup(); + closesocket(pThreadInfo->sockfd); + WSACleanup(); #else - close(pThreadInfo->sockfd); + close(pThreadInfo->sockfd); #endif - } else { - closeBenchConn(pThreadInfo->conn); - } - if (g_fail) { - tmfree(pThreadInfo->query_delay_list); - } - } + } else { + closeBenchConn(pThreadInfo->conn); + pThreadInfo->conn = NULL; + } - if (g_fail) { - tmfree((char *)pids); - tmfree((char *)infos); - return -1; - } - uint64_t query_times = g_queryInfo.specifiedQueryInfo.queryTimes; - uint64_t totalQueryTimes = query_times * nConcurrent; - double avg_delay = 0.0; - for (int j = 0; j < nConcurrent; j++) { - uint64_t seq = i * nConcurrent + j; - threadInfo *pThreadInfo = infos + seq; - avg_delay += pThreadInfo->avg_delay; - for (uint64_t k = 0; - k < g_queryInfo.specifiedQueryInfo.queryTimes; k++) { - sql->delay_list[j*query_times + k] = - pThreadInfo->query_delay_list[k]; - } + // need exit in loop + if (g_fail || g_arguments->terminate) { + // free BArray tmfree(pThreadInfo->query_delay_list); - } - avg_delay /= nConcurrent; - qsort(sql->delay_list, g_queryInfo.specifiedQueryInfo.queryTimes, - sizeof(uint64_t), compare); - infoPrintNoTimestamp("complete query with %d threads and %"PRIu64 - " query delay " - "avg: \t%.6fs " - "min: \t%.6fs " - "max: \t%.6fs " - "p90: \t%.6fs " - "p95: \t%.6fs " - "p99: \t%.6fs " - "SQL command: %s" - "\n", - nConcurrent, query_times, - avg_delay/1E6, /* avg */ - sql->delay_list[0]/1E6, /* min */ - sql->delay_list[totalQueryTimes - 1]/1E6, /* max */ - /* p90 */ - sql->delay_list[(uint64_t)(totalQueryTimes * 0.90)]/1E6, - /* p95 */ - sql->delay_list[(uint64_t)(totalQueryTimes * 0.95)]/1E6, - /* p99 */ - sql->delay_list[(uint64_t)(totalQueryTimes * 0.99)]/1E6, - sql->command); - infoPrintNoTimestampToFile(g_arguments->fpOfInsertResult, - "complete query with %d threads and %"PRIu64 - " query delay " - "avg: \t%.6fs " - "min: \t%.6fs " - "max: \t%.6fs " - "p90: \t%.6fs " - "p95: \t%.6fs " - "p99: \t%.6fs " - "SQL command: %s" - "\n", - nConcurrent, query_times, - avg_delay/1E6, /* avg */ - sql->delay_list[0]/1E6, /* min */ - sql->delay_list[totalQueryTimes - 1]/1E6, /* max */ - /* p90 */ - sql->delay_list[(uint64_t)(totalQueryTimes * 0.90)]/1E6, - /* p95 */ - sql->delay_list[(uint64_t)(totalQueryTimes * 0.95)]/1E6, - /* p99 */ - sql->delay_list[(uint64_t)(totalQueryTimes * 0.99)]/1E6, - sql->command); + pThreadInfo->query_delay_list = NULL; + } } - } else { - return 0; + + // cancel or need exit check + if (g_fail || g_arguments->terminate) { + // free current funciton malloc memory + tmfree((char *)pids); + tmfree((char *)infos); + // free global + freeSpecialQueryInfo(); + return -1; + } + + // execute successfully + uint64_t query_times = g_queryInfo.specifiedQueryInfo.queryTimes; + uint64_t totalQueryTimes = query_times * nConcurrent; + double avg_delay = 0.0; + for (int j = 0; j < nConcurrent; j++) { + threadInfo *pThreadInfo = infos + j; + avg_delay += pThreadInfo->avg_delay; + for (uint64_t k = 0; k < g_queryInfo.specifiedQueryInfo.queryTimes; k++) { + sql->delay_list[j * query_times + k] = pThreadInfo->query_delay_list[k]; + } + + // free BArray + tmfree(pThreadInfo->query_delay_list); + pThreadInfo->query_delay_list = NULL; + } + avg_delay /= nConcurrent; + qsort(sql->delay_list, g_queryInfo.specifiedQueryInfo.queryTimes, sizeof(uint64_t), compare); + infoPrintNoTimestamp("complete query with %d threads and %" PRIu64 + " query delay " + "avg: \t%.6fs " + "min: \t%.6fs " + "max: \t%.6fs " + "p90: \t%.6fs " + "p95: \t%.6fs " + "p99: \t%.6fs " + "SQL command: %s" + "\n", + nConcurrent, query_times, avg_delay / 1E6, /* avg */ + sql->delay_list[0] / 1E6, /* min */ + sql->delay_list[totalQueryTimes - 1] / 1E6, /* max */ + /* p90 */ + sql->delay_list[(uint64_t)(totalQueryTimes * 0.90)] / 1E6, + /* p95 */ + sql->delay_list[(uint64_t)(totalQueryTimes * 0.95)] / 1E6, + /* p99 */ + sql->delay_list[(uint64_t)(totalQueryTimes * 0.99)] / 1E6, sql->command); + infoPrintNoTimestampToFile(g_arguments->fpOfInsertResult, + "complete query with %d threads and %" PRIu64 + " query delay " + "avg: \t%.6fs " + "min: \t%.6fs " + "max: \t%.6fs " + "p90: \t%.6fs " + "p95: \t%.6fs " + "p99: \t%.6fs " + "SQL command: %s" + "\n", + nConcurrent, query_times, avg_delay / 1E6, /* avg */ + sql->delay_list[0] / 1E6, /* min */ + sql->delay_list[totalQueryTimes - 1] / 1E6, /* max */ + /* p90 */ + sql->delay_list[(uint64_t)(totalQueryTimes * 0.90)] / 1E6, + /* p95 */ + sql->delay_list[(uint64_t)(totalQueryTimes * 0.95)] / 1E6, + /* p99 */ + sql->delay_list[(uint64_t)(totalQueryTimes * 0.99)] / 1E6, sql->command); } g_queryInfo.specifiedQueryInfo.totalQueried = g_queryInfo.specifiedQueryInfo.queryTimes * nConcurrent; tmfree((char *)pids); tmfree((char *)infos); - for (int i = 0; i < g_queryInfo.specifiedQueryInfo.sqls->size; ++i) { - SSQL * sql = benchArrayGet(g_queryInfo.specifiedQueryInfo.sqls, i); - tmfree(sql->command); - tmfree(sql->delay_list); - } - benchArrayDestroy(g_queryInfo.specifiedQueryInfo.sqls); + + // free specialQueryInfo + freeSpecialQueryInfo(); return 0; } @@ -587,6 +634,8 @@ static int multi_thread_specified_mixed_query(uint16_t iface, char* dbName) { pThreadInfo->query_delay_list->size); total_delay += pThreadInfo->total_delay; tmfree(pThreadInfo->query_delay_list); + pThreadInfo->query_delay_list = NULL; + if (iface == REST_IFACE) { #ifdef WINDOWS closesocket(pThreadInfo->sockfd); diff --git a/src/benchUtil.c b/src/benchUtil.c index 9cc86ca9..69aeb47c 100644 --- a/src/benchUtil.c +++ b/src/benchUtil.c @@ -310,12 +310,17 @@ SBenchConn* initBenchConn() { } void closeBenchConn(SBenchConn* conn) { + if(conn == NULL) + return ; #ifdef WEBSOCKET if (g_arguments->websocket) { ws_close(conn->taos_ws); } else { #endif - taos_close(conn->taos); + if(conn->taos) { + taos_close(conn->taos); + conn->taos = NULL; + } if (conn->ctaos) { taos_close(conn->ctaos); conn->ctaos = NULL; @@ -1166,6 +1171,11 @@ static void closeSockFd(int sockfd) { } void destroySockFd(int sockfd) { + // check valid + if (sockfd < 0) { + return; + } + // shutdown the connection since no more data will be sent int result; result = shutdown(sockfd, SHUT_WR); diff --git a/tests/taosbenchmark/commandline-partial-col-numpy.py b/tests/taosbenchmark/commandline-partial-col-numpy.py index fe384bbc..da6869a9 100644 --- a/tests/taosbenchmark/commandline-partial-col-numpy.py +++ b/tests/taosbenchmark/commandline-partial-col-numpy.py @@ -63,7 +63,7 @@ def run(self): tdSql.query("select * from test.meters") dbresult = tdSql.queryResult for i in range(len(dbresult[0])): - if i in (1, 2) and dbresult[0][i] == None: + if i in (1, 2) and dbresult[0][i] is None: tdLog.exit("result[0][%d] is NULL, which should not be" % i) else: tdLog.info("result[0][{0}] is {1}".format(i, dbresult[0][i])) diff --git a/tests/taosbenchmark/commandline-single-table.py b/tests/taosbenchmark/commandline-single-table.py index d37e290e..7fe1d097 100644 --- a/tests/taosbenchmark/commandline-single-table.py +++ b/tests/taosbenchmark/commandline-single-table.py @@ -11,7 +11,6 @@ # -*- coding: utf-8 -*- import os -import subprocess from util.log import * from util.cases import * diff --git a/tests/taosbenchmark/query_json-with-error-sqlfile.py b/tests/taosbenchmark/query_json-with-error-sqlfile.py index 4fa5e7e7..b5f30981 100644 --- a/tests/taosbenchmark/query_json-with-error-sqlfile.py +++ b/tests/taosbenchmark/query_json-with-error-sqlfile.py @@ -10,9 +10,7 @@ ################################################################### # -*- coding: utf-8 -*- -import ast import os -import re from util.log import * from util.cases import * diff --git a/tests/taosbenchmark/reuse-exist-stb.py b/tests/taosbenchmark/reuse-exist-stb.py index 64eebbf5..cc49570a 100644 --- a/tests/taosbenchmark/reuse-exist-stb.py +++ b/tests/taosbenchmark/reuse-exist-stb.py @@ -10,9 +10,7 @@ ################################################################### # -*- coding: utf-8 -*- -import ast import os -import re from util.log import * from util.cases import * diff --git a/tests/taosbenchmark/taosc_insert_alltypes_json-partial-col.py b/tests/taosbenchmark/taosc_insert_alltypes_json-partial-col.py index 5b618679..2db38187 100644 --- a/tests/taosbenchmark/taosc_insert_alltypes_json-partial-col.py +++ b/tests/taosbenchmark/taosc_insert_alltypes_json-partial-col.py @@ -58,10 +58,6 @@ def getPath(self, tool="taosBenchmark"): return paths[0] def run(self): - tdSql.query("select client_version()") - client_ver = "".join(tdSql.queryResult[0]) - major_ver = client_ver.split(".")[0] - binPath = self.getPath() cmd = ( "%s -f ./taosbenchmark/json/taosc_insert_alltypes-partial-col.json" @@ -114,7 +110,7 @@ def run(self): tdSql.query("select c0,c1,c2 from db.stb limit 1") dbresult = tdSql.queryResult for i in range(len(dbresult[0])): - if i in (0, 1) and dbresult[0][i] == None: + if i in (0, 1) and dbresult[0][i] is None: tdLog.exit("result[0][%d] is NULL, which should not be" % i) else: tdLog.info("result[0][{0}] is {1}".format(i, dbresult[0][i])) diff --git a/tests/taosbenchmark/taosdemoTestInsertWithJsonStmt-otherPara.py b/tests/taosbenchmark/taosdemoTestInsertWithJsonStmt-otherPara.py index 9ee9cb16..6aefcb56 100644 --- a/tests/taosbenchmark/taosdemoTestInsertWithJsonStmt-otherPara.py +++ b/tests/taosbenchmark/taosdemoTestInsertWithJsonStmt-otherPara.py @@ -11,7 +11,6 @@ # -*- coding: utf-8 -*- -import sys import os from util.log import * from util.cases import * @@ -216,7 +215,6 @@ def run(self): ) # child_table_exists = yes, auto_create_table varies = yes tdSql.checkRows(20) - testcaseFilename = os.path.split(__file__)[-1] os.system("rm -rf ./insert_res.txt") def stop(self): diff --git a/tests/taosbenchmark/taosdemoTestQueryWithJson.py b/tests/taosbenchmark/taosdemoTestQueryWithJson.py index e6bb1c6f..b3341f21 100644 --- a/tests/taosbenchmark/taosdemoTestQueryWithJson.py +++ b/tests/taosbenchmark/taosdemoTestQueryWithJson.py @@ -11,7 +11,6 @@ # -*- coding: utf-8 -*- -import sys import os from util.log import * from util.cases import * diff --git a/tests/taosbenchmark/v3/commandline-vgroups.py b/tests/taosbenchmark/v3/commandline-vgroups.py index e2a7a90e..4292e227 100644 --- a/tests/taosbenchmark/v3/commandline-vgroups.py +++ b/tests/taosbenchmark/v3/commandline-vgroups.py @@ -11,7 +11,6 @@ # -*- coding: utf-8 -*- import os -import subprocess from util.log import * from util.cases import * diff --git a/tests/taosbenchmark/v3/default_tmq_json.py b/tests/taosbenchmark/v3/default_tmq_json.py index 7b31818e..f3b0dc0c 100644 --- a/tests/taosbenchmark/v3/default_tmq_json.py +++ b/tests/taosbenchmark/v3/default_tmq_json.py @@ -10,7 +10,8 @@ ################################################################### # -*- coding: utf-8 -*- -import os, signal +# import os, signal +import os from time import sleep from util.log import * from util.cases import * @@ -61,24 +62,25 @@ def run(self): tdLog.info("%s" % cmd) os.system("%s" % cmd) tdSql.execute("reset query cache") - + tdSql.execute("alter database db WAL_RETENTION_PERIOD 3600000") - + cmd = "%s -f ./taosbenchmark/json/tmq.json " % binPath tdLog.info("%s" % cmd) os.system("%s" % cmd) - time.sleep(15) -# try: -# for line in os.popen("ps ax | grep taosBenchmark | grep -v grep"): -# fields = line.split() - -# pid = fields[0] - -# os.kill(int(pid), signal.SIGINT) -# time.sleep(3) -# print("taosBenchmark be killed on purpose") -# except: -# tdLog.exit("failed to kill taosBenchmark") + sleep(15) + + # try: + # for line in os.popen("ps ax | grep taosBenchmark | grep -v grep"): + # fields = line.split() + + # pid = fields[0] + + # os.kill(int(pid), signal.SIGINT) + # time.sleep(3) + # print("taosBenchmark be killed on purpose") + # except: + # tdLog.exit("failed to kill taosBenchmark") def stop(self): tdSql.close() diff --git a/tests/taosbenchmark/v3/query_json-kill-slow-query.py b/tests/taosbenchmark/v3/query_json-kill-slow-query.py index 9b37abb5..cc2075c8 100644 --- a/tests/taosbenchmark/v3/query_json-kill-slow-query.py +++ b/tests/taosbenchmark/v3/query_json-kill-slow-query.py @@ -11,7 +11,6 @@ # -*- coding: utf-8 -*- import os -import re import subprocess from util.log import *