From d0b7e937ac0ecdcd1254075356d32076010ed820 Mon Sep 17 00:00:00 2001 From: liuyq-617 Date: Thu, 29 Jul 2021 14:11:09 +0800 Subject: [PATCH 1/4] make CI happy --- tests/pytest/update/merge_commit_data2.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/pytest/update/merge_commit_data2.py b/tests/pytest/update/merge_commit_data2.py index 3f0fc718ad..5fc58e3b4f 100644 --- a/tests/pytest/update/merge_commit_data2.py +++ b/tests/pytest/update/merge_commit_data2.py @@ -28,6 +28,7 @@ class TDTestCase: def restart_taosd(self,db): tdDnodes.stop(1) tdDnodes.startWithoutSleep(1) + tdsql.sleep(2) tdSql.execute("use %s;" % db) def date_to_timestamp_microseconds(self, date): From eefa3cf5d1eec63071478fe293be8b7d3347651d Mon Sep 17 00:00:00 2001 From: liuyq-617 Date: Thu, 29 Jul 2021 18:17:31 +0800 Subject: [PATCH 2/4] change --- tests/pytest/update/merge_commit_data2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pytest/update/merge_commit_data2.py b/tests/pytest/update/merge_commit_data2.py index 5fc58e3b4f..d4dbfec554 100644 --- a/tests/pytest/update/merge_commit_data2.py +++ b/tests/pytest/update/merge_commit_data2.py @@ -28,7 +28,7 @@ class TDTestCase: def restart_taosd(self,db): tdDnodes.stop(1) tdDnodes.startWithoutSleep(1) - tdsql.sleep(2) + tdSql.sleep(2) tdSql.execute("use %s;" % db) def date_to_timestamp_microseconds(self, date): From cd744f5fa71f68f842b8482695f3f5ac0f893ad3 Mon Sep 17 00:00:00 2001 From: liuyq-617 Date: Fri, 30 Jul 2021 09:32:13 +0800 Subject: [PATCH 3/4] fix --- tests/pytest/update/merge_commit_data2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pytest/update/merge_commit_data2.py b/tests/pytest/update/merge_commit_data2.py index d4dbfec554..a334f39e86 100644 --- a/tests/pytest/update/merge_commit_data2.py +++ b/tests/pytest/update/merge_commit_data2.py @@ -28,7 +28,7 @@ class TDTestCase: def restart_taosd(self,db): tdDnodes.stop(1) tdDnodes.startWithoutSleep(1) - tdSql.sleep(2) + tdLog.sleep(2) tdSql.execute("use %s;" % db) def date_to_timestamp_microseconds(self, date): From fae99ad04de19748d75ea1afdeb9a534df936b08 Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Fri, 30 Jul 2021 13:13:38 +0800 Subject: [PATCH 4/4] [TD-5628]: prompt --force-keep-file if upgrade lower version with 2.0.16.0 (#7080) --- packaging/tools/install.sh | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/packaging/tools/install.sh b/packaging/tools/install.sh index a9c3a085db..e116d72d26 100755 --- a/packaging/tools/install.sh +++ b/packaging/tools/install.sh @@ -54,6 +54,7 @@ if command -v sudo > /dev/null; then fi update_flag=0 +prompt_force=0 initd_mod=0 service_mod=2 @@ -780,7 +781,18 @@ function is_version_compatible() { min_compatible_version=$(${script_dir}/bin/taosd -V | head -1 | cut -d ' ' -f 5) fi + # [TD-5628] prompt to execute taosd --force-keep-file if upgrade from lower version within 2.0.16.0 + exist_version=$(/usr/local/taos/bin/taosd -V | head -1 | cut -d ' ' -f 3) + vercomp $exist_version "2.0.16.0" + case $? in + 2) + prompt_force=1 + ;; + esac + vercomp $curr_version $min_compatible_version + echo "" # avoid $? value not update + case $? in 0) return 0;; 1) return 0;; @@ -789,6 +801,12 @@ function is_version_compatible() { } function update_TDengine() { + # Check if version compatible + if ! is_version_compatible; then + echo -e "${RED}Version incompatible${NC}" + return 1 + fi + # Start to update if [ ! -e taos.tar.gz ]; then echo "File taos.tar.gz does not exist" @@ -797,12 +815,6 @@ function update_TDengine() { tar -zxf taos.tar.gz install_jemalloc - # Check if version compatible - if ! is_version_compatible; then - echo -e "${RED}Version incompatible${NC}" - return 1 - fi - echo -e "${GREEN}Start to update TDengine...${NC}" # Stop the service if running if pidof taosd &> /dev/null; then @@ -875,6 +887,10 @@ function update_TDengine() { echo -e "${GREEN_DARK}To access TDengine ${NC}: use ${GREEN_UNDERLINE}taos -h $serverFqdn${NC} in shell${NC}" fi + if ((${prompt_force}==1)); then + echo "" + echo -e "${RED}Please run 'taosd --force-keep-file' at first time for the exist TDengine $exist_version!${NC}" + fi echo echo -e "\033[44;32;1mTDengine is updated successfully!${NC}" else