locked
Synchronize is extremely slow after reprovision RRS feed

  • Question

  • I have a database with essentially two tables - 1 table has 91000 records, the second table has 480000 records.  The database resides on a local system.  I create a new remote master database to be used to synchronize the data across multiple systems.  I provision the master database and then I provision the local database to the master.  I  then synchronize the database which uploads the records to the master.  This takes under an hour.

    I then deprovision the local database.  I then reprovision the local database.  I then sync the two databases (SyncOrchestrator.Synchronize() and SqlSyncProvider).  The resynchronization takes an inordinate amount of time (It has been running for over 12 hours).  I log events thrown by the synchronization process (except for syncprogress).  My log looks like the following

    08/21/2014 12:51:59 PM: ================= SYNCHRONIZATION STARTED =================
    08/21/2014 12:52:00 PM: SyncSelectingChangesLocal
    08/21/2014 12:52:32 PM: SyncBatchSpooledLocal
    08/21/2014 12:57:37 PM: SyncChangesSelectedLocal Total 211956 Added 211956 Deleted 0 Detached 0 Modified 0 Unchanged 0 Unknown 0
    08/21/2014 12:57:46 PM: SyncBatchSpooledLocal
    08/21/2014 1:01:03 PM: SyncChangesSelectedLocal Total 161222 Added 161222 Deleted 0 Detached 0 Modified 0 Unchanged 0 Unknown 0
    08/21/2014 1:01:12 PM: SyncBatchSpooledLocal
    08/21/2014 1:03:35 PM: SyncChangesSelectedLocal Total 169062 Added 169062 Deleted 0 Detached 0 Modified 0 Unchanged 0 Unknown 0
    08/21/2014 1:03:43 PM: SyncBatchSpooledLocal
    08/21/2014 1:04:12 PM: SyncChangesSelectedLocal Total 299773 Added 299773 Deleted 0 Detached 0 Modified 0 Unchanged 0 Unknown 0
    08/21/2014 1:04:19 PM: SyncBatchSpooledLocal
    08/21/2014 1:04:44 PM: SyncChangesSelectedLocal Total 258323 Added 258323 Deleted 0 Detached 0 Modified 0 Unchanged 0 Unknown 0
    08/21/2014 1:04:50 PM: SyncBatchSpooledLocal
    08/21/2014 1:04:52 PM: SyncChangesSelectedLocal Total 31698 Added 31698 Deleted 0 Detached 0 Modified 0 Unchanged 0 Unknown 0
    08/21/2014 1:10:00 PM: SyncBatchAppliedRemote
    08/21/2014 1:13:44 PM: SyncBatchAppliedRemote
    08/21/2014 1:16:24 PM: SyncBatchAppliedRemote
    08/21/2014 1:17:15 PM: SyncBatchAppliedRemote
    08/21/2014 1:17:57 PM: SyncBatchAppliedRemote
    08/21/2014 1:18:00 PM: SyncBatchAppliedRemote
    08/21/2014 1:18:13 PM: SyncApplyingChangesRemote
    08/21/2014 1:18:37 PM: SyncApplyingChangesRemote
    08/21/2014 1:18:37 PM: SyncApplyingChangesRemote
    08/21/2014 1:18:37 PM: SyncApplyingChangesRemote
    08/21/2014 1:18:37 PM: SyncApplyingChangesRemote
    08/21/2014 1:18:37 PM: SyncApplyingChangesRemote

       ad infinitum

    I tried invoking PerformPostRestoreFixup on the client after reprovisioning but this did not help

    using (SqlConnection clientConn = new SqlConnection(GetConnectionString(false)))
    {
        SqlSyncStoreRestore databaseRestore = new SqlSyncStoreRestore(clientConn);
        databaseRestore.CommandTimeout = 0;
        databaseRestore.PerformPostRestoreFixup();

    It appears as if the syncframework is comparing every record in the two databases.

    Howard

    using (SqlConnection clientConn = new SqlConnection(GetConnectionString(false)))

    {

    SqlSyncStoreRestore databaseRestore = new SqlSyncStoreRestore(clientConn);

    databaseRestore.CommandTimeout = 0;

    databaseRestore.PerformPostRestoreFixup();

    }


    Howard P. Weiss

    Friday, August 22, 2014 3:28 PM

All replies

  • Sync Fx do not compare records.

    PerformPostRestoreFixup wont be of help if you already reprovision. It's used if you want to fixup the sync knowledge of a restored replica.

    When you re-provision (am assuming you deprovision and provision), you wiped out the sync knowledge.

    am guessing, you're running into conflicts because theres no sync knowledge to tell that the replicas has previously synched and already contains the same set of data.

    Monday, August 25, 2014 4:28 AM
  • It takees about an hour to synchronize an empty database with a populated database after provisioning.  It takes at 4 hours to resynchronize a copy of a database against another copy of the same database after dep[rovisioning and reprovisioning the copy.  Is there a way to "quickly" establish the tracking information between two (almost) copies of a database?


    Howard P. Weiss

    Monday, August 25, 2014 1:23 PM
  • none that i know of other than doing a backup -> restore-> performpostrestorefixup -> sync approach
    Tuesday, August 26, 2014 1:39 AM