The steps you provide are correct except for the "disable synchronization" and "enable synchronization," which are not needed. If you pause synchronization prior to failing over, you may have some data loss.
The stopping/starting of synchronization occurs automatically when failover is performed, regardless of whether it is automatic or manual. So the process would be:
- Assuming node B is the secondary, make the tempdb modifications on node B
- Fail over to node B
- Make the tempdb modifications on node A
- Fail back to node A
If you are concerned that the tempdb changes might cause issues with replication to the secondary, and thereby affect commit times on the primary, you could change the sync mode to asynchronous to accommodate:
- Assuming node B is the secondary, configure node B as an asynchronous replica
- Make the tempdb modifications on node B
- Configure node B as a synchronous replica and ensure that replication is caught up
- Fail over to node B
- Configure node A as an asynchronous replica
- Make the tempdb modifications on node A
- Configure node A as an synchronous replica and ensure that replication is caught up
- Fail back to node A
I think this is overkill as I don't believe tempdb is used in the replication process, but I can't find an authoritative answer that states that explicitly.