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