I having blocking on logshipping msdb.dbo.log_shipping_monitor_history_detail, when I am looking where it is initiated I only see SQL Server log shipping.
The complete query is
delete from msdb.dbo.log_shipping_monitor_history_detail
where agent_id = @agent_id
and agent_type = @agent_type
and log_time_utc < @cutoff_time_utc
This is a target server for logshipping and most of the database are in standby/readonly mode around 30+ databases are active on this logshipping.
Please see screenshot of the running query and the one that is blocking.
Because there is a lot of blocking with this query I am seeing other jobs are waiting for worker.
We have tried changing the job timings but it seems this is not related. It seems the cleanup query is being called on a different app and not in the job