We are having a recurring NAV problem over the last few days. Users complain about table locks, but the NAV Debugger Database Locks page shows no locks. When I look at the locks directly in SQL I find a single SPID locking up multiple users. The query is always the same, copied below. It's clearly an internal NAV query due to the numbered table aliases, but it's unclear what part of NAV is calling it or why it won't run:
IF EXISTS (SELECT TOP 1 NULL FROM NAV.dbo.CQC$Value Entry 5802 WITH (UPDLOCK) WHERE (5802.Item Ledger Entry Type=@0 AND 5802.Order No_=@1 AND 5802.Order Line No_=@2 AND 5802.Valuation Date@3))
​The SPID is always stuck in RUNNABLE status, which would normally indicate a CPU block, but the activity monitor shows no resource issues. CPU is always below 40% utilization, disk is normal, etc. The query isn't waiting on a table lock, so it's not clear why it won't run when CPU is available.
It's happening once or twice per day. I kill the offending spid and everything goes back to normal, seemingly without issue.