forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit2d8f56d
committed
Rethink create and attach APIs of shared TidStore.
Previously, the behavior of TidStoreCreate() was inconsistent betweenlocal and shared TidStore instances in terms of memory limitation. Forlocal TidStore, a memory context was created with initial and maximummemory block sizes, as well as a minimum memory context size, based onthe specified max_bytes values. However, for shared TidStore, theprovided DSA area was used for TID storage. Although commitbb952c8allowed specifying the initial and maximum DSA segment sizes, callerswould have needed to clamp their own limits, which was not consistentand user-friendly.With this commit, when creating a shared TidStore, a dedicated DSAarea is created for TID storage instead of using a provided DSAarea. The initial and maximum DSA segment sizes are chosen based onthe specified max_bytes. Other processes can attach to the sharedTidStore using the handle of the created DSA returned by the newTidStoreGetDSA() function and the DSA pointer returned byTidStoreGetHandle(). The created DSA has the same lifetime as theshared TidStore and is deleted when all processes detach from it.To improve clarity, the TidStoreCreate() function has been dividedinto two separate functions: TidStoreCreateLocal() andTidStoreCreateShared().Reviewed-by: John NaylorDiscussion:https://postgr.es/m/CAD21AoAyc1j%3DBCdUqZfk6qbdjZ68UgRx1Gkpk0oah4K7S0Ri9g%40mail.gmail.com1 parentd1cf531 commit2d8f56d
File tree
3 files changed
+89
-39
lines changed- src
- backend/access/common
- include/access
- test/modules/test_tidstore
3 files changed
+89
-39
lines changedLines changed: 82 additions & 25 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
10 |
| - | |
11 |
| - | |
12 |
| - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
13 | 13 |
| |
14 | 14 |
| |
15 | 15 |
| |
| |||
111 | 111 |
| |
112 | 112 |
| |
113 | 113 |
| |
114 |
| - | |
115 |
| - | |
116 |
| - | |
117 |
| - | |
| 114 | + | |
118 | 115 |
| |
119 |
| - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
120 | 121 |
| |
121 | 122 |
| |
122 |
| - | |
| 123 | + | |
123 | 124 |
| |
124 | 125 |
| |
125 | 126 |
| |
| |||
143 | 144 |
| |
144 | 145 |
| |
145 | 146 |
| |
146 |
| - | |
147 |
| - | |
148 |
| - | |
149 |
| - | |
150 |
| - | |
151 |
| - | |
152 |
| - | |
153 |
| - | |
| 147 | + | |
154 | 148 |
| |
155 | 149 |
| |
156 | 150 |
| |
157 | 151 |
| |
158 | 152 |
| |
159 |
| - | |
160 |
| - | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
161 | 158 |
| |
162 | 159 |
| |
163 |
| - | |
| 160 | + | |
164 | 161 |
| |
165 | 162 |
| |
| 163 | + | |
| 164 | + | |
| 165 | + | |
166 | 166 |
| |
167 |
| - | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
168 | 208 |
| |
169 | 209 |
| |
170 | 210 |
| |
171 | 211 |
| |
172 | 212 |
| |
| 213 | + | |
| 214 | + | |
173 | 215 |
| |
174 | 216 |
| |
175 | 217 |
| |
| |||
178 | 220 |
| |
179 | 221 |
| |
180 | 222 |
| |
181 |
| - | |
182 |
| - | |
183 |
| - | |
184 |
| - | |
| 223 | + | |
| 224 | + | |
185 | 225 |
| |
186 | 226 |
| |
187 | 227 |
| |
188 | 228 |
| |
189 | 229 |
| |
190 | 230 |
| |
191 | 231 |
| |
| 232 | + | |
| 233 | + | |
192 | 234 |
| |
193 | 235 |
| |
194 | 236 |
| |
| |||
234 | 276 |
| |
235 | 277 |
| |
236 | 278 |
| |
| 279 | + | |
237 | 280 |
| |
| 281 | + | |
| 282 | + | |
| 283 | + | |
238 | 284 |
| |
239 | 285 |
| |
240 | 286 |
| |
| |||
420 | 466 |
| |
421 | 467 |
| |
422 | 468 |
| |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
423 | 480 |
| |
424 | 481 |
| |
425 | 482 |
| |
|
Lines changed: 4 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
29 | 29 |
| |
30 | 30 |
| |
31 | 31 |
| |
32 |
| - | |
33 |
| - | |
34 |
| - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
35 | 35 |
| |
36 | 36 |
| |
37 | 37 |
| |
| |||
45 | 45 |
| |
46 | 46 |
| |
47 | 47 |
| |
| 48 | + | |
48 | 49 |
| |
49 | 50 |
|
Lines changed: 3 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
34 | 34 |
| |
35 | 35 |
| |
36 | 36 |
| |
37 |
| - | |
38 | 37 |
| |
39 | 38 |
| |
40 | 39 |
| |
| |||
94 | 93 |
| |
95 | 94 |
| |
96 | 95 |
| |
97 |
| - | |
98 | 96 |
| |
99 | 97 |
| |
100 | 98 |
| |
| |||
109 | 107 |
| |
110 | 108 |
| |
111 | 109 |
| |
112 |
| - | |
| 110 | + | |
113 | 111 |
| |
114 | 112 |
| |
115 | 113 |
| |
116 | 114 |
| |
117 | 115 |
| |
118 |
| - | |
119 |
| - | |
120 |
| - | |
| 116 | + | |
121 | 117 |
| |
122 | 118 |
| |
123 |
| - | |
| 119 | + | |
124 | 120 |
| |
125 | 121 |
| |
126 | 122 |
| |
| |||
309 | 305 |
| |
310 | 306 |
| |
311 | 307 |
| |
312 |
| - | |
313 |
| - | |
314 |
| - | |
315 |
| - | |
316 | 308 |
| |
317 | 309 |
|
0 commit comments
Comments
(0)