- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit60690a6
committed
Make stats regression test robust in the face of parallel query.
Historically, the wait_for_stats() function in this test has simply checkedfor a report of an indexscan on tenk2, corresponding to the last commandissued before we expect stats updates to appear. However, with parallelquery that indexscan could be done by a parallel worker that will emitits stats counters to the collector before the session's main backend does(a full second before, in fact, thanks to the "pg_sleep(1.0)" added bycommit957d08c). That leaves a sizable window in which anautovacuum-triggered write of the stats files would present a state inwhich the indexscan on tenk2 appears to have been done, but none of thewrite updates performed by the test have been. This is evidently theexplanation for intermittent failures seen by me and on buildfarm membermandrill.To fix, we should check separately for both the tenk2 seqscan and indexscancounts, since those might be reported by different processes that could bedelayed arbitrarily on an overloaded test machine. And we need to checkfor at least one update-related count. If we ever allow parallel workersto do writes, this will get even more complicated ... but in view of allthe other hard problems that will entail, I don't feel a need to solve thisone today.Per research by Rahila Syed and myself; part of this patch is Rahila's.1 parent708020e commit60690a6
2 files changed
+40
-8
lines changedLines changed: 20 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
37 | 37 |
| |
38 | 38 |
| |
39 | 39 |
| |
40 |
| - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
41 | 43 |
| |
42 | 44 |
| |
43 | 45 |
| |
44 | 46 |
| |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
45 | 57 |
| |
46 |
| - | |
| 58 | + | |
47 | 59 |
| |
48 | 60 |
| |
49 | 61 |
| |
50 |
| - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
51 | 67 |
| |
52 | 68 |
| |
53 | 69 |
| |
| |||
127 | 143 |
| |
128 | 144 |
| |
129 | 145 |
| |
130 |
| - | |
| 146 | + | |
131 | 147 |
| |
132 | 148 |
| |
133 | 149 |
| |
|
Lines changed: 20 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
32 | 32 |
| |
33 | 33 |
| |
34 | 34 |
| |
35 |
| - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
36 | 38 |
| |
37 | 39 |
| |
38 | 40 |
| |
39 | 41 |
| |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
40 | 52 |
| |
41 |
| - | |
| 53 | + | |
42 | 54 |
| |
43 | 55 |
| |
44 | 56 |
| |
45 |
| - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
46 | 62 |
| |
47 | 63 |
| |
48 | 64 |
| |
| |||
121 | 137 |
| |
122 | 138 |
| |
123 | 139 |
| |
124 |
| - | |
| 140 | + | |
125 | 141 |
| |
126 | 142 |
| |
127 | 143 |
| |
|
0 commit comments
Comments
(0)