When you switch active and standby databases, here is what Replication Server does:
Issues log suspend against the active and standby RepAgent connections.
Reads all messages left in the inbound queue and applies them to the standby database and, for subscription data or replicated stored procedures, to outbound queues.
All committed transactions in the inbound queue must be processed before the switch can complete.
Suspends the standby DSI.
Enables the secondary truncation point in the new active database.
Places a marker in the transaction log of the new active database. Replication Server uses this marker to determine which transactions to apply to the new standby database and to any replicate databases.
Updates data in the RSSD pertaining to the warm standby databases.
Resumes the connection for the new active database, and resumes log transfer for the new active database so that new messages can be received.