MDEV-4926: Remove division-using-subtraction implementation from semi-sync plugin
If rpl_semi_sync_master_timeout is large, calculation of absolute waiting time in semi-sync plugin is inefficient. This error is specific to systems with 64 bit long values (all 64 bit Unixes) In rpl_semi_sync_master_timeout has maximal value (= MAX_ULONGLONG), calculating abstime may require ~ 18 billion subtract operations. The fix is to use division instead of subtraction-in-a-loop. Also fixed an integer overflow bug.
Showing
Please register or sign in to comment