- Notifications
You must be signed in to change notification settings - Fork5
Commitd6c9e05
committed
Fix assorted bugs in contrib/bloom.
In blinsert(), cope with the possibility that a page we pull from thenotFullPage list is marked BLOOM_DELETED. This could happen if VACUUMrecently marked it deleted but hasn't (yet) updated the metapage.We can re-use such a page safely, but we *must* reinitialize it so thatit's no longer marked deleted.Fix blvacuum() so that it updates the notFullPage list even if it'sgoing to update it to empty. The previous "optimization" of skippingthe update seems pretty dubious, since it means that the next blinsert()will uselessly visit whatever pages we left in the list.Uniformly treat PageIsNew pages the same as deleted pages. This shouldallow proper recovery if a crash occurs just after relation extension.Properly use vacuum_delay_point, not assorted ad-hoc CHECK_FOR_INTERRUPTScalls, in the blvacuum() main loop.Fix broken tuple-counting logic: blvacuum.c counted the number of liveindex tuples over again in each scan, leading to VACUUM VERBOSE reportingsome multiple of the actual number of surviving index tuples after anyvacuum that removed any tuples (since they'd be counted in blvacuum, maybemore than once, and then again in blvacuumcleanup, without ever zeroing thecounter). It's sufficient to count them in blvacuumcleanup.stats->estimated_count is a boolean, not a counter, and we don't wantto set it true, so don't add tuple counts to it.Add a couple of Asserts that we don't overrun available space on a bloompage. I don't think there's any bug there today, but the way theFreeBlockNumberArray size calculation is set up is scarily fragile, andBloomPageGetFreeSpace isn't much better. The Asserts should help catchany future mistakes.Per investigation of a report from Jeff Janes. I think the first itemabove may explain his report; the other changes were things I noticedwhile casting about for an explanation.Report: <CAMkU=1xEUuBphDwDmB1WjN4+td4kpnEniFaTBxnk1xzHCw8_OQ@mail.gmail.com>1 parented0097e commitd6c9e05
4 files changed
+60
-41
lines changedLines changed: 11 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
237 | 237 |
| |
238 | 238 |
| |
239 | 239 |
| |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
240 | 247 |
| |
241 | 248 |
| |
242 | 249 |
| |
| |||
295 | 302 |
| |
296 | 303 |
| |
297 | 304 |
| |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
298 | 309 |
| |
299 | 310 |
| |
300 | 311 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
135 | 135 |
| |
136 | 136 |
| |
137 | 137 |
| |
138 |
| - | |
| 138 | + | |
139 | 139 |
| |
140 | 140 |
| |
141 | 141 |
| |
|
Lines changed: 11 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
299 | 299 |
| |
300 | 300 |
| |
301 | 301 |
| |
302 |
| - | |
| 302 | + | |
303 | 303 |
| |
304 | 304 |
| |
305 | 305 |
| |
| |||
308 | 308 |
| |
309 | 309 |
| |
310 | 310 |
| |
311 |
| - | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
312 | 315 |
| |
313 | 316 |
| |
314 | 317 |
| |
| |||
322 | 325 |
| |
323 | 326 |
| |
324 | 327 |
| |
| 328 | + | |
| 329 | + | |
| 330 | + | |
325 | 331 |
| |
326 | 332 |
| |
327 | 333 |
| |
| |||
424 | 430 |
| |
425 | 431 |
| |
426 | 432 |
| |
| 433 | + | |
| 434 | + | |
| 435 | + | |
427 | 436 |
| |
428 | 437 |
| |
429 | 438 |
| |
|
Lines changed: 37 additions & 38 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
13 | 13 |
| |
14 | 14 |
| |
15 | 15 |
| |
| 16 | + | |
16 | 17 |
| |
17 | 18 |
| |
18 | 19 |
| |
| |||
21 | 22 |
| |
22 | 23 |
| |
23 | 24 |
| |
24 |
| - | |
25 | 25 |
| |
26 | 26 |
| |
27 | 27 |
| |
| |||
42 | 42 |
| |
43 | 43 |
| |
44 | 44 |
| |
| 45 | + | |
45 | 46 |
| |
46 | 47 |
| |
47 | 48 |
| |
| |||
60 | 61 |
| |
61 | 62 |
| |
62 | 63 |
| |
| 64 | + | |
| 65 | + | |
63 | 66 |
| |
64 | 67 |
| |
65 | 68 |
| |
66 | 69 |
| |
67 | 70 |
| |
68 | 71 |
| |
69 | 72 |
| |
70 |
| - | |
| 73 | + | |
| 74 | + | |
71 | 75 |
| |
72 | 76 |
| |
73 | 77 |
| |
74 |
| - | |
75 | 78 |
| |
76 | 79 |
| |
77 | 80 |
| |
78 |
| - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
79 | 85 |
| |
80 | 86 |
| |
81 | 87 |
| |
| |||
84 | 90 |
| |
85 | 91 |
| |
86 | 92 |
| |
87 |
| - | |
| 93 | + | |
88 | 94 |
| |
| 95 | + | |
89 | 96 |
| |
90 | 97 |
| |
91 | 98 |
| |
| 99 | + | |
92 | 100 |
| |
93 |
| - | |
94 |
| - | |
95 |
| - | |
96 |
| - | |
97 |
| - | |
98 | 101 |
| |
99 | 102 |
| |
100 |
| - | |
101 |
| - | |
102 | 103 |
| |
103 | 104 |
| |
104 | 105 |
| |
105 | 106 |
| |
106 | 107 |
| |
107 | 108 |
| |
| 109 | + | |
108 | 110 |
| |
109 | 111 |
| |
110 | 112 |
| |
111 | 113 |
| |
112 |
| - | |
113 |
| - | |
| 114 | + | |
| 115 | + | |
114 | 116 |
| |
115 | 117 |
| |
116 |
| - | |
| 118 | + | |
117 | 119 |
| |
118 | 120 |
| |
119 | 121 |
| |
| |||
134 | 136 |
| |
135 | 137 |
| |
136 | 138 |
| |
137 |
| - | |
138 | 139 |
| |
139 | 140 |
| |
140 |
| - | |
141 |
| - | |
142 |
| - | |
143 |
| - | |
144 |
| - | |
145 |
| - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
146 | 148 |
| |
147 |
| - | |
148 |
| - | |
| 149 | + | |
| 150 | + | |
149 | 151 |
| |
150 |
| - | |
151 |
| - | |
152 |
| - | |
153 |
| - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
154 | 156 |
| |
155 |
| - | |
156 |
| - | |
157 |
| - | |
| 157 | + | |
| 158 | + | |
158 | 159 |
| |
159 | 160 |
| |
160 | 161 |
| |
| |||
170 | 171 |
| |
171 | 172 |
| |
172 | 173 |
| |
173 |
| - | |
174 | 174 |
| |
175 | 175 |
| |
176 | 176 |
| |
| |||
183 | 183 |
| |
184 | 184 |
| |
185 | 185 |
| |
186 |
| - | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
187 | 189 |
| |
188 | 190 |
| |
189 | 191 |
| |
| |||
196 | 198 |
| |
197 | 199 |
| |
198 | 200 |
| |
199 |
| - | |
| 201 | + | |
200 | 202 |
| |
201 | 203 |
| |
202 |
| - | |
| 204 | + | |
203 | 205 |
| |
204 | 206 |
| |
205 | 207 |
| |
206 | 208 |
| |
207 |
| - | |
208 | 209 |
| |
209 | 210 |
| |
210 | 211 |
| |
211 | 212 |
| |
212 | 213 |
| |
213 | 214 |
| |
214 |
| - | |
215 |
| - | |
216 | 215 |
| |
217 | 216 |
| |
218 | 217 |
|
0 commit comments
Comments
(0)