forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitf8ce4ed
committed
Allow copying files using clone/copy_file_range
Adds --clone/--copy-file-range options to pg_combinebackup, to allowcopying files using file cloning or copy_file_range(). These methods maybe faster than the standard block-by-block copy, but the main advantageis that they enable various features provided by CoW filesystems.This commit only uses these copy methods for files that did not changeand can be copied as a whole from a single backup.These new copy methods may not be available on all platforms, in whichcase the command throws an error (immediately, even if no files would becopied as a whole). This early failure seems better than failing laterwhen trying to copy the first file, after performing a lot of work onearlier files.If the requested copy method is available, but a checksum needs to berecalculated (e.g. because of a different checksum type), the file isstill copied using the requested method, but it is also read for thechecksum calculation. Depending on the filesystem this may be moreexpensive than just performing the simple copy, but it does enable theCoW benefits.Initial patch by Jakub Wartak, various reworks and improvements by me.Author: Tomas Vondra, Jakub WartakReviewed-by: Thomas Munro, Jakub Wartak, Robert HaasDiscussion:https://postgr.es/m/3024283a-7491-4240-80d0-421575f6bb23%40enterprisedb.com1 parent3c5ff36 commitf8ce4ed
File tree
7 files changed
+278
-41
lines changed- doc/src/sgml/ref
- src
- bin/pg_combinebackup
- tools/pgindent
7 files changed
+278
-41
lines changedLines changed: 45 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
185 | 185 |
| |
186 | 186 |
| |
187 | 187 |
| |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
188 | 233 |
| |
189 | 234 |
| |
190 | 235 |
| |
|
Lines changed: 168 additions & 38 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
| 17 | + | |
17 | 18 |
| |
18 | 19 |
| |
19 | 20 |
| |
| |||
24 | 25 |
| |
25 | 26 |
| |
26 | 27 |
| |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
27 | 34 |
| |
28 |
| - | |
| 35 | + | |
| 36 | + | |
29 | 37 |
| |
30 | 38 |
| |
31 | 39 |
| |
| |||
35 | 43 |
| |
36 | 44 |
| |
37 | 45 |
| |
38 |
| - | |
| 46 | + | |
| 47 | + | |
39 | 48 |
| |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
40 | 53 |
| |
41 | 54 |
| |
42 | 55 |
| |
| |||
51 | 64 |
| |
52 | 65 |
| |
53 | 66 |
| |
54 |
| - | |
55 |
| - | |
56 |
| - | |
57 |
| - | |
58 |
| - | |
59 |
| - | |
60 |
| - | |
61 |
| - | |
62 |
| - | |
63 |
| - | |
64 | 67 |
| |
65 |
| - | |
66 |
| - | |
| 68 | + | |
67 | 69 |
| |
68 | 70 |
| |
69 |
| - | |
70 |
| - | |
71 |
| - | |
72 |
| - | |
73 |
| - | |
74 |
| - | |
75 |
| - | |
76 |
| - | |
77 |
| - | |
78 |
| - | |
79 |
| - | |
80 |
| - | |
81 |
| - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
82 | 92 |
| |
83 | 93 |
| |
84 |
| - | |
85 |
| - | |
86 |
| - | |
87 |
| - | |
88 | 94 |
| |
89 | 95 |
| |
90 |
| - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
91 | 100 |
| |
92 | 101 |
| |
93 |
| - | |
94 |
| - | |
95 |
| - | |
96 | 102 |
| |
97 | 103 |
| |
98 | 104 |
| |
99 |
| - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
100 | 109 |
| |
101 | 110 |
| |
102 | 111 |
| |
103 | 112 |
| |
104 | 113 |
| |
105 |
| - | |
| 114 | + | |
| 115 | + | |
106 | 116 |
| |
107 | 117 |
| |
108 | 118 |
| |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
109 | 155 |
| |
110 | 156 |
| |
111 | 157 |
| |
| |||
156 | 202 |
| |
157 | 203 |
| |
158 | 204 |
| |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 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 | + | |
159 | 285 |
| |
160 | 286 |
| |
161 |
| - | |
| 287 | + | |
| 288 | + | |
162 | 289 |
| |
163 | 290 |
| |
164 | 291 |
| |
165 | 292 |
| |
166 | 293 |
| |
167 | 294 |
| |
| 295 | + | |
| 296 | + | |
| 297 | + | |
168 | 298 |
| |
169 | 299 |
|
Lines changed: 17 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
11 | 11 |
| |
12 | 12 |
| |
13 | 13 |
| |
| 14 | + | |
14 | 15 |
| |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
15 | 30 |
| |
16 | 31 |
| |
17 |
| - | |
| 32 | + | |
| 33 | + | |
18 | 34 |
| |
19 | 35 |
|
0 commit comments
Comments
(0)