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

SELECT does not wait for FREEZE + UPDATE #2805

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
35 changes: 31 additions & 4 deletions test/clt-tests/core/test-freeze-unfreeze-update.rec
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,18 @@ mysql -P9315 -h0 -e "select * from t;"
| 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 &
(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; for i in `seq 1 10`; do mysql -P9315 -h0 < /tmp/update.sql; done; 2>&1 &)
PavelShilin89 marked this conversation as resolved.
Show resolved Hide resolved
––– output –––
[#!/[0-9]{1}/!#] %{NUMBER}
––– input –––
sleep 30; mysql -P9315 -h0 -e "select * from t;"
sleep 1; mysql -P9315 -h0 -e "select * from t;"
––– output –––
+------+------+
| id | s |
+------+------+
| 1 | b |
+------+------+
––– input –––
stdbuf -oL mysql -P9315 -h0 -e "freeze t"
mysql -P9315 -h0 -e "freeze t"
––– output –––
+------------------------+------------------------+
| file | normalized |
Expand Down Expand Up @@ -75,3 +74,31 @@ mysql -P9315 -h0 -e "DESCRIBE t"
mysql -P9315 -h0 -e "UPDATE t SET s='с' WHERE id=1; FLUSH RAMCHUNK t"; echo $?
PavelShilin89 marked this conversation as resolved.
Show resolved Hide resolved
––– output –––
0
––– input –––
(sleep 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"; mysql -P9315 -h0 -e "update t set a='b' where id = 1" 2>&1 &)
PavelShilin89 marked this conversation as resolved.
Show resolved Hide resolved
––– 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.settings | /tmp/data/t/t.settings |
+------------------------+------------------------+
––– input –––
sleep 1; mysql -P9315 -h0 -e "select * from t;"
––– output –––
+------+------+
| id | a |
+------+------+
| 1 | a |
+------+------+