Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
03f3bdce
Commit
03f3bdce
authored
Aug 07, 2017
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deterministically wait for purge using wait_all_purged.inc
parent
6f623907
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
22 deletions
+31
-22
mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result
mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result
+15
-12
mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test
mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test
+16
-10
No files found.
mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result
View file @
03f3bdce
set default_storage_engine=innodb;
set @old_dbug=@@global.debug_dbug;
SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
CREATE TABLE `t` (
`a` BLOB,
`b` BLOB,
...
...
@@ -12,9 +14,7 @@ INSERT INTO t VALUES (REPEAT('a', 16000), REPEAT('b', 16000), DEFAULT, "mm", 2);
CREATE INDEX idx ON t(c(100));
SET global debug_dbug="+d,ib_purge_virtual_index_callback";
UPDATE t SET a = REPEAT('m', 16000) WHERE a like "aaa%";
select sleep(3);
sleep(3)
0
InnoDB 0 transactions not purged
SET global debug_dbug=@old_dbug;
DROP TABLE t;
CREATE TABLE t (
...
...
@@ -29,9 +29,7 @@ INSERT INTO t VALUES (REPEAT('a', 100), REPEAT('b', 100), DEFAULT, "mm", 2);
CREATE INDEX idx ON t(c(100));
SET global debug_dbug="+d,ib_purge_virtual_index_callback";
UPDATE t SET a = REPEAT('m', 100) WHERE a like "aaa%";
select sleep(3);
sleep(3)
0
InnoDB 0 transactions not purged
SET global debug_dbug=@old_dbug;
DROP TABLE t;
CREATE TABLE t1 (
...
...
@@ -52,9 +50,7 @@ insert into t1 values(4, 18, default);
CREATE INDEX idx ON t1(x);
SET global debug_dbug="+d,ib_purge_virtual_index_callback";
UPDATE t1 SET id = 10 WHERE id = 1;
select sleep(3);
sleep(3)
0
InnoDB 0 transactions not purged
SET global debug_dbug=@old_dbug;
DROP TABLE t1;
connect con1,localhost,root,,;
...
...
@@ -80,7 +76,7 @@ SET DEBUG_SYNC= 'now WAIT_FOR uncommitted';
# enable purge
COMMIT;
# wait for purge to process the deleted records.
Timeout in wait_innodb_all_purged.inc for INNODB_PURGE_TRX_ID_AGE = 4
InnoDB 0 transactions not purged
SET DEBUG_SYNC= 'now SIGNAL purged';
connection default;
/* connection default */ ALTER TABLE t1 ADD COLUMN c INT GENERATED ALWAYS AS(a+b), ADD INDEX idx (c), ALGORITHM=INPLACE, LOCK=SHARED;
...
...
@@ -119,6 +115,7 @@ INSERT INTO t1(a, b) VALUES (8, 8);
# enable purge
COMMIT;
# wait for purge to process the deleted/updated records.
InnoDB 1 transactions not purged
SET DEBUG_SYNC= 'now SIGNAL purged';
disconnect con1;
connection default;
...
...
@@ -141,20 +138,26 @@ DROP TABLE t0, t1;
create table t (a blob, b blob, c blob as (concat(a,b)), h varchar(10), index (c(100)));
insert t(a,b,h) values (repeat('g', 16000), repeat('x', 16000), "kk");
insert t(a,b,h) values (repeat('a', 16000), repeat('b', 16000), "mm");
set global innodb_purge_stop_now = 1;
set global debug_dbug="+d,ib_purge_virtual_index_callback";
connect prevent_purge, localhost, root;
start transaction with consistent snapshot;
connection default;
update t set a = repeat('m', 16000) where a like "aaa%";
connect con1, localhost, root;
lock table t write;
disconnect prevent_purge;
connection default;
set global innodb_purge_run_now=1;
select variable_value>1 from information_schema.global_status where variable_name='innodb_purge_trx_id_age';
variable_value>1
1
disconnect con1;
start transaction with consistent snapshot;
commit;
InnoDB 0 transactions not purged
select variable_value>1 from information_schema.global_status where variable_name='innodb_purge_trx_id_age';
variable_value>1
0
set global debug_dbug=@old_dbug;
drop table t;
set debug_sync=reset;
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;
mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test
View file @
03f3bdce
...
...
@@ -5,6 +5,9 @@
set
default_storage_engine
=
innodb
;
set
@
old_dbug
=@@
global
.
debug_dbug
;
# Ensure that the history list length will actually be decremented by purge.
SET
@
saved_frequency
=
@@
GLOBAL
.
innodb_purge_rseg_truncate_frequency
;
SET
GLOBAL
innodb_purge_rseg_truncate_frequency
=
1
;
CREATE
TABLE
`t`
(
`a`
BLOB
,
...
...
@@ -21,11 +24,10 @@ CREATE INDEX idx ON t(c(100));
SET
global
debug_dbug
=
"+d,ib_purge_virtual_index_callback"
;
UPDATE
t
SET
a
=
REPEAT
(
'm'
,
16000
)
WHERE
a
like
"aaa%"
;
select
sleep
(
3
);
--
source
../../
innodb
/
include
/
wait_all_purged
.
inc
SET
global
debug_dbug
=@
old_dbug
;
DROP
TABLE
t
;
CREATE
TABLE
t
(
a
TINYBLOB
,
b
TINYBLOB
,
...
...
@@ -41,7 +43,7 @@ CREATE INDEX idx ON t(c(100));
SET
global
debug_dbug
=
"+d,ib_purge_virtual_index_callback"
;
UPDATE
t
SET
a
=
REPEAT
(
'm'
,
100
)
WHERE
a
like
"aaa%"
;
select
sleep
(
3
);
--
source
../../
innodb
/
include
/
wait_all_purged
.
inc
SET
global
debug_dbug
=@
old_dbug
;
DROP
TABLE
t
;
...
...
@@ -68,7 +70,7 @@ CREATE INDEX idx ON t1(x);
SET
global
debug_dbug
=
"+d,ib_purge_virtual_index_callback"
;
UPDATE
t1
SET
id
=
10
WHERE
id
=
1
;
select
sleep
(
3
);
--
source
../../
innodb
/
include
/
wait_all_purged
.
inc
SET
global
debug_dbug
=@
old_dbug
;
DROP
TABLE
t1
;
...
...
@@ -109,7 +111,7 @@ SET DEBUG_SYNC= 'now WAIT_FOR uncommitted';
COMMIT
;
--
echo
# wait for purge to process the deleted records.
--
source
include
/
wait_innodb
_all_purged
.
inc
--
source
../../
innodb
/
include
/
wait
_all_purged
.
inc
SET
DEBUG_SYNC
=
'now SIGNAL purged'
;
...
...
@@ -154,7 +156,7 @@ INSERT INTO t1(a, b) VALUES (8, 8);
COMMIT
;
--
echo
# wait for purge to process the deleted/updated records.
--
source
include
/
wait_innodb
_all_purged
.
inc
--
source
../../
innodb
/
include
/
wait
_all_purged
.
inc
SET
DEBUG_SYNC
=
'now SIGNAL purged'
;
...
...
@@ -175,20 +177,24 @@ DROP TABLE t0, t1;
create
table
t
(
a
blob
,
b
blob
,
c
blob
as
(
concat
(
a
,
b
)),
h
varchar
(
10
),
index
(
c
(
100
)));
insert
t
(
a
,
b
,
h
)
values
(
repeat
(
'g'
,
16000
),
repeat
(
'x'
,
16000
),
"kk"
);
insert
t
(
a
,
b
,
h
)
values
(
repeat
(
'a'
,
16000
),
repeat
(
'b'
,
16000
),
"mm"
);
set
global
innodb_purge_stop_now
=
1
;
set
global
debug_dbug
=
"+d,ib_purge_virtual_index_callback"
;
connect
(
prevent_purge
,
localhost
,
root
);
start
transaction
with
consistent
snapshot
;
connection
default
;
update
t
set
a
=
repeat
(
'm'
,
16000
)
where
a
like
"aaa%"
;
connect
(
con1
,
localhost
,
root
);
lock
table
t
write
;
disconnect
prevent_purge
;
connection
default
;
set
global
innodb_purge_run_now
=
1
;
sleep
3
;
select
variable_value
>
1
from
information_schema
.
global_status
where
variable_name
=
'innodb_purge_trx_id_age'
;
disconnect
con1
;
sleep
3
;
start
transaction
with
consistent
snapshot
;
commit
;
--
source
../../
innodb
/
include
/
wait_all_purged
.
inc
select
variable_value
>
1
from
information_schema
.
global_status
where
variable_name
=
'innodb_purge_trx_id_age'
;
set
global
debug_dbug
=@
old_dbug
;
drop
table
t
;
--
source
include
/
wait_until_count_sessions
.
inc
set
debug_sync
=
reset
;
SET
GLOBAL
innodb_purge_rseg_truncate_frequency
=
@
saved_frequency
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment