Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: autosharding tests #1478

Open
wants to merge 59 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
d605940
Add base skeleton and sample to implement sharding tests
donhardman Sep 28, 2023
e0dc556
Fix issues in base tests and add cluster creation reusable blocks
donhardman Oct 3, 2023
254a6bd
Add sharding test to github workflow and update clt version to 0.1.5
donhardman Oct 3, 2023
a4f0e45
Add sharding tests for replication and multiple nodes in cluster vali…
donhardman Oct 3, 2023
c05c5ad
Add tests to cover cluster functionality without using sharding
donhardman Oct 5, 2023
3221092
Add core folder for base tests with CLT
donhardman Oct 13, 2023
72693da
Tests/show threads (#1509)
PavelShilin89 Oct 16, 2023
a993c92
Fix regex to validate versions with KNN included
donhardman Jan 15, 2024
569f7bf
Add base skeleton and sample to implement sharding tests
donhardman Sep 28, 2023
10d45c4
Fix issues in base tests and add cluster creation reusable blocks
donhardman Oct 3, 2023
cb0b7f3
Add sharding test to github workflow and update clt version to 0.1.5
donhardman Oct 3, 2023
d3ab1ea
Add sharding tests for replication and multiple nodes in cluster vali…
donhardman Oct 3, 2023
fde1db2
Add tests to cover cluster functionality without using sharding
donhardman Oct 5, 2023
f510d25
Add core folder for base tests with CLT
donhardman Oct 13, 2023
1d26561
Tests/show threads (#1509)
PavelShilin89 Oct 16, 2023
1ce67e3
Fix regex to validate versions with KNN included
donhardman Jan 15, 2024
e996c65
Update test to make sure that we have no errors from the queue in log…
donhardman Feb 5, 2024
6276be3
Update tests for multpile sharding replication tests
donhardman Feb 26, 2024
42a5b65
Update test.yml
Dec 8, 2023
7be1959
Update job name
Dec 8, 2023
0415ce2
Rename CLT data manipulation test
Dec 9, 2023
6c4ad4e
Update test_prefix in test.yml
Dec 10, 2023
1fd6cf4
Update start-searchd.recb
Dec 14, 2023
3be27cf
Update start-searchd.recb
Jan 9, 2024
cd94508
Update data-manipulation.rec
Jan 9, 2024
822cae4
Update config and test
Jan 24, 2024
7e34e01
Update gitignore, patterns, init
Jan 30, 2024
f98e81e
Update data-manipulation.rec
Feb 5, 2024
5f937cf
Update data-manipulation.rec
Feb 6, 2024
fa83f11
Update .gitignore
Feb 8, 2024
e499dc0
update clt version
Feb 8, 2024
bcff960
Changed data-manipulation.rec and adeed .deb in .gitignore
Feb 8, 2024
b208f54
removing the libssl1.1_1.1.0g-2ubuntu4_amd64.deb package installation…
Feb 12, 2024
3285e0c
name correction in test.yml
Feb 12, 2024
618ed66
update data-manipulation.rec
Feb 19, 2024
d705362
Create data-manipulation.conf
Feb 22, 2024
4ad994d
Added ${EXTRA_SECTION} in test data-manipulation.rec
Feb 25, 2024
dd2fdd0
Update data-manipulation.rec and searchd-with-flexible-ports.conf
Feb 25, 2024
7f6cc94
Improve tests for multiple shards creation on cluster from 5 nodes
donhardman Mar 4, 2024
d5a526e
Fix incorrect branch
donhardman Mar 4, 2024
f121bca
Add checking on manticore.json
donhardman Mar 5, 2024
d524696
Improve test on 5 clusters with 60 shards
donhardman Mar 12, 2024
6294ca8
Create issues-188-examples-1.rec and issues-188-examples-2.rec
Mar 13, 2024
c820c97
Update 5 cluster 60 nodes test
donhardman Mar 18, 2024
af114e2
Exclude no such local table cuz its okay to have it sometimes in erro…
donhardman Mar 18, 2024
07a9337
Fix 60 shards sharding test consistency
donhardman Mar 26, 2024
6754301
Add unique sorting to fix the random issue with different outputs
donhardman Mar 26, 2024
c3be944
Remove validations that was changed due to manticore daemon update
donhardman Apr 10, 2024
2f91e5c
Rename sharding related tables to _ prefixed
donhardman Jun 12, 2024
527b581
Check that we have no error in processed sharding queue table
donhardman Jun 12, 2024
bd88953
Fix regexps
donhardman Jul 8, 2024
64f6fed
Fix regexps in start searchd blocks
donhardman Jul 8, 2024
439b325
Fix 5 clusters 60 shards tests
donhardman Jul 10, 2024
d0747df
Add temporarely mre.rec for investigation purpose
donhardman Jul 10, 2024
b787bb3
added replication verbosity log right on daemon start
tomatolog Jul 14, 2024
1d8113d
Merge branch 'master' into tests/sharding
tomatolog Aug 15, 2024
0cadee0
switching to Codership Galera
tomatolog Aug 28, 2024
22c47e6
Merge branch 'tests/sharding' of github.com:manticoresoftware/mantico…
Sep 5, 2024
ecea8fe
fixed clt test to pass sharding case in a loop
Sep 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 107 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -543,16 +543,114 @@ jobs:
- name: Download artifact
uses: manticoresoftware/download_artifact_with_retries@main
with:
name: manticore_test_kit.img
path: .
- name: Calculate short commit hash
id: sha
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Pushing docker image to repo
id: test-kit-push
run: |
BUILD_COMMIT=${{ steps.sha.outputs.sha_short }} /bin/bash dist/test_kit_docker_push.sh
artifact: manticore_test_kit.img
image: test-kit:img
test_prefix: test/clt-tests/mysqldump/mysql/

clt_mysqldump_maria_test:
name: CLT test on mysqldump features for MariaDB
needs: build_test_kit_docker
runs-on: ubuntu-22.04
steps:
- uses: manticoresoftware/[email protected]
with:
artifact: manticore_test_kit.img
image: test-kit:img
test_prefix: test/clt-tests/mysqldump/maria/

clt_expected_errors_test:
name: CLT test on expected errors in Searchd for Buddy
needs: build_test_kit_docker
runs-on: ubuntu-22.04
steps:
- uses: manticoresoftware/[email protected]
with:
artifact: manticore_test_kit.img
image: test-kit:img
test_prefix: test/clt-tests/expected-errors/

clt_data_manipulation:
name: CLT data manipulation test
needs: build_test_kit_docker
runs-on: ubuntu-22.04
steps:
- uses: manticoresoftware/[email protected]
with:
artifact: manticore_test_kit.img
image: test-kit:img
test_prefix: test/clt-tests/sharding/replication/

clt_sharding_cluster_test:
name: CLT test cluster logic of the manticoresearch
needs: build_test_kit_docker
runs-on: ubuntu-22.04
steps:
- uses: manticoresoftware/[email protected]
with:
artifact: manticore_test_kit.img
image: test-kit:img
test_prefix: test/clt-tests/sharding/cluster/
run_args: -e TELEMETRY=0

clt_sharding_syntax_test:
name: CLT test syntax of autosharding
needs: build_test_kit_docker
runs-on: ubuntu-22.04
steps:
- uses: manticoresoftware/[email protected]
with:
artifact: manticore_test_kit.img
image: test-kit:img
test_prefix: test/clt-tests/sharding/syntax/
run_args: -e TELEMETRY=0

clt_sharding_replication_test:
name: CLT test replication of autosharding
needs: build_test_kit_docker
runs-on: ubuntu-22.04
steps:
- uses: manticoresoftware/[email protected]
with:
artifact: manticore_test_kit.img
image: test-kit:img
test_prefix: test/clt-tests/sharding/replication/
run_args: -e TELEMETRY=0

clt_sharding_rebalancing_test:
name: CLT test rebalancing of autosharding
needs: build_test_kit_docker
runs-on: ubuntu-22.04
steps:
- uses: manticoresoftware/[email protected]
with:
artifact: manticore_test_kit.img
image: test-kit:img
test_prefix: test/clt-tests/sharding/rebalancing/
run_args: -e TELEMETRY=0

clt_sharding_data_test:
name: CLT test data handle in autosharding
needs: build_test_kit_docker
runs-on: ubuntu-22.04
steps:
- uses: manticoresoftware/[email protected]
with:
artifact: manticore_test_kit.img
image: test-kit:img
test_prefix: test/clt-tests/sharding/data/
run_args: -e TELEMETRY=0

clt_sharding_performance_test:
name: CLT test performance of autosharding
needs: build_test_kit_docker
runs-on: ubuntu-22.04
steps:
- uses: manticoresoftware/[email protected]
with:
artifact: manticore_test_kit.img
image: test-kit:img
test_prefix: test/clt-tests/sharding/performance/
run_args: -e TELEMETRY=0
build_aarch64:
if: needs.changes.outputs.source == 'true'
needs: changes
Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,10 @@
# misc
/cache
/local_*_src.txt
/test/clt-tests/**/*.rep
/test/clt-tests/**/*.cmp
/clt
/test/clt-tests/**/*.deb
/test/clt-tests/*repo.noarch.deb.*
/test/.deb
/test/clt-tests/.deb
1 change: 1 addition & 0 deletions .patterns
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
LLDATETIME [A-Za-z]{3}\s+[0-9]{1,2}\s[0-9]{2}:[0-9]{2}
LLFILESIZE \s*[0-9]+(K|B|G)?
COMMITDATE [a-z0-9]{7,9}@[0-9]{6,8}
TIMEMS [0-9]{2}:[0-9]{2}:[0-9]{2}\.[0-9]{3}
13 changes: 13 additions & 0 deletions test/clt-tests/base/start-searchd-1.recb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
––– input –––
searchd --cpustats
––– output –––
Manticore 6.2.13 #!/[a-z0-9]{7,9}@[0-9]{8}/!# dev (columnar 2.2.5 #!/[a-z0-9]{7,9}@[0-9]{8}/!#) (secondary 2.2.5 [A-Za-z0-9]{9}@[0-9]{6}/!#)
Copyright (c) 2001-2016, Andrew Aksyonoff
Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com)
Copyright (c) 2017-2023, Manticore Software LTD (https://manticoresearch.com)
#!/[0-9]{2}:[0-9]{2}\.[0-9]{3}/!# [%{NUMBER}] using config file '/etc/manticoresearch/manticore.conf' (457 chars)...
starting daemon version '6.2.13 #!/[a-z0-9]{7,9}@[0-9]{8}/!# dev (columnar 2.2.5 #!/[a-z0-9]{7,9}@[0-9]{8}/!#) (secondary 2.2.5 #!/[a-z0-9]{7,9}@[0-9]{8}/!#)' ...
listening on all interfaces for mysql, port=9306
listening on UNIX socket /var/run/mysqld/mysqld.sock
listening on all interfaces for sphinx and http(s), port=9312
listening on all interfaces for sphinx and http(s), port=9308
4 changes: 4 additions & 0 deletions test/clt-tests/core/example.rec
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
––– input –––
whoami
––– output –––
root
2 changes: 1 addition & 1 deletion test/clt-tests/core/show-threads.rec
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ This/prev job time: %{NUMBER}#!/(s|ms|us)/!#
CPU activity: %{NUMBER}.%{NUMBER}%
Jobs done: %{NUMBER}
Thread status: working
Info: SHOW THREADS
Info: SHOW THREADS
19 changes: 19 additions & 0 deletions test/clt-tests/installation/start-searchd.recb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
––– input –––
mkdir -p /var/run/manticore
––– output –––
––– input –––
searchd
––– output –––
Manticore %{SEMVER} #!/[a-z0-9]{7,9}@[0-9]{8}/!##!/(\sdev)?\s/!#(columnar %{SEMVER} %{COMMITDATE}) (secondary %{SEMVER} %{COMMITDATE}) (knn %{SEMVER} %{COMMITDATE})
Copyright (c) 2001-2016, Andrew Aksyonoff
Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com)
Copyright (c) 2017-%{YEAR}, Manticore Software LTD (https://manticoresearch.com)
[#!/[0-9]{2}:[0-9]{2}.[0-9]{3}/!#] [#!/[0-9]+/!#] using config file '/etc/manticoresearch/manticore.conf' (%{NUMBER} chars)...
starting daemon version '%{SEMVER} #!/[a-z0-9]{7,9}@[0-9]{6}/!##!/(\sdev)?\s/!#(columnar %{SEMVER} %{COMMITDATE}) (secondary %{SEMVER} %{COMMITDATE}) (knn %{SEMVER} %{COMMITDATE})' ...
listening on %{IPADDR}:9312 for sphinx and http(s)
listening on %{IPADDR}:9306 for mysql
listening on %{IPADDR}:9308 for sphinx and http(s)
––– input –––
timeout 10 tail -n 100 -f /var/log/manticore/searchd.log | grep -qm1 '\[BUDDY\] started' && echo 'Buddy started!' || echo 'Timeout or failed!'
––– output –––
Buddy started!
16 changes: 16 additions & 0 deletions test/clt-tests/sharding/base/config/searchd-1.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
common {
plugin_dir = /usr/local/lib/manticore
lemmatizer_base = /usr/share/manticore/morph/
}
searchd {
listen = 19306:mysql41
listen = 19312
listen = 19308:http
log = /var/log/manticore-1/searchd.log
query_log = /var/log/manticore-1/query.log
pid_file = /var/run/manticore-1/searchd.pid
data_dir = /var/lib/manticore-1
query_log_format = sphinxql
query_log_commands = 1
buddy_path = manticore-executor /workdir/src/main.php --debugv
}
16 changes: 16 additions & 0 deletions test/clt-tests/sharding/base/config/searchd-2.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
common {
plugin_dir = /usr/local/lib/manticore
lemmatizer_base = /usr/share/manticore/morph/
}
searchd {
listen = 29306:mysql41
listen = 29312
listen = 29308:http
log = /var/log/manticore-2/searchd.log
query_log = /var/log/manticore-2/query.log
pid_file = /var/run/manticore-2/searchd.pid
data_dir = /var/lib/manticore-2
query_log_format = sphinxql
query_log_commands = 1
buddy_path = manticore-executor /workdir/src/main.php --debugv
}
16 changes: 16 additions & 0 deletions test/clt-tests/sharding/base/config/searchd-3.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
common {
plugin_dir = /usr/local/lib/manticore
lemmatizer_base = /usr/share/manticore/morph/
}
searchd {
listen = 39306:mysql41
listen = 39312
listen = 39308:http
log = /var/log/manticore-3/searchd.log
query_log = /var/log/manticore-3/query.log
pid_file = /var/run/manticore-3/searchd.pid
data_dir = /var/lib/manticore-3
query_log_format = sphinxql
query_log_commands = 1
buddy_path = manticore-executor /workdir/src/main.php --debugv
}
16 changes: 16 additions & 0 deletions test/clt-tests/sharding/base/config/searchd-4.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
common {
plugin_dir = /usr/local/lib/manticore
lemmatizer_base = /usr/share/manticore/morph/
}
searchd {
listen = 49306:mysql41
listen = 49312
listen = 49308:http
log = /var/log/manticore-4/searchd.log
query_log = /var/log/manticore-4/query.log
pid_file = /var/run/manticore-4/searchd.pid
data_dir = /var/lib/manticore-4
query_log_format = sphinxql
query_log_commands = 1
buddy_path = manticore-executor /workdir/src/main.php --debugv
}
16 changes: 16 additions & 0 deletions test/clt-tests/sharding/base/config/searchd-5.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
common {
plugin_dir = /usr/local/lib/manticore
lemmatizer_base = /usr/share/manticore/morph/
}
searchd {
listen = 59306:mysql41
listen = 59312
listen = 59308:http
log = /var/log/manticore-5/searchd.log
query_log = /var/log/manticore-5/query.log
pid_file = /var/run/manticore-5/searchd.pid
data_dir = /var/lib/manticore-5
query_log_format = sphinxql
query_log_commands = 1
buddy_path = manticore-executor /workdir/src/main.php --debugv
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh
cat << EOF
common {
plugin_dir = /usr/local/lib/manticore
lemmatizer_base = /usr/share/manticore/morph/
}
searchd {
listen = ${INSTANCE}306:mysql41
listen = ${INSTANCE}312
listen = ${INSTANCE}308:http
log = /var/log/manticore-${INSTANCE}/searchd.log
query_log = /var/log/manticore-${INSTANCE}/query.log
pid_file = /var/log/manticore-${INSTANCE}/searchd.pid
data_dir = /var/log/manticore-${INSTANCE}
query_log_format = sphinxql
query_log_commands = 1
${EXTRA_SECTION}
}

EOF
14 changes: 14 additions & 0 deletions test/clt-tests/sharding/base/create-cluster-2.recb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
––– input –––
mysql -h0 -P19306 -e "create cluster c"
––– output –––
––– input –––
mysql -h0 -P29306 -e "join cluster c at '127.0.0.1:19312'"
––– output –––
––– input –––
mysql -h0 -P19306 -e "show status like 'cluster_c_status'"
––– output –––
+------------------+---------+
| Counter | Value |
+------------------+---------+
| cluster_c_status | primary |
+------------------+---------+
17 changes: 17 additions & 0 deletions test/clt-tests/sharding/base/create-cluster-3.recb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
––– input –––
mysql -h0 -P19306 -e "create cluster c"
––– output –––
––– input –––
mysql -h0 -P29306 -e "join cluster c at '127.0.0.1:19312'"
––– output –––
––– input –––
mysql -h0 -P39306 -e "join cluster c at '127.0.0.1:19312'"
––– output –––
––– input –––
mysql -h0 -P19306 -e "show status like 'cluster_c_status'"
––– output –––
+------------------+---------+
| Counter | Value |
+------------------+---------+
| cluster_c_status | primary |
+------------------+---------+
20 changes: 20 additions & 0 deletions test/clt-tests/sharding/base/create-cluster-4.recb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
––– input –––
mysql -h0 -P19306 -e "create cluster c"
––– output –––
––– input –––
mysql -h0 -P29306 -e "join cluster c at '127.0.0.1:19312'"
––– output –––
––– input –––
mysql -h0 -P39306 -e "join cluster c at '127.0.0.1:19312'"
––– output –––
––– input –––
mysql -h0 -P49306 -e "join cluster c at '127.0.0.1:19312'"
––– output –––
––– input –––
mysql -h0 -P19306 -e "show status like 'cluster_c_status'"
––– output –––
+------------------+---------+
| Counter | Value |
+------------------+---------+
| cluster_c_status | primary |
+------------------+---------+
23 changes: 23 additions & 0 deletions test/clt-tests/sharding/base/create-cluster-5.recb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
––– input –––
mysql -h0 -P19306 -e "create cluster c"
––– output –––
––– input –––
mysql -h0 -P29306 -e "join cluster c at '127.0.0.1:19312'"
––– output –––
––– input –––
mysql -h0 -P39306 -e "join cluster c at '127.0.0.1:19312'"
––– output –––
––– input –––
mysql -h0 -P49306 -e "join cluster c at '127.0.0.1:19312'"
––– output –––
––– input –––
mysql -h0 -P59306 -e "join cluster c at '127.0.0.1:19312'"
––– output –––
––– input –––
mysql -h0 -P19306 -e "show status like 'cluster_c_status'"
––– output –––
+------------------+---------+
| Counter | Value |
+------------------+---------+
| cluster_c_status | primary |
+------------------+---------+
9 changes: 9 additions & 0 deletions test/clt-tests/sharding/base/flexible/create-cluster.recb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
––– input –––
mysql -h0 -P1306 -e "create cluster ${CLUSTER_NAME}"
––– output –––
––– input –––
mysql -h0 -P1306 -e "show status like 'cluster_${CLUSTER_NAME}_status'\G"
––– output –––
*************************** 1. row ***************************
Counter: cluster_#!/[a-z]+/!#_status
Value: primary
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
––– input –––
for n in `seq 2 $INSTANCE`; do mysql -h0 -P${n}306 -e "join cluster ${CLUSTER_NAME} at '127.0.0.1:1312'"; done;
––– output –––
––– input –––
mysql -h0 -P${INSTANCE}306 -e "show status like 'cluster_${CLUSTER_NAME}_status'\G"
––– output –––
*************************** 1. row ***************************
Counter: cluster_#!/[a-z]+/!#_status
Value: primary
Loading