Bug #106630 Contribution by Tencent: Missing declaration of srv_log_writer_timeout
Submitted: 3 Mar 2022 12:48 Modified: 3 Mar 2022 13:18
Reporter: hao wu (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:8.0.28 OS:CentOS
Assigned to: CPU Architecture:Any
Tags: Contribution

[3 Mar 2022 12:48] hao wu
Description:
MySQL 8.0.28 seems missing declaration of srv_log_writer_timeout (extern ulong srv_log_writer_timeout)

And I got a compile error (gcc 7.3.1):

mysql-8.0.28/storage/innobase/handler/ha_innodb.cc:22410:25: error: ‘srv_log_writer_timeout’ was not declared in this scope; did you mean ‘get_srv_log_writer_timeout’?
22410 | log_writer_timeout, srv_log_writer_timeout, PLUGIN_VAR_RQCMDARG

It's confused because I found declaration of srv_log_writer_timeout in srv0srv.h of 8.0.27, but its gone in 8.0.28. Or is there just some problems of my machine development environment?

How to repeat:
See description

Suggested fix:
diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
index d50e582..d1874b1 100644
--- a/storage/innobase/include/srv0srv.h
+++ b/storage/innobase/include/srv0srv.h
@@ -511,6 +511,9 @@ std::chrono::microseconds get_srv_log_wait_for_flush_timeout();
for new data to write or flush without sleeping. */
extern ulong srv_log_writer_spin_delay;

+/** Initial timeout used to wait on writer_event. */
+extern ulong srv_log_writer_timeout;
+
/** Initial timeout used to wait on writer_event. */
std::chrono::microseconds get_srv_log_writer_timeout();
[3 Mar 2022 12:50] hao wu
fix.patch

(*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: fix.patch (application/octet-stream, text), 584 bytes.

[3 Mar 2022 13:18] MySQL Verification Team
Hello hao wu,

Thank you for the report and contribution.

regards,
Umesh