Deployment freezes when linked servers are involved
marclallen
Posts: 53 Bronze 3
in SQL Compare
I'm looking for some help here. I don't believe this is a problem with SQL Compare.
When I have a number of changes for, say, functions that touch linked servers, when I execute the deploy script (inside a READ COMMITTED transaction), it stalls on one of the functions.
SP_WHO2 shows it in a runnable state and not blocking. But it consumes CPU extremely slowly. There is one other process, calling sys.sp_check_constbytable_rowset that blocks on the deploy process.
The only way to get out of it is to kill the deploy SPID and then kill the blocked process. Killing just the deploy SPID puts it in a KILLED/ROLLBACK state until the other one is also killed.
Running SQL Server 2008R2 with SP3 on the target.
Any thoughts or suggestions where to look?
Thanks!
When I have a number of changes for, say, functions that touch linked servers, when I execute the deploy script (inside a READ COMMITTED transaction), it stalls on one of the functions.
SP_WHO2 shows it in a runnable state and not blocking. But it consumes CPU extremely slowly. There is one other process, calling sys.sp_check_constbytable_rowset that blocks on the deploy process.
The only way to get out of it is to kill the deploy SPID and then kill the blocked process. Killing just the deploy SPID puts it in a KILLED/ROLLBACK state until the other one is also killed.
Running SQL Server 2008R2 with SP3 on the target.
Any thoughts or suggestions where to look?
Thanks!
Tagged:
Best Answer
-
marclallen Posts: 53 Bronze 3Oops... I spoke too soon. Using '.' uses the base machine. I'm actually using a specific instance and when I change it for that, it breaks again.
Here's the real deal:
Essentially, SQL Server 2008R2 does not recognize a loopback linked server for what it really is... self-referencial. So, when you access it, it still opens up a new SPID to it. However, with the transaction started and the first (dummy) proc alteration done, the script SPID has an X-lock on some special, super secret, DAC-accessable only, schema table (sysschobjs). So, when the new SPID tries to verify the linked server table exists, it blocks. So, the script blocks on itself, but doesn't realize it.
Answers
When I had just read the first post, I thought it might be permissions related, similar to the posts here:
https://thwack.solarwinds.com/thread/112152
http://www.benjaminnevarez.com/2011/05/optimizer-statistics-on-linked-servers/
I unfortunately can't think of/ find anything specific to transactions that might be causing this though.
Hopefully others in the community may have some ideas!
Jessica Ramos | Product Support Engineer | Redgate Software
Have you visited our Help Center?
It gets stranger. It only seems to happen on the *second* procedure/function that I alter (all within the same transaction) that uses a linked server. If I only try to update one, it works fine.