[MDEV-6981] [PATCH] feature request MASTER_GTID_WAIT status variables Created: 2014-10-30  Updated: 2015-03-17  Resolved: 2015-03-17

Status: Closed
Project: MariaDB Server
Component/s: Replication
Fix Version/s: 10.1.4

Type: Task Priority: Major
Reporter: Daniel Black Assignee: Kristian Nielsen
Resolution: Fixed Votes: 0
Labels: None

Attachments: File master_gtid_wait_status_vars.patch.1    

 Description   

With MASTER_GTID_WAIT I wouldn't mind a global (and optionally session) indication of:

  • total time spent in this wait state in including timeouts
  • total time spent in the function excluding timeouts
  • total number of timeouts occurred in this function

I'd find this quite useful for general health monitoring of this function, particularly when graphed over time.

Thanks for your consideration



 Comments   
Comment by Daniel Black [ 2014-11-21 ]

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)

Comment by Daniel Black [ 2014-11-22 ]

made output more readable by only replacing $wait_time with MASTER_GTID_WAIT_TIME, leaving expression, and using more accurate labels on output.

Comment by Kristian Nielsen [ 2014-11-24 ]

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)

Comment by Daniel Black [ 2014-11-24 ]

fixed

Comment by Kristian Nielsen [ 2015-02-04 ]

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.

Comment by Kristian Nielsen [ 2015-02-04 ]

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).

Comment by Daniel Black [ 2015-03-11 ]

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.

Comment by Kristian Nielsen [ 2015-03-16 ]

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.

Comment by Kristian Nielsen [ 2015-03-17 ]

Pushed to 10.1.4, thanks Daniel!

Generated at Thu Feb 08 07:16:03 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.