In-batch migration and idle migration

With in-batch migration the client migrates while waiting for results from the original server. Conversely, with idle migration, the client is not waiting for any result from the original server.

In-batch migration enables Open Server to delay sending or completing results until after a connection has migrated. This is useful if Open Server cannot service the specific request or if it has no time to complete the request. With in-batch migration, Open Server can send a part of the result from the original server, and, after migration, the server the client has migrated to can send the other part of the result from the SRV_MIGRATE_RESUME event handler.

NoteThe original server can send a complete result to the client, in which case the new server does not send any result. Likewise, the original server may not send any result to the client, in which case, the new server must send the complete result to the client.

In an in-batch migration, your application must ensure that the unsent commands and messages are part of the client context. The new server must also access the number of rows affected by the command and the transaction state of the connection. The new server will send this information to the client using srv_senddone().