- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit2fc7af5
committed
Add basic infrastructure for 64 bit transaction IDs.
Instead of inferring epoch progress from xids and checkpoints,introduce a 64 bit FullTransactionId type and use it to track xidgeneration. This fixes an unlikely bug where the epoch is reportedincorrectly if the range of active xids wraps around more than oncebetween checkpoints.The only user-visible effect of this commit is to correct the epochused by txid_current() and txid_status(), also visible withpg_controldata, in those rare circumstances. It also creates somebasic infrastructure so that later patches can use 64 bittransaction IDs in more places.The new type is a struct that we pass by value, as a form of strongtypedef. This prevents the sort of accidental confusion betweenTransactionId and FullTransactionId that would be possible if wewere to use a plain old uint64.Author: Thomas MunroReported-by: Amit KapilaReviewed-by: Andres Freund, Tom Lane, Heikki LinnakangasDiscussion:https://postgr.es/m/CAA4eK1%2BMv%2Bmb0HFfWM9Srtc6MVe160WFurXV68iAFMcagRZ0dQ%40mail.gmail.com1 parent2a96909 commit2fc7af5
File tree
24 files changed
+224
-238
lines changed- src
- backend
- access
- rmgrdesc
- transam
- replication
- storage
- ipc
- lmgr
- utils
- adt
- misc
- bin
- pg_controldata
- pg_resetwal
- include
- access
- catalog
- storage
- tools/pgindent
24 files changed
+224
-238
lines changedLines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
| 17 | + | |
17 | 18 |
| |
18 | 19 |
| |
19 | 20 |
| |
| |||
52 | 53 |
| |
53 | 54 |
| |
54 | 55 |
| |
55 |
| - | |
| 56 | + | |
| 57 | + | |
56 | 58 |
| |
57 | 59 |
| |
58 | 60 |
| |
|
Lines changed: 4 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
749 | 749 |
| |
750 | 750 |
| |
751 | 751 |
| |
752 |
| - | |
| 752 | + | |
753 | 753 |
| |
754 | 754 |
| |
755 | 755 |
| |
756 | 756 |
| |
757 |
| - | |
| 757 | + | |
758 | 758 |
| |
759 | 759 |
| |
760 | 760 |
| |
| |||
773 | 773 |
| |
774 | 774 |
| |
775 | 775 |
| |
776 |
| - | |
| 776 | + | |
777 | 777 |
| |
778 | 778 |
| |
779 | 779 |
| |
| |||
792 | 792 |
| |
793 | 793 |
| |
794 | 794 |
| |
795 |
| - | |
| 795 | + | |
796 | 796 |
| |
797 | 797 |
| |
798 | 798 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
553 | 553 |
| |
554 | 554 |
| |
555 | 555 |
| |
556 |
| - | |
| 556 | + | |
557 | 557 |
| |
558 | 558 |
| |
559 | 559 |
| |
| |||
643 | 643 |
| |
644 | 644 |
| |
645 | 645 |
| |
646 |
| - | |
| 646 | + | |
647 | 647 |
| |
648 | 648 |
| |
649 | 649 |
| |
|
Lines changed: 4 additions & 16 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3267 | 3267 |
| |
3268 | 3268 |
| |
3269 | 3269 |
| |
3270 |
| - | |
3271 |
| - | |
3272 |
| - | |
| 3270 | + | |
| 3271 | + | |
| 3272 | + | |
3273 | 3273 |
| |
3274 | 3274 |
| |
3275 | 3275 |
| |
| |||
3278 | 3278 |
| |
3279 | 3279 |
| |
3280 | 3280 |
| |
3281 |
| - | |
3282 |
| - | |
3283 |
| - | |
3284 |
| - | |
3285 |
| - | |
3286 |
| - | |
3287 |
| - | |
3288 |
| - | |
3289 |
| - | |
3290 |
| - | |
3291 |
| - | |
3292 |
| - | |
3293 |
| - | |
| 3281 | + | |
3294 | 3282 |
| |
3295 | 3283 |
| |
3296 | 3284 |
| |
|
Lines changed: 5 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
241 | 241 |
| |
242 | 242 |
| |
243 | 243 |
| |
244 |
| - | |
| 244 | + | |
245 | 245 |
| |
246 |
| - | |
| 246 | + | |
247 | 247 |
| |
248 | 248 |
| |
249 | 249 |
| |
250 | 250 |
| |
251 | 251 |
| |
| 252 | + | |
252 | 253 |
| |
253 | 254 |
| |
254 | 255 |
| |
| |||
261 | 262 |
| |
262 | 263 |
| |
263 | 264 |
| |
264 |
| - | |
| 265 | + | |
| 266 | + | |
265 | 267 |
| |
266 | 268 |
| |
267 | 269 |
| |
|
Lines changed: 13 additions & 27 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1878 | 1878 |
| |
1879 | 1879 |
| |
1880 | 1880 |
| |
1881 |
| - | |
| 1881 | + | |
1882 | 1882 |
| |
1883 | 1883 |
| |
1884 |
| - | |
| 1884 | + | |
1885 | 1885 |
| |
1886 | 1886 |
| |
1887 | 1887 |
| |
1888 | 1888 |
| |
1889 | 1889 |
| |
1890 |
| - | |
| 1890 | + | |
1891 | 1891 |
| |
1892 | 1892 |
| |
1893 | 1893 |
| |
| |||
1897 | 1897 |
| |
1898 | 1898 |
| |
1899 | 1899 |
| |
1900 |
| - | |
| 1900 | + | |
1901 | 1901 |
| |
1902 | 1902 |
| |
1903 | 1903 |
| |
| |||
1907 | 1907 |
| |
1908 | 1908 |
| |
1909 | 1909 |
| |
1910 |
| - | |
| 1910 | + | |
| 1911 | + | |
1911 | 1912 |
| |
1912 | 1913 |
| |
1913 | 1914 |
| |
| |||
2123 | 2124 |
| |
2124 | 2125 |
| |
2125 | 2126 |
| |
2126 |
| - | |
| 2127 | + | |
2127 | 2128 |
| |
2128 | 2129 |
| |
2129 | 2130 |
| |
| |||
2132 | 2133 |
| |
2133 | 2134 |
| |
2134 | 2135 |
| |
2135 |
| - | |
| 2136 | + | |
| 2137 | + | |
2136 | 2138 |
| |
2137 | 2139 |
| |
2138 | 2140 |
| |
| |||
2212 | 2214 |
| |
2213 | 2215 |
| |
2214 | 2216 |
| |
2215 |
| - | |
| 2217 | + | |
2216 | 2218 |
| |
2217 | 2219 |
| |
2218 | 2220 |
| |
| |||
2223 | 2225 |
| |
2224 | 2226 |
| |
2225 | 2227 |
| |
2226 |
| - | |
2227 |
| - | |
2228 |
| - | |
2229 |
| - | |
2230 |
| - | |
2231 |
| - | |
2232 |
| - | |
2233 |
| - | |
2234 |
| - | |
2235 |
| - | |
2236 |
| - | |
2237 |
| - | |
2238 |
| - | |
2239 |
| - | |
2240 |
| - | |
2241 |
| - | |
2242 |
| - | |
2243 |
| - | |
2244 |
| - | |
| 2228 | + | |
| 2229 | + | |
| 2230 | + | |
2245 | 2231 |
| |
2246 | 2232 |
| |
2247 | 2233 |
| |
|
Lines changed: 61 additions & 15 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
73 | 73 |
| |
74 | 74 |
| |
75 | 75 |
| |
76 |
| - | |
| 76 | + | |
77 | 77 |
| |
78 | 78 |
| |
79 | 79 |
| |
| |||
156 | 156 |
| |
157 | 157 |
| |
158 | 158 |
| |
159 |
| - | |
| 159 | + | |
160 | 160 |
| |
161 | 161 |
| |
162 | 162 |
| |
| |||
173 | 173 |
| |
174 | 174 |
| |
175 | 175 |
| |
176 |
| - | |
177 |
| - | |
178 |
| - | |
179 |
| - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
180 | 180 |
| |
181 |
| - | |
| 181 | + | |
182 | 182 |
| |
183 | 183 |
| |
184 | 184 |
| |
| |||
236 | 236 |
| |
237 | 237 |
| |
238 | 238 |
| |
239 |
| - | |
| 239 | + | |
240 | 240 |
| |
241 |
| - | |
242 |
| - | |
| 241 | + | |
| 242 | + | |
243 | 243 |
| |
244 |
| - | |
| 244 | + | |
245 | 245 |
| |
246 | 246 |
| |
247 |
| - | |
| 247 | + | |
248 | 248 |
| |
249 | 249 |
| |
250 |
| - | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
251 | 297 |
| |
252 | 298 |
| |
253 | 299 |
| |
| |||
351 | 397 |
| |
352 | 398 |
| |
353 | 399 |
| |
354 |
| - | |
| 400 | + | |
355 | 401 |
| |
356 | 402 |
| |
357 | 403 |
| |
| |||
427 | 473 |
| |
428 | 474 |
| |
429 | 475 |
| |
430 |
| - | |
| 476 | + | |
431 | 477 |
| |
432 | 478 |
| |
433 | 479 |
| |
|
0 commit comments
Comments
(0)