Bug #118872 Innodb_data_written lacks statistics for double-write files
Submitted: 21 Aug 5:01 Modified: 21 Aug 6:30
Reporter: Ke Yu (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:8.0.40 OS:Any
Assigned to: CPU Architecture:Any

[21 Aug 5:01] Ke Yu
Description:
Innodb_data_written lacks statistics for double-write files.

How to repeat:
Just from the code.

This bug was introduced by WL#5655 in 8.0.20.
Before 8.0.20, the writing of double-write file accomplished by fil_io(). fil_io() will call Fil_shard::do_io() which will increase the Innodb_data_written:
```
Fil_shard::do_io{
...
  srv_stats.data_written.add(len);
...
}
```

After 8.0.20, the writing of double-write file accomplished by dblwr::Segment::write() which does not increase the Innodb_data_written.

Suggested fix:
call srv_stats.data_written.add(len) in dblwr::Segment::write().
[21 Aug 6:30] MySQL Verification Team
Hello Ke Yu,

Thank you for the report and feedback.

regards,
Umesh