set global enforce_gtid_consistency=warn; set global enforce_gtid_consistency=on; set global gtid_mode=off_permissive; set global gtid_mode=on_permissive; show status like '%ongoing_anonymous_transaction_count%'; #这个值需要为0才能进行下一步,但这个值可能跳动,但不重要,只要出现一次0就可以。
在开始下一步之前,需要确认所有的 anonymous 事务全部执行完毕,否则不能开始下一步。
正常情况下,执行完上面步骤,在日志中会有如下内容:
1 2 3 4
2021-03-23T16:29:38.633061+08:00 78376 [Note] Changed ENFORCE_GTID_CONSISTENCY from OFF to WARN. 2021-03-23T16:30:57.357049+08:00 78376 [Note] Changed ENFORCE_GTID_CONSISTENCY from WARN to ON. 2021-03-23T16:32:01.873079+08:00 78376 [Note] Changed GTID_MODE from OFF to OFF_PERMISSIVE. 2021-03-23T16:32:28.508045+08:00 78376 [Note] Changed GTID_MODE from OFF_PERMISSIVE to ON_PERMISSIVE.