Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
68163: tpcc: fix error handling in check 3.3.2.4 r=erikgrinaker a=tbg A classic footgun baked into the `database/sql` is that there's an easy-to-miss error check: ```go rows, err := db.Query(/* ... */) if err != nil { return err } for rows.Next() { /* stuff */ } if rows.Err() != nil { // <------------- footgun return err } return rows.Close() ``` This was the case in our impl of TPCC check 3.3.2.4, which runs the following queries (at whatever timestamp is chosen at the time): ```sql SELECT sum(o_ol_cnt) FROM "order" AS OF SYSTEM TIME '2021-07-28 10:03:59.988263+00' GROUP BY o_w_id, o_d_id ORDER BY o_w_id, o_d_id; SELECT count(*) FROM order_line AS OF SYSTEM TIME '2021-07-28 10:03:59.988263+00' GROUP BY ol_w_id, ol_d_id ORDER BY ol_w_id, ol_d_id; ``` As of a recent change, the second query runs into the SQL memory budget in our nightly tests. The missing error check was making that look like a scary anomaly. The other checks all have the same problem. I'll file an issue for that and link it to this PR. With this commit, the roachtest fails with > Error: check failed: 3.3.2.4: on `order_line`: pq: root: memory budget > exceeded: 10240 bytes requested, 3773291520 currently allocated, > 3773295616 bytes in budget as you'd expect. Fixes cockroachdb#68151. (though the memory limit will continue to fail the test until fixed separately). Release note: None Co-authored-by: Tobias Grieger <tobias.b.grieger@gmail.com>
- Loading branch information