Mirroring Causing Replication Delay When Mirror Is Unavailable...

  • Here's the scenario...

    I have a database which is mirrored to another server. The PRIMARY also serves as a publisher for replication (using a remote distributor). The mirroring is using the HIGH PERFORMANCE operating mode so that all transactions are applied at the PRIMARY and then sent to the mirror.

    The Issue...

    If the mirror is unavailable, it would seem as though transactions are still not being applied at the primary. The reason I believe that is because while the mirror is unavailable, no transactions are sent from the publisher to the distributor in the replication scenario. There are no immediate warnings or alarms from the distributor as it simply sees that there are no transactions to distribute. If mirroring is stopped (or the mirror becomes available), transactions start flowing again, not only to the mirror obviously, but to the remote distributor.

    Does anyone have any ideas on this or has experienced this behavior? If mirroring in HIGH SAFETY mode, I would almost expect this as under that mode, transactions are only applied at the principal once they have been sent to the mirror and the mirror acknowledges that said transactions were received and applied.

    Any help or insight would be greatly appreciated!

    Brian

  • I have experienced this same behavior with SQL 2008R2. I have databases mirrored in high performance mode, in "disconnected" state due to some firewall changes that were applied over the weekend. Transactional replication is not ....... replicating. Replication Monitor does not readily show any problems at all but inspection of the Log Reader Agent shows the following message "Replicated transactions are waiting for the next log backup or for mirroring partner to catch up". Inserting a Tracer Token shows that transactions are not getting delivered to the Distributor. All i can figure at this point is that the database transactions are still considered 'active' until the mirror site confirms reciept, and this is preventing replication from flowing changes to the subscribers. The mirroring connection is now fixed so once the mirrors are caught up on the backlog, i hope that replication will resume 'replicating'.

  • This behavior is by design. This excerpt from "SQL Server Replication: Providing High Availability using Database Mirroring" written by Paul Randal and Gopal Ashok, explains it well

    "It is possible for the principal to become exposed (the mirror is accessible but there are log records that have not yet been hardened on the mirror) or isolated (the mirror is inaccessible). In both cases, if the principal is still able to serve the database, any changes made to the database are not replicated until the corresponding log records are hardened on the mirror.

    This behavior introduces latency in the replication stream, and is done so that if a mirroring failover occurs, it is guaranteed that replication Subscribers cannot be “ahead” of the new principal database."

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply