Replication and Database Mirroring  (Failover) support for Merge Replication between SQL Server 2005 SP1+ and SQL Server 2005 Compact Edition (Mobile Edition SP1+) is supported but it was not documented as the support was added after RTM and the documentation was not updated.  Then comes for me an opportunity to BLOG about it J (apart from filing a DOC BUG).  Here the story goes:

The database mirroring for replication is documented @ http://msdn2.microsoft.com/en-us/library/ms151799.aspx

One important point you should not is that for database mirroring to work, you should be running SQL Server services under a domain account (by default it is under LOCAL SYSTEM account).

Coming to what is supported (With an assumption you know what is meant by Principal (P), Mirror (M), Witness (W)):

Test case description

Initial Sync

Incremental Sync

Sync with Principal – Both are UP

PASS

PASS

Sync with Principal – Mirror is DOWN

PASS

PASS

Sync with Mirror – Both are UP

FAIL

PASS

Sync with Mirror – Principal is DOWN

FAIL

PASS

 

Legend: Old Principal Now Mirror (OPNM), New Principal Old Mirror (NPOM)

Key points to note:

1)    Sync with Mirror means mirror became a principal due to fail over

2)    No need to change the subscription properties when there is a fail over. 

3)    In the initial subscription time/phase, we connect directly to the Publisher supplied in the subscription properties to find the publisher version so that we invoke the right merge replication mode.

4)    Direct connections are not allowed to the Mirror

5)    Points (3) and (4) make the initial subscription fail if we the user specifies the Publisher as OPNM, no matter whether the OPNM is UP or DOWN.  However, if the user specifies NPOM or the current principal as Publisher while creating subscription, subscription succeeds.

Thanks,

Laxmi Narsimha Rao ORUGANTI & Balachandar P