We are an issue, related to the metadata cleanup. Some time ago we reduced the retention period down from the default to 3 days and did not encounter issues, then last suddenly began to encounter the error below for various publications. It does not occur on
every synchronisation. The output from setting agent parameters defined at http://msdn.microsoft.com/en-us/library/ms151872(d=printer,v=sql.100).aspx is
shown below
2013-04-24 11:09:13.648 The merge process could not perform retention-based metadata cleanup in database 'XXXXX'. If this failure continues, try increasing the query timeout for this process, or try reducing the retention period. When troubleshooting,
restart the synchronization with verbose history logging and specify an output file to which to write.
2013-04-24 11:09:13.648 OLE DB Subscriber 'XXXXXXX': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2013-04-24 11:09:13.664 Percent Complete: 57
2013-04-24 11:09:13.664 The merge process could not perform retention-based metadata cleanup in database 'XXXXX'. If this failure continues, try increasing the query timeout for this process, or try reducing the retention period. When troubleshooting,
restart the synchronization with verbose history logging and specify an output file to which to write.
2013-04-24 11:09:13.664 OLE DB Distributor 'FULTON-LON1-C': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2013-04-24 11:09:13.742 Percent Complete: 0
2013-04-24 11:09:13.742 Category:NULL
Source: Merge Replication Provider
Number: -2147199466
Message: The merge process could not perform retention-based metadata cleanup in database 'XXXX'. If this failure continues, try increasing the query timeout for this process, or try reducing the retention period. When troubleshooting, restart the synchronization with verbose history logging and specify an output file to which to write.
Viewing the synchronisation history in replication monitor for the failed synchronisations shows the following:
Error messages:
The merge process could not perform retention-based metadata cleanup in database 'XXXX'. If this failure continues, try increasing the query timeout for this process, or try reducing the retention period. When troubleshooting, restart the synchronization
with verbose history logging and specify an output file to which to write. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147199466)
Get help: http://help/MSSQL_REPL-2147199466
Violation of UNIQUE KEY constraint 'UQ__#oldgens__DCDFEE736CD828CA'. Cannot insert duplicate key in object 'dbo.#oldgens'. (Source: MSSQLServer, Error number: 2627)
Get help: http://help/2627