On 6/30/2024 3:44 PM, Steve Sistare wrote:
Add the cpr-transfer migration mode. Usage:
[...]
@@ -2144,6 +2158,29 @@ void qmp_migrate(const char *uri, bool has_channels,
goto out;
}
+ /*
+ * For cpr-transfer mode, the target first reads CPR state, which cannot
+ * complete until cpr_state_save above finishes, then the target creates
+ * the migration channel and listens. We must wait for the channel to
+ * be created before connecting to it.
+ *
+ * This implementation of waiting is a hack. It restricts the channel
+ * type, and will loop forever if the target dies. It should be defined
+ * as a main-loop event that calls connect on the back end.
+ */
+ if (s->parameters.mode == MIG_MODE_CPR_TRANSFER) {
+ SocketAddress *saddr = &addr->u.socket;
+ if (addr->transport == MIGRATION_ADDRESS_TYPE_SOCKET &&
+ saddr->type == SOCKET_ADDRESS_TYPE_UNIX) {
+ while (access(saddr->u.fd.str, F_OK)) {
+ usleep(1000000);
+ }
I now have a proper fix for this handshake in my work space.
- Steve