forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commite656657
committed
Fix RBM_ZERO_AND_LOCK.
Commit210622c accidentally zeroed out pages even if they were found inthe buffer pool. It should always lock the page, but it should onlyzero pages that were not already valid. Otherwise, concurrent readersthat hold only a pin could see corrupted page contents changing undertheir feet.While here, rename ZeroAndLockBuffer() to match the RBM_ flag name.Also restore a some useful comments lost by210622c's refactoring, andadd some new ones to clarify why we need to use the BM_IO_IN_PROGRESSinfrastructure despite not doing I/O.Reported-by: Noah Misch <noah@leadboat.com>Reported-by: Alexander Lakhin <exclusion@gmail.com>Reviewed-by: Alvaro Herrera <alvherre@alvh.no-ip.org> (earlier version)Reviewed-by: Robert Haas <robertmhaas@gmail.com> (earlier version)Discussion:https://postgr.es/m/20240512171658.7e.nmisch@google.comDiscussion:https://postgr.es/m/7ed10231-ce47-03d5-d3f9-4aea0dc7d5a4%40gmail.com1 parent00ac25a commite656657
1 file changed
+67
-21
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1010 | 1010 |
| |
1011 | 1011 |
| |
1012 | 1012 |
| |
1013 |
| - | |
| 1013 | + | |
1014 | 1014 |
| |
1015 |
| - | |
1016 |
| - | |
| 1015 | + | |
1017 | 1016 |
| |
1018 | 1017 |
| |
1019 |
| - | |
| 1018 | + | |
1020 | 1019 |
| |
1021 | 1020 |
| |
1022 |
| - | |
| 1021 | + | |
| 1022 | + | |
1023 | 1023 |
| |
1024 | 1024 |
| |
1025 | 1025 |
| |
1026 |
| - | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
1027 | 1037 |
| |
| 1038 | + | |
| 1039 | + | |
1028 | 1040 |
| |
1029 | 1041 |
| |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
1030 | 1050 |
| |
1031 |
| - | |
1032 |
| - | |
1033 |
| - | |
1034 |
| - | |
| 1051 | + | |
1035 | 1052 |
| |
1036 | 1053 |
| |
1037 |
| - | |
1038 |
| - | |
1039 |
| - | |
| 1054 | + | |
1040 | 1055 |
| |
1041 |
| - | |
1042 |
| - | |
1043 |
| - | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
1044 | 1085 |
| |
1045 |
| - | |
| 1086 | + | |
1046 | 1087 |
| |
1047 |
| - | |
1048 |
| - | |
1049 |
| - | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
1050 | 1096 |
| |
1051 | 1097 |
| |
1052 | 1098 |
| |
| |||
1185 | 1231 |
| |
1186 | 1232 |
| |
1187 | 1233 |
| |
1188 |
| - | |
| 1234 | + | |
1189 | 1235 |
| |
1190 | 1236 |
| |
1191 | 1237 |
| |
|
0 commit comments
Comments
(0)