none
Sync Hangs RRS feed

  • Question

  • I am using the Sync 1.0 Framework and every so often the Sync Process for the catalog will work just fine but our Order section will hang. I have ran a trade and it seems to go through the entire process but the results never reach the client. I am going from SQL Server 2005 to a SQL CE db using the 3.5.1 framework.

    On another note this might be apart of of the problem but sometimes it will start syncing before it gets the anchor so the procs will be executed with null values.

     

    Monday, March 29, 2010 8:46 PM

Answers

  • I would also suggest to take a look at the output of the sp_who2 and dbcc inputbuffer() to see what the running proc is doing and see if there is any blocked procs.

    since it like your system is busy on something, checking on the errorlog, the Sql profiler could also give some hint on this.

    thanks

    Yunwen


    This posting is provided "AS IS" with no warranties, and confers no rights.
    Tuesday, May 18, 2010 10:34 AM
    Moderator

All replies

  • Wednesday, March 31, 2010 12:32 PM
    Moderator
  • Back to having this issue but I am not able to reproduce it on our test system.

    I currently am able to strip ot all but the lookup tables and just a Customer table and I am able to get the sync to hang on the Customer Sync. It almost seems like the proc is not finishing. I have ran a SQL Profile trace on the process and the Start for the proc is shown but never the complete.

    I can switch databases on the same server and the process works. Can the data somehow be related?

    Wednesday, May 5, 2010 8:00 PM
  • does it hang when you copy and execute the same sp you captured in SQL Profiler? any locking issues?
    Wednesday, May 5, 2010 11:08 PM
    Moderator
  • No table locks and yes I can copy the proc and it runs in about 1-2 seconds. I am returning about 4k-5k rows though. This problem seems to just come and go. It won't be working for an hour or two and then suddenly it's back up and I didn't do anything other then do research and try to see what is going on.

    When I left yesterday I could not sync on our test db and this morning it is working again and I am the only one who touches that database. Maybe some sort of cache setting getting overloaded for the db?

    I should also mention that I am using the 1.0 Sync Framework. I'd love to upgrade but we do some pretty unique filtering and I do not have the time to upgrade at the moment.

    Thursday, May 6, 2010 12:37 PM
  • Ok so it would seem a proc was the problem but the change I made shouldn't of solved the problem since it was just a redundant join to a table that we no longer have to join to to complete the relationship.
    Monday, May 10, 2010 1:31 PM
  • Hi,

     

    You may want to enable Sync tracing with verbose level and check if there are any errors in sync runtime. With the current information, it is difficult to tell the possible causes of this issue.

    Also, since you modified the stored procs, you may try to use the default stored procedures generated by the command builder to check if you still can repro this issue. It will help you narrow down the root cause.

     

    Thanks,
    Dong


    This posting is provided AS IS with no warranties, and confers no rights.
    Monday, May 10, 2010 6:27 PM
    Moderator
  • I was unaware that the 1.0 framework auto generated anything. We have to have custom procs due to the way that we filter and because of how many end users we have.

    I have seen some simple examples of Sync Tracing but they all seem to use the same event handlers that I am using for our error handling.I double checked and I didn't throw any sort of error, maybe if I left it long enough it would time out but nothing other then that.

    I am possibly just not understanding the proper way to enable sync tracing though. Can you point me to a good example?

    Monday, May 10, 2010 6:35 PM
  • Hi,

    Here is link for enabling sync tracing- http://msdn.microsoft.com/en-us/library/cc807160.aspx. It logs the activities of sync framework runtime that is not event handling. Which database sync provider is used in your scenario? DbServerSyncProvider+SqlCeClientSyncProvider (offline providers) or DbSyncProvider (collaboration provider)?

    Thanks,
    Dong


    This posting is provided AS IS with no warranties, and confers no rights.
    Monday, May 10, 2010 6:58 PM
    Moderator
  • We are using DbServerSyncProvider+SqlCeClientSyncProvider.
    Monday, May 10, 2010 7:11 PM
  • They are offline providers. You should be able to generate Sql commands with Adapter command builder - http://msdn.microsoft.com/en-us/library/bb726018(v=SQL.100).aspx. Please follow the link in my previous email to enable sync tracing and check if the logs can give you any hints for this hanging issue.

    Thanks,

    Dong


    This posting is provided AS IS with no warranties, and confers no rights.
    Monday, May 10, 2010 7:18 PM
    Moderator
  • Thanks for the quick responses but I still don't believe that a trace is going to yield any more results. Looking over the example as all other examples you use the Tracer to record the actual conflict but the AppliedChangeFailedEvent is what is raised. I am using the same event handler and nothing is being raised when it hangs. I currently write out the conflicts to our database if we have any but to make sure I am breaking at anytime there is an error.

    Not sure if that all makes sense or not. Possibly I am not understanding how the trace works.

    Monday, May 10, 2010 8:27 PM
  • Hi,

    The sync tracing logs all action details of the database providers. For example, before a AppliedChangeFailedEvent is raised for a conflict, the tracing logs can tell us what kind of changes are found in change enumeration side, how data are sent to change application side, and which SQL command is executed to try to apply a change. If something is wrong, tracing logs help us figure out that things start to be wrong at which exact point.

    For your hanging issue, the tracing logs can help us see if a SQL command is hanging, or an infinite loop is running. You may want to try the sync tracing once to see it will be helpful. Generally, it is a common way for the syncfx product team to investigate custom failures and for our customers to find what is wrong in their implementation.

    Thanks,
    Dong

     


    This posting is provided AS IS with no warranties, and confers no rights.
    Monday, May 10, 2010 8:59 PM
    Moderator
  • Ok so the tracer writes to the file behind the scenes as well as specific calls designated in the custom code.

    If that's so I'll probably start on that tommarow.

    The hanging issues generally isn't to big of a deal until someone makes a lot of noise about syncing then it's an emergency just like in any company.

    Monday, May 10, 2010 9:06 PM
  • It seems to be hanging on Enumerating. I can pull the qry out of the SQL Profiler and execute it fine (takes 4 sec) but it is hanging on this part. I do not have any relations setup on my client side since my objects manage that quite well. Any ideas?

    INFO   , WebDev.WebServer, 4, 05/14/2010 19:10:38:777,    ----- Enumerating Deletes for Table LsProfileService -----
    VERBOSE, WebDev.WebServer, 4, 05/14/2010 19:10:38:777, Using Command: dbo.LsProfileServiceSyncDeletes
    VERBOSE, WebDev.WebServer, 4, 05/14/2010 19:10:38:777,    Parameter: @sync_initialized Value: 1
    VERBOSE, WebDev.WebServer, 4, 05/14/2010 19:10:38:777,    Parameter: @sync_last_received_anchor Len: 8 Value: 00-00-00-00-07-C8-00-79
    VERBOSE, WebDev.WebServer, 4, 05/14/2010 19:10:38:777,    Parameter: @sync_new_received_anchor Len: 8 Value: 00-00-00-00-08-23-5E-C0
    VERBOSE, WebDev.WebServer, 4, 05/14/2010 19:10:38:777,    Parameter: @sync_client_id Value: bd5c4c87-fe70-4e40-a804-91be0a3a1092

    Friday, May 14, 2010 7:19 PM
  • When this hang issue happens, are there any other DMLs on the same table? Did you check the locks in the SQL Server? Since you cannot repro it by rerunning the same enumeration command, I suspect it is due to a SQL Server dead lock issue.

    Thanks,
    Dong


    This posting is provided AS IS with no warranties, and confers no rights.
    Friday, May 14, 2010 11:33 PM
    Moderator
  • I checked the activity monitor for that database and I did not see any table locks. Also if I can pull the query out of the profiler and run it, I should see the locks there as well if there where any?
    Monday, May 17, 2010 1:04 PM
  • Hi,

    We didn't see this issue during testing. When you get the repro, can you also try to run a sp_who2 and use dbcc inputbufer(proc id) to see if there is an offending query?

    Thanks,

    Dong


    This posting is provided AS IS with no warranties, and confers no rights.
    Monday, May 17, 2010 7:36 PM
    Moderator
  • It doesn't look like a table lock. When this happens our sql server machine maxes out the cpu. I am not sure what you mean by offending query other then a table lock, which it is not locking the tables.
    Monday, May 17, 2010 8:48 PM
  • I would also suggest to take a look at the output of the sp_who2 and dbcc inputbuffer() to see what the running proc is doing and see if there is any blocked procs.

    since it like your system is busy on something, checking on the errorlog, the Sql profiler could also give some hint on this.

    thanks

    Yunwen


    This posting is provided "AS IS" with no warranties, and confers no rights.
    Tuesday, May 18, 2010 10:34 AM
    Moderator