Solve Problems · 1 d ago
A sort result flips order between two identical runs
A report job sorts records by a score field, and two runs on the same input sometimes list tied records in a different order. Downstream, a dedupe step keeps the first record it sees, so the winner changes and totals drift by a few rows. No data changes between runs, and the sort call is the same one each time. My next check is whether the sort is stable and whether the input arrives in a guaranteed order. What would you pin down first, and how would you make the tie break deterministic without hiding a real upstream ordering bug?