Skip to content

Commit

Permalink
feat(core): allow changing db params(only apply for dummy & read-only) (
Browse files Browse the repository at this point in the history
#398)

User can alter the params of read-only dummy storage engine. The HAS_DATA & IS_READ_ONLY attributes cannot be modified.

SQL
ALTER STORAGEENGINE <engine_id> WITH PARAMS "(<param_key>:<param_value>,?)+";
example:
alter storageengine 2 with params "dummy_dir:test/new_data";

——简化实现,后续随节点移除、容错能力的增强,需要相应调整实现

同时,按需相应调整测试脚本目录结构
  • Loading branch information
shinyano authored Aug 6, 2024
1 parent a731313 commit d805bb2
Show file tree
Hide file tree
Showing 49 changed files with 851 additions and 89 deletions.
60 changes: 30 additions & 30 deletions .github/actions/dbRunner/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ runs:
shell: bash
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
chmod +x "${GITHUB_WORKSPACE}/.github/scripts/dataSources/influxdb.sh"
"${GITHUB_WORKSPACE}/.github/scripts/dataSources/influxdb.sh" 8088 8087
chmod +x "${GITHUB_WORKSPACE}/.github/scripts/dataSources/startup/influxdb.sh"
"${GITHUB_WORKSPACE}/.github/scripts/dataSources/startup/influxdb.sh" 8088 8087
elif [ "$RUNNER_OS" == "Windows" ]; then
chmod +x "${GITHUB_WORKSPACE}/.github/scripts/dataSources/influxdb_windows.sh"
"${GITHUB_WORKSPACE}/.github/scripts/dataSources/influxdb_windows.sh" 8088 8087
chmod +x "${GITHUB_WORKSPACE}/.github/scripts/dataSources/startup/influxdb_windows.sh"
"${GITHUB_WORKSPACE}/.github/scripts/dataSources/startup/influxdb_windows.sh" 8088 8087
elif [ "$RUNNER_OS" == "macOS" ]; then
chmod +x "${GITHUB_WORKSPACE}/.github/scripts/dataSources/influxdb_macos.sh"
"${GITHUB_WORKSPACE}/.github/scripts/dataSources/influxdb_macos.sh" 8088 8087
chmod +x "${GITHUB_WORKSPACE}/.github/scripts/dataSources/startup/influxdb_macos.sh"
"${GITHUB_WORKSPACE}/.github/scripts/dataSources/startup/influxdb_macos.sh" 8088 8087
else
echo "$RUNNER_OS is not supported"
exit 1
Expand All @@ -46,14 +46,14 @@ runs:
shell: bash
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
chmod +x "${GITHUB_WORKSPACE}/.github/scripts/dataSources/iotdb12.sh"
"${GITHUB_WORKSPACE}/.github/scripts/dataSources/iotdb12.sh" 6667 6668 6669
chmod +x "${GITHUB_WORKSPACE}/.github/scripts/dataSources/startup/iotdb12.sh"
"${GITHUB_WORKSPACE}/.github/scripts/dataSources/startup/iotdb12.sh" 6667 6668 6669
elif [ "$RUNNER_OS" == "Windows" ]; then
chmod +x "${GITHUB_WORKSPACE}/.github/scripts/dataSources/iotdb12_windows.sh"
"${GITHUB_WORKSPACE}/.github/scripts/dataSources/iotdb12_windows.sh" 6667 6668 6669
chmod +x "${GITHUB_WORKSPACE}/.github/scripts/dataSources/startup/iotdb12_windows.sh"
"${GITHUB_WORKSPACE}/.github/scripts/dataSources/startup/iotdb12_windows.sh" 6667 6668 6669
elif [ "$RUNNER_OS" == "macOS" ]; then
chmod +x "${GITHUB_WORKSPACE}/.github/scripts/dataSources/iotdb12_macos.sh"
"${GITHUB_WORKSPACE}/.github/scripts/dataSources/iotdb12_macos.sh" 6667 6668 6669
chmod +x "${GITHUB_WORKSPACE}/.github/scripts/dataSources/startup/iotdb12_macos.sh"
"${GITHUB_WORKSPACE}/.github/scripts/dataSources/startup/iotdb12_macos.sh" 6667 6668 6669
else
echo "$RUNNER_OS is not supported"
exit 1
Expand All @@ -64,14 +64,14 @@ runs:
shell: bash
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
chmod +x "${GITHUB_WORKSPACE}/.github/scripts/dataSources/mix_iotdb12_influxdb.sh"
"${GITHUB_WORKSPACE}/.github/scripts/dataSources/mix_iotdb12_influxdb.sh"
chmod +x "${GITHUB_WORKSPACE}/.github/scripts/dataSources/startup/mix_iotdb12_influxdb.sh"
"${GITHUB_WORKSPACE}/.github/scripts/dataSources/startup/mix_iotdb12_influxdb.sh"
elif [ "$RUNNER_OS" == "Windows" ]; then
chmod +x "${GITHUB_WORKSPACE}/.github/scripts/dataSources/mix_iotdb12_influxdb_windows.sh"
"${GITHUB_WORKSPACE}/.github/scripts/dataSources/mix_iotdb12_influxdb_windows.sh"
chmod +x "${GITHUB_WORKSPACE}/.github/scripts/dataSources/startup/mix_iotdb12_influxdb_windows.sh"
"${GITHUB_WORKSPACE}/.github/scripts/dataSources/startup/mix_iotdb12_influxdb_windows.sh"
elif [ "$RUNNER_OS" == "macOS" ]; then
chmod +x "${GITHUB_WORKSPACE}/.github/scripts/dataSources/mix_iotdb12_influxdb_macos.sh"
"${GITHUB_WORKSPACE}/.github/scripts/dataSources/mix_iotdb12_influxdb_macos.sh"
chmod +x "${GITHUB_WORKSPACE}/.github/scripts/dataSources/startup/mix_iotdb12_influxdb_macos.sh"
"${GITHUB_WORKSPACE}/.github/scripts/dataSources/startup/mix_iotdb12_influxdb_macos.sh"
else
echo "$RUNNER_OS is not supported"
exit 1
Expand All @@ -83,14 +83,14 @@ runs:
run: |
cp -f "${GITHUB_WORKSPACE}/conf/config.properties" "${GITHUB_WORKSPACE}/conf/config.properties.bak"
if [[ "$RUNNER_OS" == "Linux" ]]; then
chmod +x "${GITHUB_WORKSPACE}/.github/scripts/dataSources/parquet_linux_windows.sh"
"${GITHUB_WORKSPACE}/.github/scripts/dataSources/parquet_linux_windows.sh" 6667 6888 test/mn ${GITHUB_WORKSPACE}/test/iginx_mn false false conf/config.properties
chmod +x "${GITHUB_WORKSPACE}/.github/scripts/dataSources/startup/parquet_linux_windows.sh"
"${GITHUB_WORKSPACE}/.github/scripts/dataSources/startup/parquet_linux_windows.sh" 6667 6888 test/mn ${GITHUB_WORKSPACE}/test/iginx_mn false false conf/config.properties
elif [[ "$RUNNER_OS" == "Windows" ]]; then
chmod +x "${GITHUB_WORKSPACE}/.github/scripts/dataSources/parquet_linux_windows.sh"
"${GITHUB_WORKSPACE}/.github/scripts/dataSources/parquet_linux_windows.sh" 6667 6888 test/mn test/iginx_mn false false conf/config.properties
chmod +x "${GITHUB_WORKSPACE}/.github/scripts/dataSources/startup/parquet_linux_windows.sh"
"${GITHUB_WORKSPACE}/.github/scripts/dataSources/startup/parquet_linux_windows.sh" 6667 6888 test/mn test/iginx_mn false false conf/config.properties
elif [ "$RUNNER_OS" == "macOS" ]; then
chmod +x "${GITHUB_WORKSPACE}/.github/scripts/dataSources/parquet_macos.sh"
"${GITHUB_WORKSPACE}/.github/scripts/dataSources/parquet_macos.sh" 6667 6888 test/mn test/iginx_mn false false conf/config.properties
chmod +x "${GITHUB_WORKSPACE}/.github/scripts/dataSources/startup/parquet_macos.sh"
"${GITHUB_WORKSPACE}/.github/scripts/dataSources/startup/parquet_macos.sh" 6667 6888 test/mn test/iginx_mn false false conf/config.properties
else
echo "$RUNNER_OS is not supported"
exit 1
Expand Down Expand Up @@ -122,14 +122,14 @@ runs:
run: |
cp -f "${GITHUB_WORKSPACE}/conf/config.properties" "${GITHUB_WORKSPACE}/conf/config.properties.bak"
if [[ "$RUNNER_OS" == "Linux" ]]; then
chmod +x "${GITHUB_WORKSPACE}/.github/scripts/dataSources/filesystem_linux_windows.sh"
"${GITHUB_WORKSPACE}/.github/scripts/dataSources/filesystem_linux_windows.sh" 6667 6888 test/mn ${GITHUB_WORKSPACE}/test/iginx_mn false false conf/config.properties
chmod +x "${GITHUB_WORKSPACE}/.github/scripts/dataSources/startup/filesystem_linux_windows.sh"
"${GITHUB_WORKSPACE}/.github/scripts/dataSources/startup/filesystem_linux_windows.sh" 6667 6888 test/mn ${GITHUB_WORKSPACE}/test/iginx_mn false false conf/config.properties
elif [[ "$RUNNER_OS" == "Windows" ]]; then
chmod +x "${GITHUB_WORKSPACE}/.github/scripts/dataSources/filesystem_linux_windows.sh"
"${GITHUB_WORKSPACE}/.github/scripts/dataSources/filesystem_linux_windows.sh" 6667 6888 test/mn test/iginx_mn false false conf/config.properties
chmod +x "${GITHUB_WORKSPACE}/.github/scripts/dataSources/startup/filesystem_linux_windows.sh"
"${GITHUB_WORKSPACE}/.github/scripts/dataSources/startup/filesystem_linux_windows.sh" 6667 6888 test/mn test/iginx_mn false false conf/config.properties
elif [ "$RUNNER_OS" == "macOS" ]; then
chmod +x "${GITHUB_WORKSPACE}/.github/scripts/dataSources/filesystem_macos.sh"
"${GITHUB_WORKSPACE}/.github/scripts/dataSources/filesystem_macos.sh" 6667 6888 test/mn test/iginx_mn false false conf/config.properties
chmod +x "${GITHUB_WORKSPACE}/.github/scripts/dataSources/startup/filesystem_macos.sh"
"${GITHUB_WORKSPACE}/.github/scripts/dataSources/startup/filesystem_macos.sh" 6667 6888 test/mn test/iginx_mn false false conf/config.properties
else
echo "$RUNNER_OS is not supported"
exit 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ sed -i "s/#storageEngineList=127.0.0.1#8086/storageEngineList=127.0.0.1#8086/g"

for port in "$@"
do
# target path is also used in update/<db> script
sh -c "sudo cp -r influxdb2-2.0.7-linux-amd64/ influxdb2-2.0.7-linux-amd64-$port/"

sudo sh -c "cd influxdb2-2.0.7-linux-amd64-$port/; nohup ./influxd run --bolt-path=~/.influxdbv2/influxd.bolt --engine-path=~/.influxdbv2/engine --http-bind-address=:$port --query-memory-bytes=20971520 &"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ sed -i "" "s/#storageEngineList=127.0.0.1#8086/storageEngineList=127.0.0.1#8086/

for port in "$@"
do
# target path is also used in update/<db> script
sh -c "sudo cp -r influxdb2-2.0.7-darwin-amd64/ influxdb2-2.0.7-darwin-amd64-$port/"

sudo sh -c "cd influxdb2-2.0.7-darwin-amd64-$port/; nohup ./influxd run --bolt-path=~/.influxdbv2/influxd.bolt --engine-path=~/.influxdbv2/engine --http-bind-address=:$port --query-memory-bytes=20971520 &"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ sed -i "s/#storageEngineList=127.0.0.1#8086/storageEngineList=127.0.0.1#8086/g"

for port in "$@"
do
# target path is also used in update/<db> script
sh -c "cp -r influxdb2-2.0.7-windows-amd64/ influxdb2-2.0.7-windows-amd64-$port/"

pathPrefix="influxdb2-2.0.7-windows-amd64-$port"
Expand All @@ -57,15 +58,4 @@ do
redirect="-RedirectStandardOutput '$pathPrefix/logs/db.log' -RedirectStandardError '$pathPrefix/logs/db-error.log'"

powershell -command "Start-Process -FilePath 'influxdb2-2.0.7-windows-amd64-$port/influxd' $arguments -NoNewWindow $redirect"

sh -c "sleep 10"

sh -c "cat $pathPrefix/logs/db.log"

echo "==========================================="

sh -c "cat $pathPrefix/logs/db-error.log"

echo "==========================================="

done
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ sh -c "sudo sed -i 's/^# compaction_strategy=.*$/compaction_strategy=NO_COMPACTI

for port in "$@"
do
# target path is also used in update/<db> script
sh -c "sudo cp -r apache-iotdb-0.12.6-server-bin/ apache-iotdb-0.12.6-server-bin-$port"

sh -c "sudo sed -i 's/# wal_buffer_size=16777216/wal_buffer_size=167772160/g' apache-iotdb-0.12.6-server-bin-$port/conf/iotdb-engine.properties"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ sh -c "sudo sed -i '' 's/#storageEngineList=127.0.0.1#6667#iotdb12/storageEngine

for port in "$@"
do
# target path is also used in update/<db> script
sh -c "sudo cp -r apache-iotdb-0.12.6-server-bin/ apache-iotdb-0.12.6-server-bin-$port"

sh -c "sudo sed -i '' 's/# wal_buffer_size=16777216/wal_buffer_size=167772160/' apache-iotdb-0.12.6-server-bin-$port/conf/iotdb-engine.properties"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ sh -c "sed -i 's/#storageEngineList=127.0.0.1#6667#iotdb12/storageEngineList=127

for port in "$@"
do
# target path is also used in update/<db> script
sh -c "cp -r apache-iotdb-0.12.6-server-bin/ apache-iotdb-0.12.6-server-bin-$port"

sh -c "sed -i 's/6667/$port/g' apache-iotdb-0.12.6-server-bin-$port/conf/iotdb-engine.properties"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@

set -e

sh -c "chmod +x .github/scripts/dataSources/iotdb12.sh"
sh -c "chmod +x .github/scripts/dataSources/startup/iotdb12.sh"

sh -c "chmod +x .github/scripts/dataSources/influxdb.sh"
sh -c "chmod +x .github/scripts/dataSources/startup/influxdb.sh"

sh -c ".github/scripts/dataSources/iotdb12.sh 6667"
sh -c ".github/scripts/dataSources/startup/iotdb12.sh 6667"

sh -c ".github/scripts/dataSources/influxdb.sh"
sh -c ".github/scripts/dataSources/startup/influxdb.sh"

set -i "s/storageEngineList/#storageEngineList/g" conf/config.properties

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@

set -e

sh -c "chmod +x .github/scripts/dataSources/iotdb12_macos.sh"
sh -c "chmod +x .github/scripts/dataSources/startup/iotdb12_macos.sh"

sh -c "chmod +x .github/scripts/dataSources/influxdb_macos.sh"
sh -c "chmod +x .github/scripts/dataSources/startup/influxdb_macos.sh"

sh -c ".github/scripts/dataSources/iotdb12_macos.sh 6667"
sh -c ".github/scripts/dataSources/startup/iotdb12_macos.sh 6667"

sh -c ".github/scripts/dataSources/influxdb_macos.sh"
sh -c ".github/scripts/dataSources/startup/influxdb_macos.sh"

set -i "s/storageEngineList/#storageEngineList/g" conf/config.properties

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@

set -e

sh -c "chmod +x .github/scripts/dataSources/iotdb12_windows.sh"
sh -c "chmod +x .github/scripts/dataSources/startup/iotdb12_windows.sh"

sh -c "chmod +x .github/scripts/dataSources/influxdb_windows.sh"
sh -c "chmod +x .github/scripts/dataSources/startup/influxdb_windows.sh"

sh -c ".github/scripts/dataSources/iotdb12_windows.sh 6667"
sh -c ".github/scripts/dataSources/startup/iotdb12_windows.sh 6667"

sh -c ".github/scripts/dataSources/influxdb_windows.sh"
sh -c ".github/scripts/dataSources/startup/influxdb_windows.sh"

sed -i "s/storageEngineList/#storageEngineList/g" conf/config.properties

Expand Down
37 changes: 37 additions & 0 deletions .github/scripts/dataSources/update/influxdb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/sh
#
# IGinX - the polystore system with high performance
# Copyright (C) Tsinghua University
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

# usage:.sh <target_port> <new_org_id>

set -e

cd influxdb2-2.0.7-linux-amd64/

# 所有org的信息
output=$(influx org list)

echo $output

# 只有一个组织,所以直接匹配
id=$(echo "$output" | grep -Eo '^[a-z0-9]{16}')

# 验证
echo "Extracted ID: $id"

sh -c "./influx org update --host http://localhost:$1 -t testToken -i $id -n $2"
37 changes: 37 additions & 0 deletions .github/scripts/dataSources/update/influxdb_macos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/sh
#
# IGinX - the polystore system with high performance
# Copyright (C) Tsinghua University
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

# usage:.sh <target_port> <new_org_id>

set -e

cd influxdb2-2.0.7-darwin-amd64/

# 所有org的信息
output=$(influx org list)

echo $output

# 只有一个组织,所以直接匹配
id=$(echo "$output" | grep -Eo '^[a-z0-9]{16}')

# 验证
echo "Extracted ID: $id"

sh -c "./influx org update --host http://localhost:$1 -t testToken -i $id -n $2"
38 changes: 38 additions & 0 deletions .github/scripts/dataSources/update/influxdb_windows.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/sh
#
# IGinX - the polystore system with high performance
# Copyright (C) Tsinghua University
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#


# usage:.sh <target_port> <new_org_id>

set -e

cd influxdb2-2.0.7-windows-amd64/

# 所有org的信息
output=$(influx org list)

echo $output

# 只有一个组织,所以直接匹配
id=$(echo "$output" | grep -Eo '^[a-z0-9]{16}')

# 验证
echo "Extracted ID: $id"

sh -c "./influx org --host http://localhost:$1 -t testToken update -i $id -n $2"
26 changes: 26 additions & 0 deletions .github/scripts/dataSources/update/iotdb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh
#
# IGinX - the polystore system with high performance
# Copyright (C) Tsinghua University
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#


# usage:.sh <port> <old_password> <new_password>

set -e

cd apache-iotdb-0.12.6-server-bin-$1/
sh -c "sbin/start-cli.sh -h 127.0.0.1 -p $1 -u root -pw $2 -e 'ALTER USER root SET PASSWORD \"$3\";'"
26 changes: 26 additions & 0 deletions .github/scripts/dataSources/update/iotdb_macos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh
#
# IGinX - the polystore system with high performance
# Copyright (C) Tsinghua University
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#


# usage:.sh <port> <old_password> <new_password>

set -e

cd apache-iotdb-0.12.6-server-bin-$1/
sh -c "sbin/start-cli.sh -h 127.0.0.1 -p $1 -u root -pw $2 -e 'ALTER USER root SET PASSWORD \"$3\";'"
Loading

0 comments on commit d805bb2

Please sign in to comment.