Jump to content

Auto sync of 2 Servers in different locations


KVs

Recommended Posts

We have 2 Plastic Enterprise servers in Bangalore and London. Both servers act as Master.

Currently using triggers to replicate the Repositories between 2 servers. Issue here is the replication starts only on trigger.

Is there any better way to auto sync all the repositories between 2 servers at server level instead of repository level?

Will deploying Cloud extension on these servers help to achieve auto syncing of all Repos on  daily basis? 

Thanks

 

Link to comment
Share on other sites

Dear Carlos,

Thanks for the synctrigger tool.

Tried the tool  on the test setup with 2 windows servers. Changed the Plastic Server service account to run as Administrator user to make it work.

During network outage if there are checkins to the same Repository on both servers , the changeset number is same on both servers. But the Changeset content is different. When the network resumes, the sync stops with error and requires user intervention to sort out the sync issues. Is it possible to avoid user intervention by deploying cloud extension.

 Another issue is the tool is installed on both Plastic servers. The after-replicationwrite trigger goes on endless loop. Attached is the log file.

Should we remove after-replicationwrite trigger in one of the server? 

Warnemails does not work does not work. I think we can correct this issue ourselves.

Thanks

Saravanan

 

 2020-10-09.log.txt

Link to comment
Share on other sites

  • 2 weeks later...

Hello Carlos,

Moved the the syncservertrigger to production servers. But after-replicationwrite trigger is removed.

My only issue now is delete changeset is not replicated between servers.

Any idea on how to resolve this issue.

Thanks

Link to comment
Share on other sites

Hello Carlos,

Moved the the syncservertrigger to production servers. But after-replicationwrite trigger is removed.

My only issue now is delete changeset is not replicated between servers.

Any idea on how to resolve this issue.

Thanks

Link to comment
Share on other sites

  • 3 weeks later...

Hi Carlos,

In continue to this topic, question about handling branch rename.

We trigger replication with "after-checkin" trigger, but after branch rename, the replication fails. currently we need to solve the conflict manually.

I did not find a "branch rename trigger".  Do you have any suggestion how to handle this scenario automatically? 

 

BR,

Ofir

Link to comment
Share on other sites

I'm afraid it's not possible to push any change that involves history rewritting. If you pushed a branch and then you rename it, you will need to manually rename the remote branch in the remote repo to keep both fully synced (same happens if you delete a changeset/branch).

Why are you renaming the branches after the sync?

Regards,

Carlos.

Link to comment
Share on other sites

57 minutes ago, calbzam said:

I'm afraid it's not possible to push any change that involves history rewritting. If you pushed a branch and then you rename it, you will need to manually rename the remote branch in the remote repo to keep both fully synced (same happens if you delete a changeset/branch).

Why are you renaming the branches after the sync?

Regards,

Carlos.

For the deleted cs/branch I plan to use the relevant triggers to trigger automatic sync (need to upgrade the servers to version 9.x).

Our devs tend to rename branches once in a while (better naming or adding missing info which is missing when the branch is created), nothing that I can prevent - I'm checking my options how to manage it automatically.   

Link to comment
Share on other sites

  • 6 months later...

Hi Carlos,

We are writing program to sync the changeset deletion in servers.

GUID is common between the servers. So we retrieve the GUID with before-rmchange set trigger and delete the changeset in  remote server with after-rmchangeset trigger.

The issue is we get null value for PLASTIC_FULL_BRANCH_NAME environment variable.

Sample code is below

echo %PLASTIC_CHANGESET_NUMBER% >> C:\trigger\log.txt
echo %PLASTIC_CHANGESET_OWNER% >> C:\trigger\log.txt    
echo %PLASTIC_BRANCH_NAME% >> C:\trigger\log.txt
echo %PLASTIC_REPOSITORY_ID% >> C:\trigger\log.txt    
echo %PLASTIC_REPOSITORY_NAME% >> C:\trigger\log.txt    
echo %PLASTIC_COMMENT% >> C:\trigger\log.txt
echo %PLASTIC_FULL_BRANCH_NAME% >> C:\trigger\log.txt
echo %PLASTIC_CLIENTMACHINE% >> C:\trigger\log.txt

Please let me know is there any other way to sync the changeset deletion.

 

Br,

KVS

Link to comment
Share on other sites

Hi,

It may be a bug while we are not showing this enviroment variable (or an error in the documentation). Let us try to reproduce it.

Anyway, in order to delete a changeset, the branch name shouldn't be relevant, right? But only the changeset guid and repo name.

eg:

cm changeset delete cs:2b55f8aa-0b29-410f-b99c-60e573a309ca@devData

Also, if you have the changeset guid, you can get the branch name via:

cm find changeset "where guid=2b55f8aa-0b29-410f-b99c-60e573a309ca" --format={branch}--nototal

Regards,

Carlos.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...