- Notifications
You must be signed in to change notification settings - Fork5.2k
Commit5449d5b
committed
Fix infinite wait when reading a partially written WAL record
If a crash occurs while writing a WAL record that spans multiple pages, therecovery process marks the page with the XLP_FIRST_IS_OVERWRITE_CONTRECORDflag. However, logical decoding currently attempts to read the full WALrecord based on its expected size before checking this flag, which can leadto an infinite wait if the remaining data is never written (e.g., no activityafter crash).This patch updates the logic first to read the page header and check forthe XLP_FIRST_IS_OVERWRITE_CONTRECORD flag before attempting to reconstructthe full WAL record. If the flag is set, decoding correctly identifiesthe record as incomplete and avoids waiting for WAL data that will neverarrive.Discussion:https://postgr.es/m/CAAKRu_ZCOzQpEumLFgG_%2Biw3FTa%2BhJ4SRpxzaQBYxxM_ZAzWcA%40mail.gmail.comDiscussion:https://postgr.es/m/CALDaNm34m36PDHzsU_GdcNXU0gLTfFY5rzh9GSQv%3Dw6B%2BQVNRQ%40mail.gmail.comAuthor: Vignesh C <vignesh21@gmail.com>Reviewed-by: Hayato Kuroda <kuroda.hayato@fujitsu.com>Reviewed-by: Dilip Kumar <dilipbalaut@gmail.com>Reviewed-by: Michael Paquier <michael@paquier.xyz>Reviewed-by: Alexander Korotkov <aekorotkov@gmail.com>Backpatch-through: 131 parent27c7c11 commit5449d5b
1 file changed
+15
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
723 | 723 | | |
724 | 724 | | |
725 | 725 | | |
726 | | - | |
727 | | - | |
728 | | - | |
729 | | - | |
730 | | - | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
731 | 732 | | |
732 | 733 | | |
733 | 734 | | |
| |||
776 | 777 | | |
777 | 778 | | |
778 | 779 | | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
779 | 789 | | |
780 | 790 | | |
781 | 791 | | |
| |||
0 commit comments
Comments
(0)