forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit894af78
committed
Don't rely on estimates for amcheck Bloom filters.
Solely relying on a relation's reltuples/relpages estimate to size theBloom filters used by amcheck verification makes verification lesseffective when the estimates are very stale. In extreme cases,verification options that use Bloom filters internally could be totallyineffective, without users receiving any clear indication that certaintypes of corruption might easily be missed.To fix, use RelationGetNumberOfBlocks() instead of relpages to size thedownlink block Bloom filter. Use the same RelationGetNumberOfBlocks()value to derive a minimum size for the heapallindexed Bloom filter,rather than completely trusting reltuples. Verification will still bereasonably effective when the projected/estimated number of Bloom filterelements is at least 1/5 of the final number of elements, which isassured by the new sizing logic.Reported-By: Alexander KorotkovDiscussion:https://postgr.es/m/CAH2-Wzk0ke2J42KrNYBKu0Xovjy-sU5ub7PWjgpbsKdAQcL4OA@mail.gmail.comBackpatch: 11-, where downlink/heapallindexed verification were added.1 parenta63378a commit894af78
1 file changed
+11
-5
lines changedLines changed: 11 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
377 | 377 |
| |
378 | 378 |
| |
379 | 379 |
| |
| 380 | + | |
380 | 381 |
| |
381 | 382 |
| |
382 | 383 |
| |
383 |
| - | |
384 |
| - | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
385 | 394 |
| |
386 | 395 |
| |
387 | 396 |
| |
| |||
425 | 434 |
| |
426 | 435 |
| |
427 | 436 |
| |
428 |
| - | |
429 |
| - | |
430 | 437 |
| |
431 | 438 |
| |
432 | 439 |
| |
| |||
437 | 444 |
| |
438 | 445 |
| |
439 | 446 |
| |
440 |
| - | |
441 | 447 |
| |
442 | 448 |
| |
443 | 449 |
| |
|
0 commit comments
Comments
(0)