forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitbef47ff
committed
Introduce 'bbsink' abstraction to modularize base backup code.
The base backup code has accumulated a healthy number of newfeatures over the years, but it's becoming increasingly difficultto maintain and further enhance that code because there's noreal separation of concerns. For example, the code thatunderstands knows the details of how we send data to the clientusing the libpq protocol is scattered throughout basebackup.c,rather than being centralized in one place.To try to improve this situation, introduce a new 'bbsink' objectwhich acts as a recipient for archives generated during the basebackup progress and also for the backup manifest. This commitintroduces three types of bbsink: a 'copytblspc' bbsink forwards thebackup to the client using one COPY OUT operation per tablespace andanother for the manifest, a 'progress' bbsink performs commandprogress reporting, and a 'throttle' bbsink performs rate-limiting.The 'progress' and 'throttle' bbsink types also forward the data to asuccessor bbsink; at present, the last bbsink in the chain willalways be of type 'copytblspc'. There are plans to add more typesof 'bbsink' in future commits.This abstraction is a bit leaky in the case of progress reporting,but this still seems cleaner than what we had before.Patch by me, reviewed and tested by Andres Freund, Sumanta Mukherjee,Dilip Kumar, Suraj Kharage, Dipesh Pandit, Tushar Ahuja, Mark Dilger,and Jeevan Ladhe.Discussion:https://postgr.es/m/CA+TgmoZGwR=ZVWFeecncubEyPdwghnvfkkdBe9BLccLSiqdf9Q@mail.gmail.comDiscussion:https://postgr.es/m/CA+TgmoZvqk7UuzxsX1xjJRmMGkqoUGYTZLDCH8SmU1xTPr1Xig@mail.gmail.com1 parentbd807be commitbef47ff
File tree
9 files changed
+1414
-516
lines changed- src
- backend/replication
- include/replication
9 files changed
+1414
-516
lines changedLines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
17 | 17 |
| |
18 | 18 |
| |
19 | 19 |
| |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
20 | 24 |
| |
21 | 25 |
| |
22 | 26 |
| |
|
Lines changed: 9 additions & 19 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
17 | 17 |
| |
18 | 18 |
| |
19 | 19 |
| |
| 20 | + | |
20 | 21 |
| |
21 | 22 |
| |
22 | 23 |
| |
| |||
310 | 311 |
| |
311 | 312 |
| |
312 | 313 |
| |
313 |
| - | |
| 314 | + | |
314 | 315 |
| |
315 |
| - | |
316 | 316 |
| |
317 | 317 |
| |
318 | 318 |
| |
| |||
352 | 352 |
| |
353 | 353 |
| |
354 | 354 |
| |
355 |
| - | |
356 |
| - | |
357 |
| - | |
358 |
| - | |
359 |
| - | |
360 | 355 |
| |
361 | 356 |
| |
362 |
| - | |
363 |
| - | |
364 |
| - | |
365 |
| - | |
366 |
| - | |
| 357 | + | |
367 | 358 |
| |
| 359 | + | |
368 | 360 |
| |
369 | 361 |
| |
370 |
| - | |
371 | 362 |
| |
372 | 363 |
| |
373 | 364 |
| |
374 |
| - | |
| 365 | + | |
375 | 366 |
| |
376 |
| - | |
| 367 | + | |
| 368 | + | |
377 | 369 |
| |
378 | 370 |
| |
379 | 371 |
| |
380 | 372 |
| |
381 |
| - | |
| 373 | + | |
382 | 374 |
| |
383 | 375 |
| |
384 |
| - | |
385 |
| - | |
386 |
| - | |
| 376 | + | |
387 | 377 |
| |
388 | 378 |
| |
389 | 379 |
| |
|
0 commit comments
Comments
(0)