Schema change getting applied repeatedly every time Merge agent runs


Recently worked on an interesting case. Customer had an existing Merge Replication and it was working fine.

They added a new article to the existing Publication and ran the Snapshot Agent.

Now Every time Merge agent runs we see that Schema changes were getting re-applied.

 

At the start of a synchronization, the schemaversion of the subscription is checked against sysmergeschemachange by the Merge Agent, and schema changes are applied to the subscriber accordingly.

 

Ran these queries on the subscriber

>>>

select max(schemaversion) from sysmergeschemachange

–22

 

select schemaversion, pubid, subid from sysmergesubscriptions

where pubid<>subid

 

schemaversion        pubid        subid

15        A0B0FAA8-22B9-4CC5-8AED-547F2EBCEB83        85CD9161-5659-42CC-A501-BB43072B0045