We have an application that collects real-time data from our production database servers. Recently, we've upgraded to SQL Server 2014, setup an AlwaysOn group and using a listener read-only connections are routed to the secondary. The code uses an ID-based iteration. It grabs the TOP(n) records where the ID is greater than the last max ID (of the previous fetch). It's not ideal code, I know and I didn't write it, so keep your big boy underoos from getting in a wad. I'm not in a position to change the production server to be serializable at this time, implement hekaton or replace major chunks of the code. I need ideas to help identify the following issue:The problem is some rows take longer to insert and they don't always commit in a sequential order. This causes the code that iterates to "skip" records (using read committed isolation). We need all records or else data won't be aggregated correctly/accurately. We did not see this in production until recently (see recent changes above) and the logic to fetch data hasn't changed in years. We thought it might be related to latency with the secondary, so we pointed the data consumer at the primary. The results were the same, however a lot less frequent.What I'm trying to determine is the cause. Is it some kind of wait? I have a hunch it's related to Network I/O, but how can I be sure?Thanks in advance,SQLStacey
↧