master_gtid_wait_count (# of times called)
master_gtid_wait_timeouts (# of time it was called and timed out)
master_gtid_wait_time (time in microseconds waiting for results)
Daniel Black
added a comment - attached patch implements three status variables
master_gtid_wait_count (# of times called)
master_gtid_wait_timeouts (# of time it was called and timed out)
master_gtid_wait_time (time in microseconds waiting for results)
made output more readable by only replacing $wait_time with MASTER_GTID_WAIT_TIME, leaving expression, and using more accurate labels on output.
Daniel Black
added a comment - made output more readable by only replacing $wait_time with MASTER_GTID_WAIT_TIME, leaving expression, and using more accurate labels on output.
Looks good.
Only, I think the variables need to be declared ulonglong? Because they are used with SHOW_LONGLONG_STATUS ? (and otherwise timeout counter would wrap after 4000 seconds)
Kristian Nielsen
added a comment - Looks good.
Only, I think the variables need to be declared ulonglong? Because they are used with SHOW_LONGLONG_STATUS ? (and otherwise timeout counter would wrap after 4000 seconds)
Bummer, I don't know how this has stalled for so long
I've pushed it to a feature tree for buildbot testing, once that has run I will push it to 10.1.
Kristian Nielsen
added a comment - Bummer, I don't know how this has stalled for so long
I've pushed it to a feature tree for buildbot testing, once that has run I will push it to 10.1.
let $wait_time = query_get_value(SHOW STATUS LIKE 'Master_gtid_wait_time', Value, 1);
eval SELECT floor($wait_time / 1000) AS Master_gtid_wait_time_milliseconds;
SELECT master_gtid_wait('2-1-2', 0.5);
# (0.5-0.6 seconds)
eval SELECT floor($wait_time / 100000) AS Master_gtid_wait_time_tenths_of_a_second;
Those times will fluctuate a lot depending on load on the test machine (as
seen in buildbot).
And did you test that the counters are reset to 0 when the test starts, so
that they values do not depend on what happened in earlier tests that ran
before this test?
Also, main.max_statement_time fails (but that's easy to fix).
Kristian Nielsen
added a comment - - edited Ehm, this really does not work:
# This one completes immediately ( < 1 ms).
SELECT master_gtid_wait('1-1-1');
let $wait_time = query_get_value(SHOW STATUS LIKE 'Master_gtid_wait_time', Value, 1);
eval SELECT floor($wait_time / 1000) AS Master_gtid_wait_time_milliseconds;
SELECT master_gtid_wait('2-1-2', 0.5);
# (0.5-0.6 seconds)
eval SELECT floor($wait_time / 100000) AS Master_gtid_wait_time_tenths_of_a_second;
Those times will fluctuate a lot depending on load on the test machine (as
seen in buildbot).
And did you test that the counters are reset to 0 when the test starts, so
that they values do not depend on what happened in earlier tests that ran
before this test?
Also, main.max_statement_time fails (but that's easy to fix).
> Those times will fluctuate a lot depending on load on the test machine (as seen in buildbot).
Increased time windows a lot. The immediate case is a event is pushed to the master before master_gtid_wait is called on the slave. The 0.5 case is the timeout occurs on the slave master_gtid_wait. Is there a way to write these sort of test cases?
> And did you test that the counters are reset to 0
I'm only looking at the session status variables on a new connection.
> Also, main.max_statement_time fails (but that's easy to fix).
I don't see that in my patch.
Daniel Black
added a comment - https://github.com/MariaDB/server/pull/21
> Those times will fluctuate a lot depending on load on the test machine (as seen in buildbot).
Increased time windows a lot. The immediate case is a event is pushed to the master before master_gtid_wait is called on the slave. The 0.5 case is the timeout occurs on the slave master_gtid_wait. Is there a way to write these sort of test cases?
> And did you test that the counters are reset to 0
I'm only looking at the session status variables on a new connection.
> Also, main.max_statement_time fails (but that's easy to fix).
I don't see that in my patch.
I've merged it into 10.1 and pushed to bb-10.1-knielsen for a buidbot run.
If everything looks ok, I'll push to main 10.1 tomorrow.
Kristian Nielsen
added a comment - I've merged it into 10.1 and pushed to bb-10.1-knielsen for a buidbot run.
If everything looks ok, I'll push to main 10.1 tomorrow.
attached patch implements three status variables
master_gtid_wait_count (# of times called)
master_gtid_wait_timeouts (# of time it was called and timed out)
master_gtid_wait_time (time in microseconds waiting for results)