After installing SQL SERVER 2008 R2 SP2 on the subscriber server, merge replication between subscriber and distributer errors out with message "Another merge agent for the subscription or subscriptions is running, or the server is working on a previous request by the same agent". In running a profiler trace on the distributor, it seems that the process on the distributer executes sys.sp_getapplock to acquire the lock 7:[Publication_Name\](B39a8334) twice...the first time, the lock is acquired and never released, the 2nd time this occurs, a Lock:Timeout occurs, throwing the error "Another merge agent for the sbuscription..." error is thrown.
Because this made no sense, I uninstalled SP2 to see if it was due to SP2. By uninstalling SQL SERVER 2008 R2 SP2, the subscriber is able to connect to the distributor without any issues. I then installed SQL SERVER 2008 R2 SP1 to confirm that replication will still work, which it does. I then installed SP2 on top of the SP1 instance and replication is broken again. I rolled the instance back to SP1, and replication works again.
What is in the subscriber that is causing the distributor to try to acquire the lock for the subscription twice, which is causing the replication to fail?
We do not want to re-create the subscription to the distributor because that will mean re-initialization of all our customers down stream.