forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit2346df6
committed
Allow a no-wait lock acquisition to succeed in more cases.
We don't determine the position at which a process waiting for a lockshould insert itself into the wait queue until we reach ProcSleep(),and we may at that point discover that we must insert ourselves aheadof everyone who wants a conflicting lock, in which case we obtain thelock immediately. Up until now, a no-wait lock acquisition would failin such cases, erroneously claiming that the lock couldn't be obtainedimmediately. Fix that by trying ProcSleep even in the no-wait case.No back-patch for now, because I'm treating this as an improvement tothe existing no-wait feature. It could instead be argued that it's abug fix, on the theory that there should never be any case whatsoeverwhere no-wait fails to obtain a lock that would have been obtainedimmediately without no-wait, but I'm reluctant to interpret thesemantics of no-wait that strictly.Robert Haas and Jingxian LiDiscussion:http://postgr.es/m/CA+TgmobCH-kMXGVpb0BB-iNMdtcNkTvcZ4JBxDJows3kYM+GDg@mail.gmail.com1 parentc20d90a commit2346df6
File tree
6 files changed
+128
-53
lines changed- src
- backend/storage/lmgr
- include/storage
- test/isolation
- expected
- specs
6 files changed
+128
-53
lines changedLines changed: 69 additions & 50 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
360 | 360 |
| |
361 | 361 |
| |
362 | 362 |
| |
363 |
| - | |
| 363 | + | |
| 364 | + | |
364 | 365 |
| |
365 | 366 |
| |
366 | 367 |
| |
| |||
1024 | 1025 |
| |
1025 | 1026 |
| |
1026 | 1027 |
| |
1027 |
| - | |
1028 |
| - | |
1029 |
| - | |
1030 |
| - | |
1031 |
| - | |
1032 |
| - | |
1033 |
| - | |
1034 |
| - | |
1035 |
| - | |
1036 |
| - | |
1037 |
| - | |
1038 |
| - | |
1039 |
| - | |
1040 |
| - | |
1041 |
| - | |
1042 |
| - | |
1043 |
| - | |
1044 |
| - | |
1045 |
| - | |
1046 |
| - | |
1047 |
| - | |
1048 |
| - | |
1049 |
| - | |
1050 |
| - | |
1051 |
| - | |
1052 |
| - | |
1053 |
| - | |
1054 |
| - | |
1055 |
| - | |
1056 |
| - | |
1057 |
| - | |
1058 |
| - | |
1059 |
| - | |
1060 |
| - | |
1061 |
| - | |
1062 |
| - | |
1063 |
| - | |
1064 | 1028 |
| |
1065 | 1029 |
| |
1066 | 1030 |
| |
1067 | 1031 |
| |
1068 | 1032 |
| |
1069 | 1033 |
| |
1070 |
| - | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
1071 | 1037 |
| |
1072 | 1038 |
| |
1073 | 1039 |
| |
| |||
1077 | 1043 |
| |
1078 | 1044 |
| |
1079 | 1045 |
| |
1080 |
| - | |
| 1046 | + | |
1081 | 1047 |
| |
1082 | 1048 |
| |
1083 | 1049 |
| |
| |||
1093 | 1059 |
| |
1094 | 1060 |
| |
1095 | 1061 |
| |
1096 |
| - | |
1097 |
| - | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
1098 | 1065 |
| |
1099 | 1066 |
| |
1100 | 1067 |
| |
1101 | 1068 |
| |
1102 |
| - | |
1103 |
| - | |
1104 |
| - | |
1105 |
| - | |
1106 |
| - | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
1107 | 1119 |
| |
1108 | 1120 |
| |
1109 | 1121 |
| |
| |||
1777 | 1789 |
| |
1778 | 1790 |
| |
1779 | 1791 |
| |
1780 |
| - | |
| 1792 | + | |
| 1793 | + | |
1781 | 1794 |
| |
1782 | 1795 |
| |
1783 |
| - | |
| 1796 | + | |
1784 | 1797 |
| |
1785 | 1798 |
| |
1786 | 1799 |
| |
| |||
1813 | 1826 |
| |
1814 | 1827 |
| |
1815 | 1828 |
| |
1816 |
| - | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
| 1834 | + | |
1817 | 1835 |
| |
| 1836 | + | |
1818 | 1837 |
| |
1819 | 1838 |
| |
1820 | 1839 |
| |
|
Lines changed: 18 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1043 | 1043 |
| |
1044 | 1044 |
| |
1045 | 1045 |
| |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
1046 | 1053 |
| |
1047 | 1054 |
| |
1048 | 1055 |
| |
1049 |
| - | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
1050 | 1059 |
| |
1051 | 1060 |
| |
1052 | 1061 |
| |
1053 | 1062 |
| |
1054 | 1063 |
| |
1055 | 1064 |
| |
1056 | 1065 |
| |
1057 |
| - | |
| 1066 | + | |
1058 | 1067 |
| |
1059 | 1068 |
| |
1060 | 1069 |
| |
| |||
1167 | 1176 |
| |
1168 | 1177 |
| |
1169 | 1178 |
| |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
1170 | 1186 |
| |
1171 | 1187 |
| |
1172 | 1188 |
| |
|
Lines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
471 | 471 |
| |
472 | 472 |
| |
473 | 473 |
| |
474 |
| - | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
475 | 477 |
| |
476 | 478 |
| |
477 | 479 |
| |
|
Lines changed: 9 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + |
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
111 | 111 |
| |
112 | 112 |
| |
113 | 113 |
| |
| 114 | + |
Lines changed: 28 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + |
0 commit comments
Comments
(0)