Commit 1d5220d1 authored by Daniel Black's avatar Daniel Black

binlog_group_commit_* status variables update

remove group_commit_reason_immediate
rename group_commit_reason_transaction to group_commit_trigger_lock_wait
rename group_commit_reason_usec to group_commit_trigger_timeout
rename group_commit_reason_count to group_commit_triggger_count
parent dd7026a7
...@@ -6,14 +6,12 @@ SET @old_usec= @@GLOBAL.binlog_commit_wait_usec; ...@@ -6,14 +6,12 @@ SET @old_usec= @@GLOBAL.binlog_commit_wait_usec;
SET GLOBAL binlog_commit_wait_usec= 20000000; SET GLOBAL binlog_commit_wait_usec= 20000000;
SELECT variable_value INTO @group_commits FROM information_schema.global_status SELECT variable_value INTO @group_commits FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commits'; WHERE variable_name = 'binlog_group_commits';
SELECT variable_value INTO @group_commit_reason_count FROM information_schema.global_status SELECT variable_value INTO @group_commit_trigger_count FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commit_reason_count'; WHERE variable_name = 'binlog_group_commit_trigger_count';
SELECT variable_value INTO @group_commit_reason_usec FROM information_schema.global_status SELECT variable_value INTO @group_commit_trigger_timeout FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commit_reason_usec'; WHERE variable_name = 'binlog_group_commit_trigger_timeout';
SELECT variable_value INTO @group_commit_reason_transaction FROM information_schema.global_status SELECT variable_value INTO @group_commit_trigger_lock_wait FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commit_reason_transaction'; WHERE variable_name = 'binlog_group_commit_trigger_lock_wait';
SELECT variable_value INTO @group_commit_reason_immediate FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commit_reason_immediate';
SET @a= current_timestamp(); SET @a= current_timestamp();
BEGIN; BEGIN;
INSERT INTO t1 VALUES (1,0); INSERT INTO t1 VALUES (1,0);
...@@ -27,22 +25,18 @@ SELECT variable_value - @group_commits FROM information_schema.global_status ...@@ -27,22 +25,18 @@ SELECT variable_value - @group_commits FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commits'; WHERE variable_name = 'binlog_group_commits';
variable_value - @group_commits variable_value - @group_commits
1 1
SELECT variable_value - @group_commit_reason_count FROM information_schema.global_status SELECT variable_value - @group_commit_trigger_count FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commit_reason_count'; WHERE variable_name = 'binlog_group_commit_trigger_count';
variable_value - @group_commit_reason_count variable_value - @group_commit_trigger_count
0 0
SELECT variable_value - @group_commit_reason_usec FROM information_schema.global_status SELECT variable_value - @group_commit_trigger_timeout FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commit_reason_usec'; WHERE variable_name = 'binlog_group_commit_trigger_timeout';
variable_value - @group_commit_reason_usec variable_value - @group_commit_trigger_timeout
0 0
SELECT variable_value - @group_commit_reason_transaction FROM information_schema.global_status SELECT variable_value - @group_commit_trigger_lock_wait FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commit_reason_transaction'; WHERE variable_name = 'binlog_group_commit_trigger_lock_wait';
variable_value - @group_commit_reason_transaction variable_value - @group_commit_trigger_lock_wait
1 1
SELECT variable_value - @group_commit_reason_immediate FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commit_reason_immediate';
variable_value - @group_commit_reason_immediate
0
ERROR 23000: Duplicate entry '1' for key 'PRIMARY' ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
SET @a= current_timestamp(); SET @a= current_timestamp();
INSERT INTO t1 VALUES (2,0); INSERT INTO t1 VALUES (2,0);
...@@ -56,22 +50,18 @@ SELECT variable_value - @group_commits FROM information_schema.global_status ...@@ -56,22 +50,18 @@ SELECT variable_value - @group_commits FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commits'; WHERE variable_name = 'binlog_group_commits';
variable_value - @group_commits variable_value - @group_commits
2 2
SELECT variable_value - @group_commit_reason_count FROM information_schema.global_status SELECT variable_value - @group_commit_trigger_count FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commit_reason_count'; WHERE variable_name = 'binlog_group_commit_trigger_count';
variable_value - @group_commit_reason_count variable_value - @group_commit_trigger_count
1 1
SELECT variable_value - @group_commit_reason_usec FROM information_schema.global_status SELECT variable_value - @group_commit_trigger_timeout FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commit_reason_usec'; WHERE variable_name = 'binlog_group_commit_trigger_timeout';
variable_value - @group_commit_reason_usec variable_value - @group_commit_trigger_timeout
0 0
SELECT variable_value - @group_commit_reason_transaction FROM information_schema.global_status SELECT variable_value - @group_commit_trigger_lock_wait FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commit_reason_transaction'; WHERE variable_name = 'binlog_group_commit_trigger_lock_wait';
variable_value - @group_commit_reason_transaction variable_value - @group_commit_trigger_lock_wait
1 1
SELECT variable_value - @group_commit_reason_immediate FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commit_reason_immediate';
variable_value - @group_commit_reason_immediate
0
SET @a= current_timestamp(); SET @a= current_timestamp();
INSERT INTO t1 VALUES (6,0); INSERT INTO t1 VALUES (6,0);
BEGIN; BEGIN;
...@@ -90,22 +80,18 @@ SELECT variable_value - @group_commits FROM information_schema.global_status ...@@ -90,22 +80,18 @@ SELECT variable_value - @group_commits FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commits'; WHERE variable_name = 'binlog_group_commits';
variable_value - @group_commits variable_value - @group_commits
3 3
SELECT variable_value - @group_commit_reason_count FROM information_schema.global_status SELECT variable_value - @group_commit_trigger_count FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commit_reason_count'; WHERE variable_name = 'binlog_group_commit_trigger_count';
variable_value - @group_commit_reason_count variable_value - @group_commit_trigger_count
1 1
SELECT variable_value - @group_commit_reason_usec FROM information_schema.global_status SELECT variable_value - @group_commit_trigger_timeout FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commit_reason_usec'; WHERE variable_name = 'binlog_group_commit_trigger_timeout';
variable_value - @group_commit_reason_usec variable_value - @group_commit_trigger_timeout
0 0
SELECT variable_value - @group_commit_reason_transaction FROM information_schema.global_status SELECT variable_value - @group_commit_trigger_lock_wait FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commit_reason_transaction'; WHERE variable_name = 'binlog_group_commit_trigger_lock_wait';
variable_value - @group_commit_reason_transaction variable_value - @group_commit_trigger_lock_wait
2 2
SELECT variable_value - @group_commit_reason_immediate FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commit_reason_immediate';
variable_value - @group_commit_reason_immediate
0
SET @a= current_timestamp(); SET @a= current_timestamp();
INSERT INTO t1 VALUES (7,0); INSERT INTO t1 VALUES (7,0);
INSERT INTO t1 VALUES (8,0); INSERT INTO t1 VALUES (8,0);
...@@ -117,22 +103,18 @@ SELECT variable_value - @group_commits FROM information_schema.global_status ...@@ -117,22 +103,18 @@ SELECT variable_value - @group_commits FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commits'; WHERE variable_name = 'binlog_group_commits';
variable_value - @group_commits variable_value - @group_commits
4 4
SELECT variable_value - @group_commit_reason_count FROM information_schema.global_status SELECT variable_value - @group_commit_trigger_count FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commit_reason_count'; WHERE variable_name = 'binlog_group_commit_trigger_count';
variable_value - @group_commit_reason_count variable_value - @group_commit_trigger_count
2 2
SELECT variable_value - @group_commit_reason_usec FROM information_schema.global_status SELECT variable_value - @group_commit_trigger_timeout FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commit_reason_usec'; WHERE variable_name = 'binlog_group_commit_trigger_timeout';
variable_value - @group_commit_reason_usec variable_value - @group_commit_trigger_timeout
0 0
SELECT variable_value - @group_commit_reason_transaction FROM information_schema.global_status SELECT variable_value - @group_commit_trigger_lock_wait FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commit_reason_transaction'; WHERE variable_name = 'binlog_group_commit_trigger_lock_wait';
variable_value - @group_commit_reason_transaction variable_value - @group_commit_trigger_lock_wait
2 2
SELECT variable_value - @group_commit_reason_immediate FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commit_reason_immediate';
variable_value - @group_commit_reason_immediate
0
SET @a= current_timestamp(); SET @a= current_timestamp();
SET GLOBAL binlog_commit_wait_usec= 5*1000*1000; SET GLOBAL binlog_commit_wait_usec= 5*1000*1000;
INSERT INTO t1 VALUES (9,0); INSERT INTO t1 VALUES (9,0);
...@@ -146,22 +128,18 @@ SELECT variable_value - @group_commits FROM information_schema.global_status ...@@ -146,22 +128,18 @@ SELECT variable_value - @group_commits FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commits'; WHERE variable_name = 'binlog_group_commits';
variable_value - @group_commits variable_value - @group_commits
5 5
SELECT variable_value - @group_commit_reason_count FROM information_schema.global_status SELECT variable_value - @group_commit_trigger_count FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commit_reason_count'; WHERE variable_name = 'binlog_group_commit_trigger_count';
variable_value - @group_commit_reason_count variable_value - @group_commit_trigger_count
2 2
SELECT variable_value - @group_commit_reason_usec FROM information_schema.global_status SELECT variable_value - @group_commit_trigger_timeout FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commit_reason_usec'; WHERE variable_name = 'binlog_group_commit_trigger_timeout';
variable_value - @group_commit_reason_usec variable_value - @group_commit_trigger_timeout
1 1
SELECT variable_value - @group_commit_reason_transaction FROM information_schema.global_status SELECT variable_value - @group_commit_trigger_lock_wait FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commit_reason_transaction'; WHERE variable_name = 'binlog_group_commit_trigger_lock_wait';
variable_value - @group_commit_reason_transaction variable_value - @group_commit_trigger_lock_wait
2 2
SELECT variable_value - @group_commit_reason_immediate FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commit_reason_immediate';
variable_value - @group_commit_reason_immediate
0
SELECT * FROM t1 ORDER BY a; SELECT * FROM t1 ORDER BY a;
a b a b
1 11 1 11
......
...@@ -18,14 +18,12 @@ SET SESSION binlog_direct_non_transactional_updates=OFF; ...@@ -18,14 +18,12 @@ SET SESSION binlog_direct_non_transactional_updates=OFF;
CHANGE MASTER TO master_use_gtid=current_pos; CHANGE MASTER TO master_use_gtid=current_pos;
SELECT variable_value INTO @group_commits FROM information_schema.global_status SELECT variable_value INTO @group_commits FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commits'; WHERE variable_name = 'binlog_group_commits';
SELECT variable_value INTO @group_commit_reason_count FROM information_schema.global_status SELECT variable_value INTO @group_commit_trigger_count FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commit_reason_count'; WHERE variable_name = 'binlog_group_commit_trigger_count';
SELECT variable_value INTO @group_commit_reason_usec FROM information_schema.global_status SELECT variable_value INTO @group_commit_trigger_timeout FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commit_reason_usec'; WHERE variable_name = 'binlog_group_commit_trigger_timeout';
SELECT variable_value INTO @group_commit_reason_transaction FROM information_schema.global_status SELECT variable_value INTO @group_commit_trigger_lock_wait FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commit_reason_transaction'; WHERE variable_name = 'binlog_group_commit_trigger_lock_wait';
SELECT variable_value INTO @group_commit_reason_immediate FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commit_reason_immediate';
SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads; SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
include/stop_slave.inc include/stop_slave.inc
SET GLOBAL slave_parallel_threads=10; SET GLOBAL slave_parallel_threads=10;
...@@ -48,24 +46,20 @@ SELECT * FROM t1 ORDER BY a; ...@@ -48,24 +46,20 @@ SELECT * FROM t1 ORDER BY a;
a b a b
1 10 1 10
SELECT IF((commits.variable_value - @group_commits) IN (1,3), "OK", "Not 1 or 3 groups"), SELECT IF((commits.variable_value - @group_commits) IN (1,3), "OK", "Not 1 or 3 groups"),
((commits.variable_value - @group_commits) - (reason_usec.variable_value - @group_commit_reason_usec)) as diff ((commits.variable_value - @group_commits) - (trigger_timeout.variable_value - @group_commit_trigger_timeout)) as diff
FROM information_schema.global_status commits FROM information_schema.global_status commits
JOIN information_schema.global_status reason_usec JOIN information_schema.global_status trigger_timeout
WHERE commits.variable_name = 'binlog_group_commits' WHERE commits.variable_name = 'binlog_group_commits'
AND reason_usec.variable_name = 'binlog_group_commit_reason_usec'; AND trigger_timeout.variable_name = 'binlog_group_commit_trigger_timeout';
IF((commits.variable_value - @group_commits) IN (1,3), "OK", "Not 1 or 3 groups") diff IF((commits.variable_value - @group_commits) IN (1,3), "OK", "Not 1 or 3 groups") diff
OK 0 OK 0
SELECT variable_value - @group_commit_reason_count FROM information_schema.global_status SELECT variable_value - @group_commit_trigger_count FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commit_reason_count'; WHERE variable_name = 'binlog_group_commit_trigger_count';
variable_value - @group_commit_reason_count variable_value - @group_commit_trigger_count
0 0
SELECT variable_value - @group_commit_reason_transaction FROM information_schema.global_status SELECT variable_value - @group_commit_trigger_lock_wait FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commit_reason_transaction'; WHERE variable_name = 'binlog_group_commit_trigger_lock_wait';
variable_value - @group_commit_reason_transaction variable_value - @group_commit_trigger_lock_wait
0
SELECT variable_value - @group_commit_reason_immediate FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commit_reason_immediate';
variable_value - @group_commit_reason_immediate
0 0
include/stop_slave.inc include/stop_slave.inc
SET GLOBAL slave_parallel_threads=@old_parallel_threads; SET GLOBAL slave_parallel_threads=@old_parallel_threads;
......
...@@ -32,16 +32,14 @@ CHANGE MASTER TO master_use_gtid=current_pos; ...@@ -32,16 +32,14 @@ CHANGE MASTER TO master_use_gtid=current_pos;
# the its critical that 3 separate binlog_group_commits occur # the its critical that 3 separate binlog_group_commits occur
SELECT variable_value INTO @group_commits FROM information_schema.global_status SELECT variable_value INTO @group_commits FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commits'; WHERE variable_name = 'binlog_group_commits';
SELECT variable_value INTO @group_commit_reason_count FROM information_schema.global_status SELECT variable_value INTO @group_commit_trigger_count FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commit_reason_count'; WHERE variable_name = 'binlog_group_commit_trigger_count';
SELECT variable_value INTO @group_commit_reason_usec FROM information_schema.global_status SELECT variable_value INTO @group_commit_trigger_timeout FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commit_reason_usec'; WHERE variable_name = 'binlog_group_commit_trigger_timeout';
SELECT variable_value INTO @group_commit_reason_transaction FROM information_schema.global_status SELECT variable_value INTO @group_commit_trigger_lock_wait FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commit_reason_transaction'; WHERE variable_name = 'binlog_group_commit_trigger_lock_wait';
SELECT variable_value INTO @group_commit_reason_immediate FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commit_reason_immediate'; # Note: binlog_group_commits is counted at the start of the group and group_commit_trigger_* is
# Note: binlog_group_commits is counted at the start of the group and group_commit_reason_* is
# counted near when the groups its finalised. # counted near when the groups its finalised.
...@@ -77,17 +75,15 @@ SELECT * FROM t1 ORDER BY a; ...@@ -77,17 +75,15 @@ SELECT * FROM t1 ORDER BY a;
# Measure status(es) # Measure status(es)
--connection server_2 --connection server_2
SELECT IF((commits.variable_value - @group_commits) IN (1,3), "OK", "Not 1 or 3 groups"), SELECT IF((commits.variable_value - @group_commits) IN (1,3), "OK", "Not 1 or 3 groups"),
((commits.variable_value - @group_commits) - (reason_usec.variable_value - @group_commit_reason_usec)) as diff ((commits.variable_value - @group_commits) - (trigger_timeout.variable_value - @group_commit_trigger_timeout)) as diff
FROM information_schema.global_status commits FROM information_schema.global_status commits
JOIN information_schema.global_status reason_usec JOIN information_schema.global_status trigger_timeout
WHERE commits.variable_name = 'binlog_group_commits' WHERE commits.variable_name = 'binlog_group_commits'
AND reason_usec.variable_name = 'binlog_group_commit_reason_usec'; AND trigger_timeout.variable_name = 'binlog_group_commit_trigger_timeout';
SELECT variable_value - @group_commit_reason_count FROM information_schema.global_status SELECT variable_value - @group_commit_trigger_count FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commit_reason_count'; WHERE variable_name = 'binlog_group_commit_trigger_count';
SELECT variable_value - @group_commit_reason_transaction FROM information_schema.global_status SELECT variable_value - @group_commit_trigger_lock_wait FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commit_reason_transaction'; WHERE variable_name = 'binlog_group_commit_trigger_lock_wait';
SELECT variable_value - @group_commit_reason_immediate FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commit_reason_immediate';
# Clean up # Clean up
......
...@@ -95,10 +95,9 @@ mysql_mutex_t LOCK_commit_ordered; ...@@ -95,10 +95,9 @@ mysql_mutex_t LOCK_commit_ordered;
static ulonglong binlog_status_var_num_commits; static ulonglong binlog_status_var_num_commits;
static ulonglong binlog_status_var_num_group_commits; static ulonglong binlog_status_var_num_group_commits;
static ulonglong binlog_status_group_commit_reason_count; static ulonglong binlog_status_group_commit_trigger_count;
static ulonglong binlog_status_group_commit_reason_immediate; static ulonglong binlog_status_group_commit_trigger_lock_wait;
static ulonglong binlog_status_group_commit_reason_transaction; static ulonglong binlog_status_group_commit_trigger_timeout;
static ulonglong binlog_status_group_commit_reason_usec;
static char binlog_snapshot_file[FN_REFLEN]; static char binlog_snapshot_file[FN_REFLEN];
static ulonglong binlog_snapshot_position; static ulonglong binlog_snapshot_position;
...@@ -108,14 +107,12 @@ static SHOW_VAR binlog_status_vars_detail[]= ...@@ -108,14 +107,12 @@ static SHOW_VAR binlog_status_vars_detail[]=
(char *)&binlog_status_var_num_commits, SHOW_LONGLONG}, (char *)&binlog_status_var_num_commits, SHOW_LONGLONG},
{"group_commits", {"group_commits",
(char *)&binlog_status_var_num_group_commits, SHOW_LONGLONG}, (char *)&binlog_status_var_num_group_commits, SHOW_LONGLONG},
{"group_commit_reason_count", {"group_commit_trigger_count",
(char *)&binlog_status_group_commit_reason_count, SHOW_LONGLONG}, (char *)&binlog_status_group_commit_trigger_count, SHOW_LONGLONG},
{"group_commit_reason_immediate", {"group_commit_trigger_lock_wait",
(char *)&binlog_status_group_commit_reason_immediate, SHOW_LONGLONG}, (char *)&binlog_status_group_commit_trigger_lock_wait, SHOW_LONGLONG},
{"group_commit_reason_transaction", {"group_commit_trigger_timeout",
(char *)&binlog_status_group_commit_reason_transaction, SHOW_LONGLONG}, (char *)&binlog_status_group_commit_trigger_timeout, SHOW_LONGLONG},
{"group_commit_reason_usec",
(char *)&binlog_status_group_commit_reason_usec, SHOW_LONGLONG},
{"snapshot_file", {"snapshot_file",
(char *)&binlog_snapshot_file, SHOW_CHAR}, (char *)&binlog_snapshot_file, SHOW_CHAR},
{"snapshot_position", {"snapshot_position",
...@@ -3047,8 +3044,8 @@ MYSQL_BIN_LOG::MYSQL_BIN_LOG(uint *sync_period) ...@@ -3047,8 +3044,8 @@ MYSQL_BIN_LOG::MYSQL_BIN_LOG(uint *sync_period)
bytes_written(0), file_id(1), open_count(1), bytes_written(0), file_id(1), open_count(1),
group_commit_queue(0), group_commit_queue_busy(FALSE), group_commit_queue(0), group_commit_queue_busy(FALSE),
num_commits(0), num_group_commits(0), num_commits(0), num_group_commits(0),
group_commit_reason_count(0), group_commit_reason_usec(0), group_commit_trigger_count(0), group_commit_trigger_timeout(0),
group_commit_reason_transaction(0), group_commit_reason_immediate(0), group_commit_trigger_lock_wait(0),
sync_period_ptr(sync_period), sync_counter(0), sync_period_ptr(sync_period), sync_counter(0),
state_file_deleted(false), binlog_state_recover_done(false), state_file_deleted(false), binlog_state_recover_done(false),
is_relay_log(0), signal_cnt(0), is_relay_log(0), signal_cnt(0),
...@@ -7560,12 +7557,12 @@ MYSQL_BIN_LOG::wait_for_sufficient_commits() ...@@ -7560,12 +7557,12 @@ MYSQL_BIN_LOG::wait_for_sufficient_commits()
{ {
if (++count >= opt_binlog_commit_wait_count) if (++count >= opt_binlog_commit_wait_count)
{ {
group_commit_reason_count++; group_commit_trigger_count++;
return; return;
} }
if (unlikely(e->thd->has_waiter)) if (unlikely(e->thd->has_waiter))
{ {
group_commit_reason_transaction++; group_commit_trigger_lock_wait++;
return; return;
} }
} }
...@@ -7582,12 +7579,12 @@ MYSQL_BIN_LOG::wait_for_sufficient_commits() ...@@ -7582,12 +7579,12 @@ MYSQL_BIN_LOG::wait_for_sufficient_commits()
&wait_until); &wait_until);
if (err == ETIMEDOUT) if (err == ETIMEDOUT)
{ {
group_commit_reason_usec++; group_commit_trigger_timeout++;
break; break;
} }
if (unlikely(last_head->thd->has_waiter)) if (unlikely(last_head->thd->has_waiter))
{ {
group_commit_reason_transaction++; group_commit_trigger_lock_wait++;
break; break;
} }
head= group_commit_queue; head= group_commit_queue;
...@@ -7596,13 +7593,13 @@ MYSQL_BIN_LOG::wait_for_sufficient_commits() ...@@ -7596,13 +7593,13 @@ MYSQL_BIN_LOG::wait_for_sufficient_commits()
++count; ++count;
if (unlikely(e->thd->has_waiter)) if (unlikely(e->thd->has_waiter))
{ {
group_commit_reason_transaction++; group_commit_trigger_lock_wait++;
goto after_loop; goto after_loop;
} }
} }
if (count >= opt_binlog_commit_wait_count) if (count >= opt_binlog_commit_wait_count)
{ {
group_commit_reason_count++; group_commit_trigger_count++;
break; break;
} }
last_head= head; last_head= head;
...@@ -7639,7 +7636,6 @@ MYSQL_BIN_LOG::binlog_trigger_immediate_group_commit() ...@@ -7639,7 +7636,6 @@ MYSQL_BIN_LOG::binlog_trigger_immediate_group_commit()
head= group_commit_queue; head= group_commit_queue;
if (head) if (head)
{ {
group_commit_reason_immediate++;
head->thd->has_waiter= true; head->thd->has_waiter= true;
mysql_cond_signal(&COND_prepare_ordered); mysql_cond_signal(&COND_prepare_ordered);
} }
...@@ -9790,10 +9786,9 @@ TC_LOG_BINLOG::set_status_variables(THD *thd) ...@@ -9790,10 +9786,9 @@ TC_LOG_BINLOG::set_status_variables(THD *thd)
} }
mysql_mutex_unlock(&LOCK_commit_ordered); mysql_mutex_unlock(&LOCK_commit_ordered);
mysql_mutex_lock(&LOCK_prepare_ordered); mysql_mutex_lock(&LOCK_prepare_ordered);
binlog_status_group_commit_reason_count= this->group_commit_reason_count; binlog_status_group_commit_trigger_count= this->group_commit_trigger_count;
binlog_status_group_commit_reason_usec= this->group_commit_reason_usec; binlog_status_group_commit_trigger_timeout= this->group_commit_trigger_timeout;
binlog_status_group_commit_reason_transaction= this->group_commit_reason_transaction; binlog_status_group_commit_trigger_lock_wait= this->group_commit_trigger_lock_wait;
binlog_status_group_commit_reason_immediate= this->group_commit_reason_immediate;
mysql_mutex_unlock(&LOCK_prepare_ordered); mysql_mutex_unlock(&LOCK_prepare_ordered);
if (have_snapshot) if (have_snapshot)
......
...@@ -516,8 +516,8 @@ class MYSQL_BIN_LOG: public TC_LOG, private MYSQL_LOG ...@@ -516,8 +516,8 @@ class MYSQL_BIN_LOG: public TC_LOG, private MYSQL_LOG
/* Number of group commits done. */ /* Number of group commits done. */
ulonglong num_group_commits; ulonglong num_group_commits;
/* The reason why the group commit was grouped */ /* The reason why the group commit was grouped */
ulonglong group_commit_reason_count, group_commit_reason_usec; ulonglong group_commit_trigger_count, group_commit_trigger_timeout;
ulonglong group_commit_reason_transaction, group_commit_reason_immediate; ulonglong group_commit_trigger_lock_wait;
/* pointer to the sync period variable, for binlog this will be /* pointer to the sync period variable, for binlog this will be
sync_binlog_period, for relay log this will be sync_binlog_period, for relay log this will be
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment