Bug #68373 No unit information about "innodb_spin_wait_delay"
Submitted: 14 Feb 2013 7:06 Modified: 11 Mar 2013 19:45
Reporter: Tianyin Xu Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.5.29 OS:Any
Assigned to: Paul DuBois CPU Architecture:Any

[14 Feb 2013 7:06] Tianyin Xu
Description:
There's no unit information about the parameter "innodb_spin_wait_delay".

The reference manual entry only tells:
The maximum delay between polls for a spin lock. The default value is 6.
(http://dev.mysql.com/doc/refman/5.5/en/innodb-parameters.html#sysvar_innodb_spin_wait_dela...)

In addition, the description in the source code also does not mention it,

/* storage/innobase/handler/ha_innodb.cc */
11600 static MYSQL_SYSVAR_ULONG(spin_wait_delay, srv_spin_wait_delay,
11601   PLUGIN_VAR_OPCMDARG,
11602   "Maximum delay between polling for a spin lock (6 by default)",
11603   NULL, NULL, 6L, 0L, ~0UL, 0);

As the user, I don't know whether the delay is with unit "seconds", "milliseconds", or "microseconds".

In fact, in MySQL, some time parameter like "connect_timeout" is seconds and others like "slow-start-timeout" are milliseconds.

Thanks!
Tianyin 

How to repeat:
See the descriptions section. 

Suggested fix:
It seems to me that the corresponding variable "srv_spin_wait_delay" which stores the parameter is used in function "ut_delay". The comments of "ut_delay()" tell that the unit is "microseconds" (neither "seconds" nor "milliseconds"!).

/* storage/innobase/ut/ut0ut.c */
410 ulint
411 ut_delay(
412 /*=====*/
413         ulint   delay)  /*!< in: delay in microseconds on 100 MHz Pentium */

We should definite add the unit information in both the user manual and the description.
[11 Mar 2013 19:45] Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products.

There is no unit information because the value is unitless. Updated text:

The maximum delay between polls for a spin lock. The low-level 
implementation of this mechanism varies depending on the combination
of hardware and operating system, so the delay does not correspond to
a fixed time interval.