forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitc780a7a
committed
Add CheckBuffer() to check on-disk pages without shared buffer loading
CheckBuffer() is designed to be a concurrent-safe function able to runsanity checks on a relation page without loading it into the sharedbuffers. The operation is done using a lock on the partition involvedin the shared buffer mapping hashtable and an I/O lock for the bufferitself, preventing the risk of false positives due to any concurrentactivity.The primary use of this function is the detection of on-disk corruptionsfor relation pages. If a page is found in shared buffers, the on-diskpage is checked if not dirty (a follow-up checkpoint would flush a validversion of the page if dirty anyway), as it could be possible that apage was present for a long time in shared buffers with its on-diskversion corrupted. Such a scenario could lead to a corrupted cluster ifa host is plugged off for example. If the page is not found in sharedbuffers, its on-disk state is checked. PageIsVerifiedExtended() is usedto apply the same sanity checks as when a page gets loaded into sharedbuffers.This function will be used by an upcoming patch able to check the stateof on-disk relation pages using a SQL function.Author: Julien Rouhaud, Michael PaquierReviewed-by: Masahiko SawadaDiscussion:https://postgr.es/m/CAOBaU_aVvMjQn=ge5qPiJOPMmOj5=ii3st5Q0Y+WuLML5sR17w@mail.gmail.com1 parent9e0f87a commitc780a7a
2 files changed
+95
-0
lines changedLines changed: 92 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4585 | 4585 |
| |
4586 | 4586 |
| |
4587 | 4587 |
| |
| 4588 | + | |
| 4589 | + | |
| 4590 | + | |
| 4591 | + | |
| 4592 | + | |
| 4593 | + | |
| 4594 | + | |
| 4595 | + | |
| 4596 | + | |
| 4597 | + | |
| 4598 | + | |
| 4599 | + | |
| 4600 | + | |
| 4601 | + | |
| 4602 | + | |
| 4603 | + | |
| 4604 | + | |
| 4605 | + | |
| 4606 | + | |
| 4607 | + | |
| 4608 | + | |
| 4609 | + | |
| 4610 | + | |
| 4611 | + | |
| 4612 | + | |
| 4613 | + | |
| 4614 | + | |
| 4615 | + | |
| 4616 | + | |
| 4617 | + | |
| 4618 | + | |
| 4619 | + | |
| 4620 | + | |
| 4621 | + | |
| 4622 | + | |
| 4623 | + | |
| 4624 | + | |
| 4625 | + | |
| 4626 | + | |
| 4627 | + | |
| 4628 | + | |
| 4629 | + | |
| 4630 | + | |
| 4631 | + | |
| 4632 | + | |
| 4633 | + | |
| 4634 | + | |
| 4635 | + | |
| 4636 | + | |
| 4637 | + | |
| 4638 | + | |
| 4639 | + | |
| 4640 | + | |
| 4641 | + | |
| 4642 | + | |
| 4643 | + | |
| 4644 | + | |
| 4645 | + | |
| 4646 | + | |
| 4647 | + | |
| 4648 | + | |
| 4649 | + | |
| 4650 | + | |
| 4651 | + | |
| 4652 | + | |
| 4653 | + | |
| 4654 | + | |
| 4655 | + | |
| 4656 | + | |
| 4657 | + | |
| 4658 | + | |
| 4659 | + | |
| 4660 | + | |
| 4661 | + | |
| 4662 | + | |
| 4663 | + | |
| 4664 | + | |
| 4665 | + | |
| 4666 | + | |
| 4667 | + | |
| 4668 | + | |
| 4669 | + | |
| 4670 | + | |
| 4671 | + | |
| 4672 | + | |
| 4673 | + | |
| 4674 | + | |
| 4675 | + | |
| 4676 | + | |
| 4677 | + | |
| 4678 | + | |
| 4679 | + |
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
240 | 240 |
| |
241 | 241 |
| |
242 | 242 |
| |
| 243 | + | |
| 244 | + | |
| 245 | + | |
243 | 246 |
| |
244 | 247 |
| |
245 | 248 |
| |
|
0 commit comments
Comments
(0)