FIX: Metadata cannot be removed at publisher and synchronization time increases when you use merge replication

Symptoms
Assume that you use Microsoft SQL Server 2012 Service Pack 2 (SP2) merge replication. When you clean up metadata by executing sp_mergemetadataretentioncleanup at the publisher, the metadata cannot be removed even though all subscribers have recently synchronized successfully. In this situation, the synchronization time can be increased significantly because of the excessive metadata.

Note There is a null value in the last_local_recguid column, or there is an old generation in the last_local_recgen column for some subscribers in the sysmergesubscriptions table at the publisher side.
Cause
This issue occurs because some changes are introduced to reduce the possibility of non-convergence in the merge metadata cleanup procedure. To achieve this, the cleanup validates which generations could still be active in order to avoid a scenario in which they are deleted and then reintroduced through a subscriber that does not synchronize frequently. This detection mechanism may exclude some generations from the cleanup list even though they are no longer within the retention period. In some cases, this may increase the size of the metadata tables.
Resolution
This issue was first fixed in the following cumulative update of SQL Server.

Cumulative Update 1 for SQL Server 2014 SP1

Cumulative Update 4 for SQL Server 2012 SP2

About cumulative updates for SQL Server

Each new cumulative update for SQL Server contains all the hotfixes and all the security fixes that were included with the previous cumulative update. Check out the latest cumulative updates for SQL Server:
Status
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
Properties

Article ID: 3027425 - Last Review: 06/22/2015 15:32:00 - Revision: 2.0

Microsoft SQL Server 2012 Service Pack 2, Microsoft SQL Server 2014 Service Pack 1

  • kbqfe kbfix kbsurveynew kbexpertiseadvanced KB3027425
Feedback