Quantcast
Channel: SQL Server Replication forum
Viewing all articles
Browse latest Browse all 4054

Loopback detection in transactional replication relies on server name

$
0
0

Hi,

I'm posting here mostly to document my experience and maybe save someone some trouble.  I am setting up bi-directional transactional replication between 2 identical databases in Sql Server 2008R2.  Most of the tables in our database have an update trigger to set a "last_updated" column to getdate().  Initial tests looked fine, but as I tried to automate the installation, I found I'd created a loop in the replication (this showed up initially as constant hard disk use on my laptop; eventually I got to looking at distribution..MSrepl_commands and saw that it had a few million rows -- and when I dropped the databases and reproduced the condition, I could see the commands doubling every few seconds).

I made sure @loopback_detection was set in sp_addsubscription.  But the real problem is in what I was giving the @subscriber parameter to sp_addsubscription.  I was using "tcp:localhost,1433".  Actually it surprises me that it works at all.  But it seems to mess up loopback detection.

So my advice to anyone setting up bi-directional transactional replication: use the real destination server name when you set up the subscription!

Thanks for listening,

Mike


Viewing all articles
Browse latest Browse all 4054

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>