Commit 07ee62c
committed
Propagate xactStartTimestamp and stmtStartTimestamp to parallel workers.
Previously, a worker process would establish values for these based on
its own start time. In v10 and up, this can trivially be shown to cause
misbehavior of transaction_timestamp(), timestamp_in(), and related
functions which are (perhaps unwisely?) marked parallel-safe. It seems
likely that other behaviors might diverge from what happens in the parent
as well.
It's not as trivial to demonstrate problems in 9.6 or 9.5, but I'm sure
it's still possible, so back-patch to all branches containing parallel
worker infrastructure.
In HEAD only, mark now() and statement_timestamp() as parallel-safe
(other affected functions already were). While in theory we could
still squeeze that change into v11, it doesn't seem important enough
to force a last-minute catversion bump.
Konstantin Knizhnik, whacked around a bit by me
Discussion: https://postgr.es/m/6406dbd2-5d37-4cb6-6eb2-9c44172c7e7c@postgrespro.ru1 parent e954a72 commit 07ee62c
File tree
5 files changed
+52
-10
lines changed- src
- backend/access/transam
- include
- access
- catalog
5 files changed
+52
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| 90 | + | |
| 91 | + | |
90 | 92 | | |
91 | 93 | | |
92 | 94 | | |
| |||
318 | 320 | | |
319 | 321 | | |
320 | 322 | | |
| 323 | + | |
| 324 | + | |
321 | 325 | | |
322 | 326 | | |
323 | 327 | | |
| |||
1311 | 1315 | | |
1312 | 1316 | | |
1313 | 1317 | | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
1314 | 1325 | | |
1315 | 1326 | | |
1316 | 1327 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
674 | 674 | | |
675 | 675 | | |
676 | 676 | | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
677 | 693 | | |
678 | 694 | | |
679 | 695 | | |
| |||
708 | 724 | | |
709 | 725 | | |
710 | 726 | | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
711 | 730 | | |
712 | 731 | | |
713 | 732 | | |
714 | 733 | | |
715 | | - | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
716 | 738 | | |
717 | 739 | | |
718 | 740 | | |
| |||
1867 | 1889 | | |
1868 | 1890 | | |
1869 | 1891 | | |
1870 | | - | |
1871 | | - | |
| 1892 | + | |
| 1893 | + | |
| 1894 | + | |
| 1895 | + | |
| 1896 | + | |
1872 | 1897 | | |
1873 | | - | |
| 1898 | + | |
| 1899 | + | |
| 1900 | + | |
| 1901 | + | |
1874 | 1902 | | |
1875 | 1903 | | |
1876 | 1904 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
| 362 | + | |
362 | 363 | | |
363 | 364 | | |
364 | 365 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2073 | 2073 | | |
2074 | 2074 | | |
2075 | 2075 | | |
2076 | | - | |
| 2076 | + | |
| 2077 | + | |
2077 | 2078 | | |
2078 | 2079 | | |
2079 | 2080 | | |
| |||
2595 | 2596 | | |
2596 | 2597 | | |
2597 | 2598 | | |
2598 | | - | |
2599 | | - | |
| 2599 | + | |
| 2600 | + | |
2600 | 2601 | | |
2601 | 2602 | | |
2602 | 2603 | | |
2603 | 2604 | | |
2604 | | - | |
| 2605 | + | |
2605 | 2606 | | |
2606 | 2607 | | |
2607 | 2608 | | |
| |||
10208 | 10209 | | |
10209 | 10210 | | |
10210 | 10211 | | |
10211 | | - | |
| 10212 | + | |
| 10213 | + | |
10212 | 10214 | | |
10213 | 10215 | | |
10214 | 10216 | | |
| |||
0 commit comments