Bug #106756 it is better to change recv_sys->n_addrs to atomic
Submitted: 17 Mar 2022 8:31 Modified: 17 Mar 2022 9:17
Reporter: alex xing (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S5 (Performance)
Version:8.0.28 OS:Any
Assigned to: CPU Architecture:Any
Tags: Contribution

[17 Mar 2022 8:31] alex xing
Description:
it is better to change recv_sys->n_addrs to atomic, which can Reduce costly lock conflicts in recv_apply_hashed_log_recs.

How to repeat:
just read the code

Suggested fix:
just as the below patch
[17 Mar 2022 8:32] alex xing
a simple patch to describe the optimization

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

Contribution: optimize.patch (text/plain), 1.53 KiB.

[17 Mar 2022 8:34] alex xing
This optimization does not create correctness problems because recv_sys->mutex is required after exiting while loop
[17 Mar 2022 9:17] MySQL Verification Team
Hello Alex Xing,

Thank you for the report and contribution.

regards,
Umesh