forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit9989d37
committed
Remove XLogFileNameP() from the tree
XLogFileNameP() is a wrapper routine able to build a palloc'd string fora WAL segment name, which is used for error string generation. Therewere several code paths where it gets called in a critical section,where memory allocation is not allowed. This results in triggeringan assertion failure instead of generating the wanted error message.Another, more annoying, problem is that if the allocation to generatethe WAL segment name fails on OOM, then the failure would be escalatedto a PANIC.This removes the routine and all its callers are replaced with a logicusing a fixed-size buffer. This way, all the existing mistakes arefixed and future ones are prevented.Author: Masahiko SawadaReviewed-by: Michael Paquier, Álvaro HerreraDiscussion:https://postgr.es/m/CA+fd4k5gC9H4uoWMLg9K_QfNrnkkdEw+-AFveob9YX7z8JnKTA@mail.gmail.com1 parente5532f1 commit9989d37
File tree
6 files changed
+95
-43
lines changed- src
- backend
- access/transam
- replication
- include/access
6 files changed
+95
-43
lines changedLines changed: 57 additions & 31 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2499 | 2499 |
| |
2500 | 2500 |
| |
2501 | 2501 |
| |
| 2502 | + | |
| 2503 | + | |
| 2504 | + | |
2502 | 2505 |
| |
2503 | 2506 |
| |
| 2507 | + | |
| 2508 | + | |
| 2509 | + | |
| 2510 | + | |
| 2511 | + | |
2504 | 2512 |
| |
2505 | 2513 |
| |
2506 | 2514 |
| |
2507 | 2515 |
| |
2508 |
| - | |
2509 |
| - | |
| 2516 | + | |
2510 | 2517 |
| |
2511 | 2518 |
| |
2512 | 2519 |
| |
| |||
3792 | 3799 |
| |
3793 | 3800 |
| |
3794 | 3801 |
| |
| 3802 | + | |
| 3803 | + | |
| 3804 | + | |
| 3805 | + | |
| 3806 | + | |
| 3807 | + | |
3795 | 3808 |
| |
3796 | 3809 |
| |
3797 |
| - | |
3798 |
| - | |
| 3810 | + | |
| 3811 | + | |
| 3812 | + | |
3799 | 3813 |
| |
3800 | 3814 |
| |
3801 | 3815 |
| |
| |||
5510 | 5524 |
| |
5511 | 5525 |
| |
5512 | 5526 |
| |
| 5527 | + | |
| 5528 | + | |
| 5529 | + | |
| 5530 | + | |
| 5531 | + | |
| 5532 | + | |
| 5533 | + | |
5513 | 5534 |
| |
5514 | 5535 |
| |
5515 |
| - | |
5516 |
| - | |
| 5536 | + | |
| 5537 | + | |
5517 | 5538 |
| |
5518 | 5539 |
| |
5519 | 5540 |
| |
| |||
10079 | 10100 |
| |
10080 | 10101 |
| |
10081 | 10102 |
| |
| 10103 | + | |
| 10104 | + | |
| 10105 | + | |
| 10106 | + | |
| 10107 | + | |
| 10108 | + | |
| 10109 | + | |
| 10110 | + | |
10082 | 10111 |
| |
10083 | 10112 |
| |
10084 |
| - | |
10085 |
| - | |
| 10113 | + | |
| 10114 | + | |
| 10115 | + | |
10086 | 10116 |
| |
10087 | 10117 |
| |
10088 | 10118 |
| |
| |||
10100 | 10130 |
| |
10101 | 10131 |
| |
10102 | 10132 |
| |
| 10133 | + | |
| 10134 | + | |
10103 | 10135 |
| |
10104 | 10136 |
| |
10105 | 10137 |
| |
10106 | 10138 |
| |
10107 | 10139 |
| |
10108 |
| - | |
10109 |
| - | |
10110 |
| - | |
10111 |
| - | |
| 10140 | + | |
10112 | 10141 |
| |
10113 | 10142 |
| |
10114 | 10143 |
| |
10115 | 10144 |
| |
10116 |
| - | |
10117 |
| - | |
10118 |
| - | |
10119 |
| - | |
| 10145 | + | |
10120 | 10146 |
| |
10121 | 10147 |
| |
10122 | 10148 |
| |
10123 | 10149 |
| |
10124 | 10150 |
| |
10125 |
| - | |
10126 |
| - | |
10127 |
| - | |
10128 |
| - | |
| 10151 | + | |
10129 | 10152 |
| |
10130 | 10153 |
| |
10131 | 10154 |
| |
| |||
10136 | 10159 |
| |
10137 | 10160 |
| |
10138 | 10161 |
| |
10139 |
| - | |
10140 |
| - | |
10141 | 10162 |
| |
10142 |
| - | |
10143 |
| - | |
10144 |
| - | |
10145 |
| - | |
10146 |
| - | |
10147 |
| - | |
10148 |
| - | |
| 10163 | + | |
| 10164 | + | |
| 10165 | + | |
| 10166 | + | |
| 10167 | + | |
10149 | 10168 |
| |
10150 |
| - | |
10151 |
| - | |
| 10169 | + | |
| 10170 | + | |
| 10171 | + | |
| 10172 | + | |
| 10173 | + | |
| 10174 | + | |
| 10175 | + | |
| 10176 | + | |
| 10177 | + | |
10152 | 10178 |
| |
10153 | 10179 |
| |
10154 | 10180 |
| |
|
Lines changed: 4 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
776 | 776 |
| |
777 | 777 |
| |
778 | 778 |
| |
779 |
| - | |
| 779 | + | |
780 | 780 |
| |
781 | 781 |
| |
782 | 782 |
| |
| |||
944 | 944 |
| |
945 | 945 |
| |
946 | 946 |
| |
947 |
| - | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
948 | 950 |
| |
949 | 951 |
| |
950 | 952 |
| |
|
Lines changed: 22 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
576 | 576 |
| |
577 | 577 |
| |
578 | 578 |
| |
| 579 | + | |
579 | 580 |
| |
580 | 581 |
| |
581 | 582 |
| |
582 | 583 |
| |
583 |
| - | |
| 584 | + | |
584 | 585 |
| |
585 | 586 |
| |
586 | 587 |
| |
587 | 588 |
| |
588 | 589 |
| |
589 |
| - | |
590 | 590 |
| |
591 | 591 |
| |
592 | 592 |
| |
| |||
900 | 900 |
| |
901 | 901 |
| |
902 | 902 |
| |
| 903 | + | |
| 904 | + | |
903 | 905 |
| |
904 | 906 |
| |
905 | 907 |
| |
| |||
909 | 911 |
| |
910 | 912 |
| |
911 | 913 |
| |
912 |
| - | |
| 914 | + | |
913 | 915 |
| |
914 | 916 |
| |
915 | 917 |
| |
916 | 918 |
| |
917 | 919 |
| |
918 |
| - | |
919 | 920 |
| |
920 | 921 |
| |
921 | 922 |
| |
| |||
943 | 944 |
| |
944 | 945 |
| |
945 | 946 |
| |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
946 | 953 |
| |
947 | 954 |
| |
948 | 955 |
| |
949 |
| - | |
950 |
| - | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
951 | 959 |
| |
952 | 960 |
| |
953 | 961 |
| |
| |||
957 | 965 |
| |
958 | 966 |
| |
959 | 967 |
| |
| 968 | + | |
| 969 | + | |
| 970 | + | |
960 | 971 |
| |
961 | 972 |
| |
962 | 973 |
| |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
963 | 978 |
| |
964 | 979 |
| |
965 | 980 |
| |
966 | 981 |
| |
967 |
| - | |
968 |
| - | |
| 982 | + | |
969 | 983 |
| |
970 | 984 |
| |
971 | 985 |
| |
|
Lines changed: 8 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2434 | 2434 |
| |
2435 | 2435 |
| |
2436 | 2436 |
| |
| 2437 | + | |
| 2438 | + | |
| 2439 | + | |
| 2440 | + | |
| 2441 | + | |
| 2442 | + | |
2437 | 2443 |
| |
2438 | 2444 |
| |
2439 | 2445 |
| |
2440 |
| - | |
| 2446 | + | |
| 2447 | + | |
2441 | 2448 |
| |
2442 | 2449 |
| |
2443 | 2450 |
| |
|
Lines changed: 0 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
288 | 288 |
| |
289 | 289 |
| |
290 | 290 |
| |
291 |
| - | |
292 | 291 |
| |
293 | 292 |
| |
294 | 293 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
152 | 152 |
| |
153 | 153 |
| |
154 | 154 |
| |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
155 | 159 |
| |
156 | 160 |
| |
157 | 161 |
| |
|
0 commit comments
Comments
(0)