(Re-sending to the list) Howdy Kristian.
The patch calls the trx_group_commit_leader() function. That is ackward, as commit-by-rotate does not actually participate in group commit. But the problem is with the existing function trx_group_commit_leader(), which does too much in a single function.
I noted earlier on this part on the PR page and LiBing seems to have practically proven (by the most recent commit that you must've missed) that conducting the rename inside the flush stage of trx_group_commit_leader() is viable: https://github.com/MariaDB/server/pull/3402/commits/287511a703f7dff479396334... By that measure the flushing is expanded onto possibly multiple "implicitly" rotating log files
So please do a small refactoring of trx_group_commit_leader() and keep only ...
and no need for refactoring really arises. Could you please assess that approach, cheers, Andrei