MDEV-32673 Handle InnoDB binlog position recovery for RESET MASTER or binlog name change
Another attempt, to do most of what Marko's solution does without
requiring a new handlerton call: Compare each binlog position against
the previous one, and reset all old entries if the position moves
backwards.
Does not work though, it asserts in multiple places about pages not
marked as modified (IIUC) during the reset of commit processing. Also,
even if the mark-as-modified could be added, I'n not sure what the
consequences will be of trying to modify all rseg headers in the final
mtr during commit-to-memory. How would the locking work, if multiple
threads would try to do this simulaneosly? (though that might not be
possible due to LOCK_commit_ordered). Or could there be other locking
problems?
Signed-off-by: Kristian Nielsen <email address hidden>
MDEV-32673 Handle InnoDB binlog position recovery for RESET MASTER or binlog name change
ha_reset_binlog_pos(), trx_rseg_reset_binlog_pos(): Reset the
binlog file name and position to the specified one.
Store it in the first rollback segment (in the system tablespace),
and invalidate all other rollback segments as well as the
pre-10.3.5 legacy information in the TRX_SYS page.
Ensure that process "State" is properly cleaned after query execution
In some cases "SHOW PROCESSLIST" could show "Reset for next command"
as State, even if the previous query had finished properly.
Fixed by clearing State after end of command and also setting the State
for the "Connect" command.
Other things:
- Changed usage of 'thd->set_command(COM_SLEEP)' to
'thd->mark_connection_idle()'.
- Changed thread_state_info() to return "" instead of NULL. This is
just a safety measurement and in line with the logic of the
rest of the function.