cancel
Showing results for 
Search instead for 
Did you mean: 

Timestamp erased when copying a Mobilink synchronization setup?

Former Member
2,105

Testing a synchronization setup for a customer.

  • I've copied a snapshot of the consolidated and remote databases.
  • Setup an identical synchronization environment on a test server with the exceptions:
    • Since several MobiLink servers are running on the testserver I changed port to 65000 (where this test server is listening) on the clients.
    • Database and MobiLink services were recreated rather than copied
  • Consolidated to Remote download is governed by synchronization scripts and a timestamp to differ old rows from updated ones.

On the first synchronization I notice that everything, including old data, is downloaded to the remote database. It is as if the timestamp has been reset to the client thinks that everything on the consolidated database is updated 😞 As an example I now get a syncrhonization error from a row last updated 2010-09-30 11:27:49.476000.

When connecting to the Mobilink server I see that each remote database is registered with 15 subscriptions for the same publication and user. Probably there has been created a new one for each time the synchronization is redeployed (that has been done now and then). Is it possible to delete the unused subscriptions ? (The list in DBA.ml_subscription)

EDIT: Came across something in the documentation http://dcx.sybase.com/index.html#1201/en/mlserver/ml-synchtech-s-3939388.html:

The MobiLink server sends this TIMESTAMP value as part of the download, and the client stores it.

This might be my problem. As I copied a setup from another server I might not have copied the client timestamp. Docs state that it is stored in the Sys.SYSSYNC view, but this view is empty on my remote database. That brings me to the question; Where does the Mobilink client store its timestamp and how can I add it to my test setup ?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Well, I must say that these internet forums are one of the things I praise Sybase for when discussing database engines with other people 😃

So if I understood this correctly (I want to alter the timestamp only once and only for a given user), lets say I have a mobilink user names mluser and on 13 October 12:00 I knew that the databases were in sync;

Then I can make my ModifyDownloadTimestamp script to do something like this ?

CREATE PROCEDURE ModifyDownloadTimestamp( 
    @download_timestamp DATETIME OUTPUT, 
    @user_name VARCHAR( 128 )) AS 
BEGIN 
    IF  (@download_timestamp < '2012-10-03 12:00') AND
        (@user_name = 'mluser')
    THEN
        SELECT @download_timestamp = '2012-10-03 12:00';
        RETURN;
    END IF;
    --Default handling goes here
    SELECT @download_timestamp = @download_timestamp;
END
jeff_albion
Product and Topic Expert
Product and Topic Expert
0 Kudos

Then I can make my ModifyDownloadTimestamp script to do something like this ?

You can code anything you want to really -- which is the great part about MobiLink! -- and yes, this logic looks to be closer to what you were looking for originally.

This way you'll only be going back a few days in your initial data sync rather than looking for all historic data. Once the user has initially caught up, they can then go back to the normal timestamp increment behaviour.

Answers (2)

Answers (2)

VolkerBarth
Contributor
0 Kudos

Another (though obviously undocumented) method might be to simply adjust the values in the ml_subscription ML system table in the consolidated database. From ML's point of view, that's a system table, but from a DBA' point of view it's just another user-defined table.

That's what stored procedures like ml_delete_sync_state_before do, as well, as Russ has pointed towards. However, whereas they generally drop/reset state information, you apparently would need to "correct" values here like the "progress" counter to make them fit those of the remote.

A BIG CAVEAT: Unless you are really aware of the meaning of those values, modifying them is expected to lead to problems.


Note: I've never done that with v12 but had to do so with older versions (v8 in particular).

Former Member
0 Kudos

That seems to be the "easy offsett" solution I was looking for in the first place.

Do I have to adjust "progress" if I alter "last_upload_time" or "last_download_time" ?

VolkerBarth
Contributor
0 Kudos

I don't know, and my BIG CAVEAT still goes.

FWIW, in v8, there are no "last_upload_time" or "last_download_time" columns in the ml_subscription table so "progress" was all that was to modify, generally to make it fit to the remote's values in system view syssync (or vice versa). - If consolidated and remote have different values for the offset value, then the sync process by default gives the consolidated's value a higher priority unless you use switches like -ra or -rb.

As stated, these are just some details from older versions. This is by no means an invitation to do so. I guess newer versions are smarter when handling differences with progress offsets and the like. USE AT YOUR OWN RISK.

Former Member
0 Kudos

OK, sounds like a last resort option only 😃

Former Member
0 Kudos

If you know the date after which only new remotes have synchronized, ie. before this date only old, unused remote IDs and subscriptions were used, see the ml_delete_sync_state_before stored procedure. The doc is here.

  • Russ