[MDEV-31124] Innodb_data_written miscounts doublewrites Created: 2023-04-25  Updated: 2023-05-02  Resolved: 2023-04-25

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11, 11.0, 11.1
Fix Version/s: 11.1.1, 10.11.3, 11.0.2, 10.5.20, 10.6.13, 10.8.8, 10.9.6, 10.10.4

Type: Bug Priority: Critical
Reporter: Marko Mäkelä Assignee: Marko Mäkelä
Resolution: Fixed Votes: 0
Labels: monitoring, regression-10.5

Issue Links:
Problem/Incident
is caused by MDEV-23855 InnoDB log checkpointing causes regre... Closed
Relates
relates to MDEV-18115 Remove dummy tablespace for the redo log Closed
relates to MDEV-31171 Document MDEV-31124 Innodb_data_writt... Closed

 Description   

Starting with MDEV-18115 in MariaDB Server 10.5.1, the counter Innodb_data_written no longer includes writes to the redo log file ib_logfile0, which will continue to be counted by Innodb_os_log_written.

When the asynchronous doublewrite was implemented in MDEV-23855, the writes via the doublewrite buffer started to be counted incorrectly, without multiplying them by innodb_page_size. The code has since then been refactored, but the error has been preserved.

While we are at it, it looks like we can remove the separate counter buf_dblwr.pages_submitted (initiated writes) and only report buf_dblwr.pages_written (completed writes).

A work-around for the error could be the following formulae:
real_data_written = Innodb_data_written + (innodb_page_size - 1) * Innodb_dblwr_pages_written
innodb_written = real_data_written + Innodb_os_log_written



 Comments   
Comment by Axel Schwenke [ 2023-04-25 ]

With the proposed fix the numbers for Innodb_data_written + Innodb_os_log_written match the disk write rate as reported by iostat much better. The fix is ok to push.

Generated at Thu Feb 08 10:21:28 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.