forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit01261fb
committed
Improve buffer manager API for backend pin limits.
Previously the support functions assumed that the caller needed one pinto make progress, and could optionally use some more, allowing enoughfor every connection to do the same. Add a couple more functions forcallers that want to know:* what the maximum possible number could be, irrespective of currently held pins, for space planning purposes* how many additional pins they could acquire right now, without the special case allowing one pin, for callers that already hold pins and could already make progress even if no extra pins are availableThe pin limit logic began in commit31966b1. This refactoring isbetter suited to read_stream.c, which will be adjusted to respect theremaining limit as it changes over time in a follow-up commit. It alsocomputes MaxProportionalPins up front, to avoid performing divisionswhenever a caller needs to check the balance.Reviewed-by: Andres Freund <andres@anarazel.de> (earlier versions)Discussion:https://postgr.es/m/CA%2BhUKGK_%3D4CVmMHvsHjOVrK6t4F%3DLBpFzsrr3R%2BaJYN8kcTfWg%40mail.gmail.com1 parent7c99dc5 commit01261fb
File tree
3 files changed
+75
-25
lines changed- src
- backend/storage/buffer
- include/storage
3 files changed
+75
-25
lines changedLines changed: 55 additions & 25 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
211 | 211 |
| |
212 | 212 |
| |
213 | 213 |
| |
| 214 | + | |
| 215 | + | |
214 | 216 |
| |
215 | 217 |
| |
216 | 218 |
| |
| |||
2097 | 2099 |
| |
2098 | 2100 |
| |
2099 | 2101 |
| |
| 2102 | + | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
| 2108 | + | |
| 2109 | + | |
| 2110 | + | |
| 2111 | + | |
| 2112 | + | |
| 2113 | + | |
| 2114 | + | |
| 2115 | + | |
| 2116 | + | |
| 2117 | + | |
| 2118 | + | |
| 2119 | + | |
| 2120 | + | |
| 2121 | + | |
| 2122 | + | |
| 2123 | + | |
| 2124 | + | |
| 2125 | + | |
| 2126 | + | |
| 2127 | + | |
| 2128 | + | |
| 2129 | + | |
| 2130 | + | |
| 2131 | + | |
| 2132 | + | |
| 2133 | + | |
| 2134 | + | |
| 2135 | + | |
| 2136 | + | |
| 2137 | + | |
| 2138 | + | |
2100 | 2139 |
| |
2101 | 2140 |
| |
2102 | 2141 |
| |
2103 | 2142 |
| |
2104 |
| - | |
2105 |
| - | |
2106 |
| - | |
2107 |
| - | |
2108 |
| - | |
2109 |
| - | |
2110 |
| - | |
| 2143 | + | |
| 2144 | + | |
2111 | 2145 |
| |
2112 | 2146 |
| |
2113 | 2147 |
| |
2114 | 2148 |
| |
2115 |
| - | |
2116 |
| - | |
| 2149 | + | |
2117 | 2150 |
| |
2118 | 2151 |
| |
2119 | 2152 |
| |
2120 | 2153 |
| |
2121 |
| - | |
2122 |
| - | |
2123 |
| - | |
2124 |
| - | |
2125 |
| - | |
2126 |
| - | |
2127 |
| - | |
2128 |
| - | |
2129 |
| - | |
2130 |
| - | |
2131 |
| - | |
2132 |
| - | |
2133 |
| - | |
2134 |
| - | |
2135 |
| - | |
2136 |
| - | |
| 2154 | + | |
| 2155 | + | |
| 2156 | + | |
| 2157 | + | |
2137 | 2158 |
| |
2138 | 2159 |
| |
2139 | 2160 |
| |
| |||
3575 | 3596 |
| |
3576 | 3597 |
| |
3577 | 3598 |
| |
| 3599 | + | |
| 3600 | + | |
| 3601 | + | |
| 3602 | + | |
| 3603 | + | |
| 3604 | + | |
| 3605 | + | |
| 3606 | + | |
| 3607 | + | |
3578 | 3608 |
| |
3579 | 3609 |
| |
3580 | 3610 |
| |
|
Lines changed: 16 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
286 | 286 |
| |
287 | 287 |
| |
288 | 288 |
| |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
289 | 305 |
| |
290 | 306 |
| |
291 | 307 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
290 | 290 |
| |
291 | 291 |
| |
292 | 292 |
| |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
293 | 297 |
| |
294 | 298 |
| |
295 | 299 |
| |
|
0 commit comments
Comments
(0)