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

Transactional Replication Snapshot Stuck

$
0
0

Snapshot Agent History shows:

[98%] The process is running and is waiting for a response from the server.

Execution Timeout Expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.


Background:

The replication used to work just fine. There are no blocking processes. I've increased the timeout period via the agent profile to 1 hour. There's plenty of space in the snapshot file share.

Details:

I can see a long running query from the Snapshot Agent SMO Connection "application" in the Activity Monitor. It shows this query:

(@_msparam_0 nvarchar(4000),@_msparam_1 nvarchar(4000))SELECT
SCHEMA_NAME(tbl.schema_id) AS [Table_Schema],
tbl.name AS [Table_Name],
i.name AS [Index_Name],
p.name AS [Name],
CAST(p.value AS sql_variant) AS [Value]
FROM
sys.tables AS tbl
LEFT OUTER JOIN sys.periods as periods ON periods.object_id = tbl.object_id
LEFT OUTER JOIN sys.tables as historyTable ON historyTable.object_id = tbl.history_table_id
INNER JOIN sys.indexes AS i ON (i.index_id > @_msparam_0 and i.is_hypothetical = @_msparam_1) AND (i.object_id=tbl.object_id)
LEFT OUTER JOIN sys.key_constraints AS k ON k.parent_object_id = i.object_id AND k.unique_index_id = i.index_id
INNER JOIN sys.extended_properties AS p ON p.major_id=CASE (i.is_primary_key + 2*i.is_unique_constraint) WHEN 0 THEN i.object_id ELSE k.object_id END AND p.minor_id=CASE (i.is_primary_key + 2*i.is_unique_constraint) WHEN 0 THEN CAST(i.index_id AS int) ELSE 0 END AND p.class=CASE (i.is_primary_key + 2*i.is_unique_constraint) WHEN 0 THEN 7 ELSE 1 END
ORDER BY
[Table_Schema] ASC,[Table_Name] ASC,[Index_Name] ASC,[Name] ASC

I've traced that query and the parameters passed in are '0' and '0'. Running the query in a query editor window with the parameters indeed exhibit the same results - a long running query that never finishes. The number of logical reads will surpass the billions and continues climbing until it times out. I am 100% sure it's this query that's causing the problem and cannot work around it since the query is internal to the snapshot process - narrowing it down to the ugly case statements in the joins. Is there any way I can get around this? Might be a bug. I may have the option to upgrade to CU20.

Currently on SQL Server version 14.0.1000.169


Viewing all articles
Browse latest Browse all 4054

Trending Articles



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