I have seen this, but I am completely unable to repro it, nor should it be possible in our code. What happens is this:
- We do things that can throw the counts off, mainly vote reversals (including some from community).
- Immediately after, we sync up the the Score column on Posts that you see by totalling up the current votes and doing an UPDATE. So it's by-design the counts get out of sync, but it should only be for a few seconds.
We are aware of the issue, I'm just scratching my head at the root cause. It may be that on a large change job we're getting bitten by
READ UNCOMMITTED and getting some dirty data in the
UPDATE that trails. I'll take another look tomorrow and see if anything else comes to mind.
Edit: there is a deadlock case we specifically exclude from logs on scheduled tasks - I added some logging specifically for this method to see if that's happening here. I haven't gotten a notification from our SQL monitors so I doubt it...but maybe. If that's the case, I have to go see why the SQL server monitoring didn't pick it up...and I have 2 problems.