-
-
Notifications
You must be signed in to change notification settings - Fork 511
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
SELECT does not wait for FREEZE + UPDATE #2805
base: master
Are you sure you want to change the base?
Conversation
clt👎 CLT tests in test/clt-tests/core/test-freeze-unfreeze-update.rec––– input –––
echo -e "searchd {\n listen = 9315:mysql\n listen = 9316\n log = /tmp/searchd.log\n pid_file = /tmp/searchd.pid\n data_dir = /tmp/data\n watchdog = 0\n}" > /tmp/116.conf
––– output –––
––– input –––
mkdir -p /tmp/data; rm -f /tmp/searchd.log; searchd --stopwait > /dev/null; searchd -c /tmp/116.conf; if timeout 10 grep -qm1 '\[BUDDY\] started' <(tail -n 1000 -f /tmp/searchd.log); then echo 'Buddy started!'; else echo 'Timeout or failed!'; cat /tmp/searchd.log;fi
––– output –––
Manticore %{SEMVER} %{COMMITDATE}#!/(\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 '/tmp/116.conf' (%{NUMBER} chars)...
starting daemon version '%{SEMVER} %{COMMITDATE}#!/(\sdev)?\s/!#(columnar %{SEMVER} %{COMMITDATE}) (secondary %{SEMVER} %{COMMITDATE}) (knn %{SEMVER} %{COMMITDATE})' ...
listening on all interfaces for mysql, port=9315
listening on all interfaces for sphinx and http(s), port=9316
Buddy started!
––– input –––
mysql -P9315 -h0 -e "drop table if exists t; create table t(s string); insert into t values(1, 'a'); flush ramchunk t"; echo $?
––– output –––
0
––– input –––
mysql -P9315 -h0 -e "select * from t;"
––– output –––
+------+------+
| id | s |
+------+------+
| 1 | a |
+------+------+
––– input –––
rm -f /tmp/update.sql; for n in `seq 1 10000`; do echo "update t set s='b' where id=1;" >> /tmp/update.sql; done; while true; do mysql -P9315 -h0 < /tmp/update.sql | break; done &
––– output –––
[#!/[0-9]{1}/!#] %{NUMBER}
––– input –––
sleep 30; mysql -P9315 -h0 -e "select * from t;"
––– output –––
+------+------+
| id | s |
+------+------+
| 1 | b |
+------+------+
––– input –––
stdbuf -oL mysql -P9315 -h0 -e "freeze t"
––– output –––
+------------------------+------------------------+
| file | normalized |
+------------------------+------------------------+
| /tmp/data/t/t.0.spa | /tmp/data/t/t.0.spa |
| /tmp/data/t/t.0.spb | /tmp/data/t/t.0.spb |
| /tmp/data/t/t.0.spd | /tmp/data/t/t.0.spd |
| /tmp/data/t/t.0.spe | /tmp/data/t/t.0.spe |
| /tmp/data/t/t.0.sph | /tmp/data/t/t.0.sph |
| /tmp/data/t/t.0.sphi | /tmp/data/t/t.0.sphi |
| /tmp/data/t/t.0.spi | /tmp/data/t/t.0.spi |
| /tmp/data/t/t.0.spidx | /tmp/data/t/t.0.spidx |
| /tmp/data/t/t.0.spm | /tmp/data/t/t.0.spm |
| /tmp/data/t/t.0.spp | /tmp/data/t/t.0.spp |
| /tmp/data/t/t.0.spt | /tmp/data/t/t.0.spt |
| /tmp/data/t/t.meta | /tmp/data/t/t.meta |
| /tmp/data/t/t.ram | /tmp/data/t/t.ram |
| /tmp/data/t/t.settings | /tmp/data/t/t.settings |
+------------------------+------------------------+
––– input –––
mysql -P9315 -h0 -e "unfreeze t"; echo $?
––– output –––
0
––– input –––
mysql -P9315 -h0 -e "DESCRIBE t"
––– output –––
+-------+--------+------------+
| Field | Type | Properties |
+-------+--------+------------+
| id | bigint | |
| s | string | |
+-------+--------+------------+
––– input –––
mysql -P9315 -h0 -e "UPDATE t SET s='с' WHERE id=1; FLUSH RAMCHUNK t"; echo $?
––– output –––
0
––– input –––
mysql -P9315 -h0 -e "drop table if exists t; create table t(a string); insert into t values(1, 'a'); flush ramchunk t; freeze t; update t set a='b' where id = 1;" &
––– output –––
[%{NUMBER}] %{NUMBER}
––– input –––
mysql -P9315 -h0 -e "select * from t"
––– output –––
-
+ ERROR 1064 (42000) at line 1: error adding table 't': directory is not empty: /tmp/data/t
+ ERROR 1064 (42000) at line 1: unknown local table(s) 't' in search request
+ [2]+ Exit 1 mysql -P9315 -h0 -e "drop table if exists t; create table t(a string); insert into t values(1, 'a'); flush ramchunk t; freeze t; update t set a='b' where id = 1;"
+
|
Windows test results 3 files 3 suites 19m 27s ⏱️ Results for commit b891398. ♻️ This comment has been updated with latest results. |
Updated sleep
listening on all interfaces for sphinx and http(s), port=9316 | ||
Buddy started! | ||
––– input ––– | ||
mysql -P9315 -h0 -e "drop table if exists t; create table t(s string); insert into t values(1, 'a'); flush ramchunk t"; echo $? | ||
mysql -P9306 -h0 -e "DROP TABLE IF EXISTS t;"; rm -rf /tmp/data/t; mysql -P9306 -h0 -e "CREATE TABLE t(id INT, s STRING);" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rm -rf /tmp/data/t
doesn't make sense to me here. If a table requires rm
after drop
, it's a bug. If you can reproduce it - pls create an issue about it. If it's not the case - what's the rm
for?
––– input ––– | ||
sleep 30; mysql -P9315 -h0 -e "select * from t;" | ||
rm -f /tmp/update.sql; for n in `seq 1 100`; do echo "UPDATE t SET s='b' WHERE id=$n;" >> /tmp/update.sql; done; while true; do mysql -P9306 -h0 < /tmp/update.sql; done & UPDATE_PID=$! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rm -f /tmp/update.sql
seems redundant.
@@ -59,19 +53,35 @@ stdbuf -oL mysql -P9315 -h0 -e "freeze t" | |||
| /tmp/data/t/t.settings | /tmp/data/t/t.settings | | |||
+------------------------+------------------------+ | |||
––– input ––– | |||
mysql -P9315 -h0 -e "unfreeze t"; echo $? | |||
sleep 1; kill $UPDATE_PID; wait $UPDATE_PID 2>/dev/null; mysql -P9306 -h0 -e "unfreeze t"; echo $? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you stop the update load before unfreezing?
––– input ––– | ||
mysql -P9315 -h0 -e "UPDATE t SET s='с' WHERE id=1; FLUSH RAMCHUNK t"; echo $? | ||
if timeout 5 mysql -P9306 -h0 -e 'SELECT * FROM t'; then echo 'Query executed'; else echo 'Query not executed'; fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you make sure it failed on the version before the fix?
Type of Change (select one):
Description of the Change:
Related Issue (provide the link):