- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit909b449
committed
Fix concurrency issues with WAL segment recycling on Windows
This commit is mostly a revert ofaaa3aed, that switched the routinedoing the internal renaming of recycled WAL segments to use on Windows acombination of CreateHardLinkA() plus unlink() instead of rename(). Asreported by several users of Postgres 13, this is causing concurrencyissues when manipulating WAL segments, mostly in the shape of thefollowing error:LOG: could not rename file "pg_wal/000000XX000000YY000000ZZ":Permission deniedThis moves back to a logic where a single rename() (well, pgrename() forWindows) is used. This issue has proved to be hard to hit when I testedit, facing it only once with an archive_command that was not able to doits work, so it is environment-sensitive. The reporters of this issuehave been able to confirm that the situation improved once we switchedback to a single rename(). In order to check things, I have provided tothe reporters a patched build based on 13.2 withaaa3aed reverted, totest if the error goes away, and an unpatched build of 13.2 to test ifthe error still showed up (just to make sure that I did not mess up mybuild process).Extra thanks to Fujii Masao for pointing out what looked like theculprit commit, and to all the reporters for taking the time to testwhat I have sent them.Reported-by: Andrus, Guy Burgess, Yaroslav Pashinsky, Thomas TrenzReviewed-by: Tom Lane, Andres FreundDiscussion:https://postgr.es/m/3861ff1e-0923-7838-e826-094cc9bef737@hot.eeDiscussion:https://postgr.es/m/16874-c3eecd319e36a2bf@postgresql.orgDiscussion:https://postgr.es/m/095ccf8d-7f58-d928-427c-b17ace23cae6@burgess.co.nzDiscussion:https://postgr.es/m/16927-67c570d968c99567%40postgresql.orgDiscussion:https://postgr.es/m/YFBcRbnBiPdGZvfW@paquier.xyzBackpatch-through: 131 parent8c6eda2 commit909b449
2 files changed
+25
-4
lines changedLines changed: 18 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
801 | 801 |
| |
802 | 802 |
| |
803 | 803 |
| |
804 |
| - | |
805 |
| - | |
| 804 | + | |
806 | 805 |
| |
807 |
| - | |
808 |
| - | |
| 806 | + | |
| 807 | + | |
809 | 808 |
| |
810 | 809 |
| |
811 | 810 |
| |
812 | 811 |
| |
813 | 812 |
| |
814 | 813 |
| |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
815 | 818 |
| |
816 | 819 |
| |
817 | 820 |
| |
| |||
825 | 828 |
| |
826 | 829 |
| |
827 | 830 |
| |
| 831 | + | |
828 | 832 |
| |
829 | 833 |
| |
830 | 834 |
| |
| |||
834 | 838 |
| |
835 | 839 |
| |
836 | 840 |
| |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
837 | 851 |
| |
838 | 852 |
| |
839 | 853 |
| |
|
Lines changed: 7 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
135 | 135 |
| |
136 | 136 |
| |
137 | 137 |
| |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
138 | 145 |
| |
139 | 146 |
| |
140 | 147 |
| |
|
0 commit comments
Comments
(0)