forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit35739b8
committed
Redesign archive modules
A new callback named startup_cb, called shortly after a module isloaded, is added. This makes possible the initialization of anyadditional state data required by a module. This initial state data canbe saved in a ArchiveModuleState, that is now passed down to all thecallbacks that can be defined in a module. With this design, it ispossible to have a per-module state, aimed at opening the door to thesupport of more than one archive module.The initialization of the callbacks is changed so as_PG_archive_module_init() does not anymore give in input aArchiveModuleCallbacks that a module has to fill in with callbackdefinitions. Instead, a module now needs to return a constArchiveModuleCallbacks.All the structure and callback definitions of archive modules are movedinto their own header, named archive_module.h, from pgarch.h.Command-based archiving follows the same line, with a new set of filesnamed shell_archive.{c,h}.There are a few more items that are under discussion to improve thedesign of archive modules, like the fact that basic_archive callssigsetjmp() by itself to define its own error handling flow. These willbe adjusted later, the changes done here cover already a good portionof what has been discussed.Any modules created for v15 will need to be adjusted to this newdesign.Author: Nathan BossartReviewed-by: Andres FreundDiscussion:https://postgr.es/m/20230130194810.6fztfgbn32e7qarj@awork3.anarazel.de1 parentd2ea2d3 commit35739b8
File tree
15 files changed
+252
-89
lines changed- contrib/basic_archive
- doc/src/sgml
- src
- backend
- archive
- postmaster
- utils/misc
- include
- archive
- postmaster
- tools/pgindent
15 files changed
+252
-89
lines changedLines changed: 73 additions & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
30 | 30 |
| |
31 | 31 |
| |
32 | 32 |
| |
| 33 | + | |
33 | 34 |
| |
34 | 35 |
| |
35 |
| - | |
36 | 36 |
| |
37 | 37 |
| |
38 | 38 |
| |
39 | 39 |
| |
40 | 40 |
| |
41 | 41 |
| |
42 | 42 |
| |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
43 | 48 |
| |
44 |
| - | |
45 | 49 |
| |
46 |
| - | |
47 |
| - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
48 | 53 |
| |
49 | 54 |
| |
50 | 55 |
| |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
51 | 64 |
| |
52 | 65 |
| |
53 | 66 |
| |
| |||
67 | 80 |
| |
68 | 81 |
| |
69 | 82 |
| |
70 |
| - | |
71 |
| - | |
72 |
| - | |
73 |
| - | |
74 | 83 |
| |
75 | 84 |
| |
76 | 85 |
| |
77 | 86 |
| |
78 | 87 |
| |
79 | 88 |
| |
80 | 89 |
| |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
81 | 101 |
| |
82 |
| - | |
| 102 | + | |
83 | 103 |
| |
84 |
| - | |
85 |
| - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
86 | 112 |
| |
87 | 113 |
| |
88 | 114 |
| |
| |||
133 | 159 |
| |
134 | 160 |
| |
135 | 161 |
| |
136 |
| - | |
| 162 | + | |
137 | 163 |
| |
138 | 164 |
| |
139 | 165 |
| |
| |||
144 | 170 |
| |
145 | 171 |
| |
146 | 172 |
| |
147 |
| - | |
| 173 | + | |
148 | 174 |
| |
149 | 175 |
| |
150 | 176 |
| |
| 177 | + | |
| 178 | + | |
151 | 179 |
| |
152 | 180 |
| |
153 | 181 |
| |
| |||
366 | 394 |
| |
367 | 395 |
| |
368 | 396 |
| |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + |
Lines changed: 27 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
47 | 47 |
| |
48 | 48 |
| |
49 | 49 |
| |
50 |
| - | |
51 |
| - | |
52 |
| - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
53 | 56 |
| |
54 | 57 |
| |
55 | 58 |
| |
56 | 59 |
| |
| 60 | + | |
57 | 61 |
| |
58 | 62 |
| |
59 | 63 |
| |
60 | 64 |
| |
61 |
| - | |
| 65 | + | |
62 | 66 |
| |
63 | 67 |
| |
64 | 68 |
| |
| |||
73 | 77 |
| |
74 | 78 |
| |
75 | 79 |
| |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
76 | 94 |
| |
77 | 95 |
| |
78 | 96 |
| |
| |||
83 | 101 |
| |
84 | 102 |
| |
85 | 103 |
| |
86 |
| - | |
| 104 | + | |
87 | 105 |
| |
88 | 106 |
| |
89 | 107 |
| |
| |||
105 | 123 |
| |
106 | 124 |
| |
107 | 125 |
| |
108 |
| - | |
| 126 | + | |
109 | 127 |
| |
110 | 128 |
| |
111 | 129 |
| |
| |||
125 | 143 |
| |
126 | 144 |
| |
127 | 145 |
| |
128 |
| - | |
| 146 | + | |
| 147 | + | |
129 | 148 |
| |
130 | 149 |
| |
131 |
| - | |
| 150 | + | |
132 | 151 |
| |
133 | 152 |
| |
134 | 153 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
17 | 17 |
| |
18 | 18 |
| |
19 | 19 |
| |
20 |
| - | |
| 20 | + | |
21 | 21 |
| |
22 | 22 |
| |
23 | 23 |
| |
|
Lines changed: 18 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + |
Lines changed: 5 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + |
Lines changed: 26 additions & 15 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
9 | 9 |
| |
10 | 10 |
| |
11 | 11 |
| |
12 |
| - | |
| 12 | + | |
13 | 13 |
| |
14 | 14 |
| |
15 | 15 |
| |
| |||
18 | 18 |
| |
19 | 19 |
| |
20 | 20 |
| |
| 21 | + | |
| 22 | + | |
21 | 23 |
| |
22 | 24 |
| |
23 |
| - | |
24 | 25 |
| |
25 |
| - | |
26 |
| - | |
27 |
| - | |
28 |
| - | |
29 |
| - | |
30 |
| - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
31 | 41 |
| |
32 |
| - | |
33 |
| - | |
34 |
| - | |
| 42 | + | |
35 | 43 |
| |
36 | 44 |
| |
37 | 45 |
| |
38 |
| - | |
| 46 | + | |
39 | 47 |
| |
40 | 48 |
| |
41 | 49 |
| |
42 | 50 |
| |
43 | 51 |
| |
44 |
| - | |
| 52 | + | |
| 53 | + | |
45 | 54 |
| |
46 | 55 |
| |
47 | 56 |
| |
| |||
53 | 62 |
| |
54 | 63 |
| |
55 | 64 |
| |
56 |
| - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
57 | 68 |
| |
58 | 69 |
| |
59 | 70 |
| |
| |||
123 | 134 |
| |
124 | 135 |
| |
125 | 136 |
| |
126 |
| - | |
| 137 | + | |
127 | 138 |
| |
128 | 139 |
| |
129 | 140 |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
| 10 | + | |
10 | 11 |
| |
11 | 12 |
| |
12 | 13 |
| |
|
Lines changed: 0 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
22 | 22 |
| |
23 | 23 |
| |
24 | 24 |
| |
25 |
| - | |
26 | 25 |
| |
27 | 26 |
| |
28 | 27 |
| |
|
Lines changed: 0 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
13 |
| - | |
14 | 13 |
| |
15 | 14 |
| |
16 | 15 |
| |
|
0 commit comments
Comments
(0)