The SRV_MIGRATE_STATE event handler must manage the migration state changes and execute the actions appropriate for each change:
SRV_MIGRATE_STATE changed to SRV_MIG_READY
A “ready” migration state indicates that the client is prepared to migrate and, for now, is not going to send any request. In the SRV_MIGRATE_STATE event handler, Open Server shares the client context with the server the client is migrating to. Afterwards, your application can return from the event handler, and Open Server can automatically instruct the client to start the migration.
SRV_MIGRATE_STATE changed to SRV_MIG_FAILED
If the SRV_MIGRATE_STATE event handler is triggered because the migration state changed to “failed,” your application must access the context again. Your application can request another migration attempt from the SRV_MIG_STATE event handler using the srv_send_ctlinfo() function. However, the client may have sent another query before it indicates it is ready to migrate again. The application must be able to service or migrate such a request.