make log_slave_slow_statements run time global variable

Bug #589512 reported by Peter Zaitsev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Invalid
High
Oleg Tsarev

Bug Description

currently log-slow-slave-statements is only startup variable. It has to be changed to be global run time settable variable and added to SHOW VARIABLES list.

Changed in percona-server:
status: New → Triaged
importance: Undecided → High
assignee: nobody → Oleg Tsarev (tsarev)
milestone: none → 5.1-11.0
Revision history for this message
Yasufumi Kinoshita (yasufumi-kinoshita) wrote :

Please confirm in real!
log_slow_slave_statements is global dynamic variable already!

mysql> show variables like 'log_slow_slave_statements';
+---------------------------+-------+
| Variable_name | Value |
+---------------------------+-------+
| log_slow_slave_statements | OFF |
+---------------------------+-------+
1 row in set (0.00 sec)

mysql> set global log_slow_slave_statements=ON;
Query OK, 0 rows affected (0.00 sec)

mysql> show variables like 'log_slow_slave_statements';
+---------------------------+-------+
| Variable_name | Value |
+---------------------------+-------+
| log_slow_slave_statements | ON |
+---------------------------+-------+
1 row in set (0.00 sec)

Revision history for this message
Vadim Tkachenko (vadim-tk) wrote :

Then please add test for it.

Oleg Tsarev (tsarev)
Changed in percona-server:
status: Triaged → In Progress
Revision history for this message
Oleg Tsarev (tsarev) wrote :

All work as described in documentation:
http://www.percona.com/docs/wiki/patches:slow_extended#log_slow_slave_statements

Peter, i thicnk you forget make STOP SLAVE; START SLAVE, because variable are affected only after slave thread restart.

Tests propose for merge to trunk.

Changed in percona-server:
status: In Progress → Invalid
Revision history for this message
Oleg Tsarev (tsarev) wrote :

I retry investigate problem, ant now i confirm this bug.
If mysql has startup parameter "--log-slow-slave-statements", then runtime variable log_slow_slave_statements changes has effect (enable and disable slow log)
If mysql hasn't startup parameter "--log-slow-slave-statements", then runtime variable log_slow_slave_statements changes hasn't effect (slow log desn't contain and queries).

My test scripts and server options to be following,

Changed in percona-server:
status: Invalid → Confirmed
Revision history for this message
Oleg Tsarev (tsarev) wrote :
Revision history for this message
Oleg Tsarev (tsarev) wrote :
Revision history for this message
Oleg Tsarev (tsarev) wrote :

All work fine, test would be commited.

Changed in percona-server:
status: Confirmed → Invalid
Revision history for this message
Peter Zaitsev (pz-percona) wrote : Re: [Bug 589512] Re: make log_slave_slow_statements run time global variable

Thanks Oleg,

This is I guess how it went I remember starting/stopping slave was not
enough I had to have it specified in startup to make it work.

On Mon, Jun 7, 2010 at 5:59 AM, Oleg Tsarev <email address hidden> wrote:

> I retry investigate problem, ant now i confirm this bug.
> If mysql has startup parameter "--log-slow-slave-statements", then runtime
> variable log_slow_slave_statements changes has effect (enable and disable
> slow log)
> If mysql hasn't startup parameter "--log-slow-slave-statements", then
> runtime variable log_slow_slave_statements changes hasn't effect (slow log
> desn't contain and queries).
>
> My test scripts and server options to be following,
>
> ** Changed in: percona-server
> Status: Invalid => Confirmed
>
> --
> make log_slave_slow_statements run time global variable
> https://bugs.launchpad.net/bugs/589512
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in Percona Server with XtraDB: Confirmed
>
> Bug description:
> currently log-slow-slave-statements is only startup variable. It has to be
> changed to be global run time settable variable and added to SHOW VARIABLES
> list.
>
> To unsubscribe from this bug, go to:
> https://bugs.launchpad.net/percona-server/+bug/589512/+subscribe
>

--
Peter Zaitsev, CEO, Percona Inc.
Tel: +1 888 401 3401 ext 501 Skype: peter_zaitsev
24/7 Emergency Line +1 888 401 3401 ext 911

Percona Training Workshops
http://www.percona.com/training/

Revision history for this message
Oleg Tsarev (tsarev) wrote :

Peter,

Please also read updated documentation
http://www.percona.com/docs/wiki/patches:slow_extended#log_slow_slave_statements

To start the logging from the slave thread, you should change the global value: set global log_slow_slave_statements=ON; and then execute: STOP SLAVE; START SLAVE;. This will destroy and recreate the slave SQL thread, so it will see the newly set global value.

To stop the logging from the slave thread, you should just change the global value: set global log_slow_slave_statements=OFF; and the logging stop immediately.

Revision history for this message
Peter Zaitsev (pz-percona) wrote :

Yes....

Well I remember it does not work... though it may be fixed now.
One thing I remember I was using set global use_global_long_query_time.

On Mon, Jun 7, 2010 at 11:14 AM, Oleg Tsarev <email address hidden> wrote:

> Peter,
>
> Please also read updated documentation
>
> http://www.percona.com/docs/wiki/patches:slow_extended#log_slow_slave_statements
>
> To start the logging from the slave thread, you should change the global
> value: set global log_slow_slave_statements=ON; and then execute: STOP
> SLAVE; START SLAVE;. This will destroy and recreate the slave SQL
> thread, so it will see the newly set global value.
>
> To stop the logging from the slave thread, you should just change the
> global value: set global log_slow_slave_statements=OFF; and the logging
> stop immediately.
>
> --
> make log_slave_slow_statements run time global variable
> https://bugs.launchpad.net/bugs/589512
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in Percona Server with XtraDB: Invalid
>
> Bug description:
> currently log-slow-slave-statements is only startup variable. It has to be
> changed to be global run time settable variable and added to SHOW VARIABLES
> list.
>
> To unsubscribe from this bug, go to:
> https://bugs.launchpad.net/percona-server/+bug/589512/+subscribe
>

--
Peter Zaitsev, CEO, Percona Inc.
Tel: +1 888 401 3401 ext 501 Skype: peter_zaitsev
24/7 Emergency Line +1 888 401 3401 ext 911

Percona Training Workshops
http://www.percona.com/training/

Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-412

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.