microslow patch long_query_time backwards compatibility?

Bug #288062 reported by Arjen Lentz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OurDelta
Fix Released
High
Arjen Lentz

Bug Description

Check percona/microslow patch to be backwards compatible, so an existing user upgrading to OurDelta won't see changed behaviour by default.

The my.cnf options are processed and assigned automatically so we probably can't get in there.
But before it's used, we can see if it's say < 600 (10 minutes in old form!) and do *1000000 to convert it to microseconds.
Should be perfectly safe.

Changed in ourdelta:
assignee: nobody → arjen-lentz
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Arjen Lentz (arjen-lentz) wrote :

In mysqld.cc, get_one_option() function, adding in:

+ case OPT_LONG_QUERY_TIME:
+ /*
+ Fix up low values to ensure backward compatibility in microslow patch:
+ if long_query_time < 600 (10 minutes in old granularity)
+ then we simply adjust it for microseconds.
+ */
+ if (global_system_variables.long_query_time < 600)
+ global_system_variables.long_query_time *= 1000000;
+ break;

that should do the trick cleanly.
Modified in ourdelta-percona-d6-mysql50 branch for testing.

Changed in ourdelta:
importance: Medium → High
status: Confirmed → In Progress
Changed in ourdelta:
status: In Progress → Fix Committed
Revision history for this message
Erik Ljungstrom (erik-ibiblio) wrote :

Maybe it should be relayed to the user that this has been done? I think it would be apt to tell the user so that he/she can re-set the variables accordingly rather than unknowingly rely on this?

Thanks,
Erik Ljungstrom

Revision history for this message
Arjen Lentz (arjen-lentz) wrote :

Erik noted correctly that the granularity fixup also needs to be applied on SET [SESSION|GLOBAL] long_query_time = ...
Needs to done in sql/set_var.cc

Changed in ourdelta:
assignee: arjen-lentz → erik-ibiblio
status: Fix Committed → In Progress
Revision history for this message
Arjen Lentz (arjen-lentz) wrote :

Dont think we need to issue warnings to user; if the backward compatility is implemented correctly, things will work regardless of what the user or app assumes.

Revision history for this message
Eric Bergen (ebergen) wrote :

When microsecond timing becomes the standard it will be very confusing for people to know about the 10 minute boundary. I think it should either be a float or use the current implementation of microseconds. For backwards compatibility with stock mysql float is probably the best choice.

Revision history for this message
Erik Ljungstrom (erik-ibiblio) wrote :

Yeah. As far as I'm concerned, backwards compatibility is key for OurDelta. People should be able to expect things to keep going as usual after switching. Going with using a float appears to be the most reasonable and neatest solution to this.

Changed in ourdelta:
assignee: erik-ibiblio → arjen-lentz
status: In Progress → Fix Committed
Revision history for this message
Arjen Lentz (arjen-lentz) wrote :

In OurDelta builds from patchset d7.
Percona will also pick up the new patch for their builds.

Changed in ourdelta:
status: Fix Committed → Fix Released
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.