forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit9b013dc
committed
Improve performance of replay of AccessExclusiveLocks
A hot standby replica keeps a list of Access Exclusive locks for a toplevel transaction. These locks are released when the top level transactionends. Searching of this list is O(N^2), and each transaction had to pay theprice of searching this list for locks, even if it didn't take any AElocks itself.This patch optimizes this case by having the master server track whichtransactions took AE locks, and passes that along to the standby server inthe commit/abort record. This allows the standby to only try to releaselocks for transactions which actually took any, avoiding the majority ofthe performance issue.Refactor MyXactAccessedTempRel into MyXactFlags to allow minimal additionalcruft with this.Analysis and initial patch by David RowleyAuthor: David Rowley and Simon Riggs1 parent1148e22 commit9b013dc
File tree
6 files changed
+59
-20
lines changed- src
- backend
- access
- heap
- transam
- commands
- storage/ipc
- include/access
6 files changed
+59
-20
lines changedLines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1132 | 1132 |
| |
1133 | 1133 |
| |
1134 | 1134 |
| |
1135 |
| - | |
| 1135 | + | |
1136 | 1136 |
| |
1137 | 1137 |
| |
1138 | 1138 |
| |
| |||
1178 | 1178 |
| |
1179 | 1179 |
| |
1180 | 1180 |
| |
1181 |
| - | |
| 1181 | + | |
1182 | 1182 |
| |
1183 | 1183 |
| |
1184 | 1184 |
| |
|
Lines changed: 10 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2065 | 2065 |
| |
2066 | 2066 |
| |
2067 | 2067 |
| |
2068 |
| - | |
| 2068 | + | |
| 2069 | + | |
| 2070 | + | |
| 2071 | + | |
2069 | 2072 |
| |
2070 | 2073 |
| |
2071 | 2074 |
| |
2072 | 2075 |
| |
| 2076 | + | |
2073 | 2077 |
| |
2074 | 2078 |
| |
2075 | 2079 |
| |
| |||
2146 | 2150 |
| |
2147 | 2151 |
| |
2148 | 2152 |
| |
2149 |
| - | |
| 2153 | + | |
| 2154 | + | |
| 2155 | + | |
| 2156 | + | |
2150 | 2157 |
| |
2151 | 2158 |
| |
2152 | 2159 |
| |
| 2160 | + | |
2153 | 2161 |
| |
2154 | 2162 |
| |
2155 | 2163 |
| |
|
Lines changed: 21 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
109 | 109 |
| |
110 | 110 |
| |
111 | 111 |
| |
112 |
| - | |
113 |
| - | |
114 |
| - | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
115 | 117 |
| |
116 |
| - | |
117 |
| - | |
| 118 | + | |
118 | 119 |
| |
119 | 120 |
| |
120 | 121 |
| |
| |||
1231 | 1232 |
| |
1232 | 1233 |
| |
1233 | 1234 |
| |
| 1235 | + | |
1234 | 1236 |
| |
1235 | 1237 |
| |
1236 | 1238 |
| |
| |||
1583 | 1585 |
| |
1584 | 1586 |
| |
1585 | 1587 |
| |
1586 |
| - | |
| 1588 | + | |
1587 | 1589 |
| |
1588 | 1590 |
| |
1589 | 1591 |
| |
| |||
1845 | 1847 |
| |
1846 | 1848 |
| |
1847 | 1849 |
| |
1848 |
| - | |
| 1850 | + | |
1849 | 1851 |
| |
1850 | 1852 |
| |
1851 | 1853 |
| |
| |||
2260 | 2262 |
| |
2261 | 2263 |
| |
2262 | 2264 |
| |
2263 |
| - | |
| 2265 | + | |
2264 | 2266 |
| |
2265 | 2267 |
| |
2266 | 2268 |
| |
| |||
5108 | 5110 |
| |
5109 | 5111 |
| |
5110 | 5112 |
| |
5111 |
| - | |
| 5113 | + | |
5112 | 5114 |
| |
5113 | 5115 |
| |
5114 | 5116 |
| |
| |||
5139 | 5141 |
| |
5140 | 5142 |
| |
5141 | 5143 |
| |
| 5144 | + | |
| 5145 | + | |
5142 | 5146 |
| |
5143 | 5147 |
| |
5144 | 5148 |
| |
| |||
5251 | 5255 |
| |
5252 | 5256 |
| |
5253 | 5257 |
| |
5254 |
| - | |
| 5258 | + | |
5255 | 5259 |
| |
5256 | 5260 |
| |
5257 | 5261 |
| |
| |||
5276 | 5280 |
| |
5277 | 5281 |
| |
5278 | 5282 |
| |
| 5283 | + | |
| 5284 | + | |
| 5285 | + | |
5279 | 5286 |
| |
5280 | 5287 |
| |
5281 | 5288 |
| |
| |||
5427 | 5434 |
| |
5428 | 5435 |
| |
5429 | 5436 |
| |
5430 |
| - | |
| 5437 | + | |
| 5438 | + | |
5431 | 5439 |
| |
5432 | 5440 |
| |
5433 | 5441 |
| |
| |||
5563 | 5571 |
| |
5564 | 5572 |
| |
5565 | 5573 |
| |
5566 |
| - | |
| 5574 | + | |
| 5575 | + | |
5567 | 5576 |
| |
5568 | 5577 |
| |
5569 | 5578 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
12471 | 12471 |
| |
12472 | 12472 |
| |
12473 | 12473 |
| |
12474 |
| - | |
| 12474 | + | |
12475 | 12475 |
| |
12476 | 12476 |
| |
12477 | 12477 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1063 | 1063 |
| |
1064 | 1064 |
| |
1065 | 1065 |
| |
| 1066 | + | |
1066 | 1067 |
| |
1067 | 1068 |
| |
1068 | 1069 |
| |
|
Lines changed: 24 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
71 | 71 |
| |
72 | 72 |
| |
73 | 73 |
| |
74 |
| - | |
75 |
| - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
76 | 95 |
| |
77 | 96 |
| |
78 | 97 |
| |
| |||
137 | 156 |
| |
138 | 157 |
| |
139 | 158 |
| |
| 159 | + | |
140 | 160 |
| |
141 | 161 |
| |
142 | 162 |
| |
| |||
364 | 384 |
| |
365 | 385 |
| |
366 | 386 |
| |
| 387 | + | |
367 | 388 |
| |
368 | 389 |
| |
369 | 390 |
| |
370 | 391 |
| |
371 | 392 |
| |
372 |
| - | |
| 393 | + | |
373 | 394 |
| |
374 | 395 |
| |
375 | 396 |
| |
|
0 commit comments
Comments
(0)