forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitcdd46c7
committed
Start background writer during archive recovery. Background writer now performs
its usual buffer cleaning duties during archive recovery, and it's responsiblefor performing restartpoints.This requires some changes in postmaster. When the startup process has doneall the initialization and is ready to start WAL redo, it signals thepostmaster to launch the background writer. The postmaster is signaled againwhen the point in recovery is reached where we know that the database is inconsistent state. Postmaster isn't interested in that at the moment, butthat's the point where we could let other backends in to perform read-onlyqueries. The postmaster is signaled third time when the recovery has ended,so that postmaster knows that it's safe to start accepting connections.The startup process now traps SIGTERM, and performs a "clean" shutdown. Ifyou do a fast shutdown during recovery, a shutdown restartpoint is performed,like a shutdown checkpoint, and postmaster kills the processes cleanly. Youstill have to continue the recovery at next startup, though.Currently, the background writer is only launched during archive recovery.We could launch it during crash recovery as well, but it seems better to keepthat codepath as simple as possible, for the sake of robustness. And itcouldn't do any restartpoints during crash recovery anyway, so it wouldn't bethat useful.log_restartpoints is gone. Use log_checkpoints instead. This is yet to bedocumented.This whole operation is a pre-requisite for Hot Standby, but has some value ofits own whether the hot standby patch makes 8.4 or not.Simon Riggs, with lots of modifications by me.1 parent36a9cf3 commitcdd46c7
File tree
8 files changed
+920
-191
lines changed- src
- backend
- access/transam
- bootstrap
- postmaster
- storage/buffer
- utils/init
- include
- access
- storage
8 files changed
+920
-191
lines changedLines changed: 577 additions & 98 deletions
Large diffs are not rendered by default.
Lines changed: 4 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
37 | 37 |
| |
38 | 38 |
| |
39 | 39 |
| |
40 |
| - | |
41 | 40 |
| |
42 | 41 |
| |
43 | 42 |
| |
| |||
416 | 415 |
| |
417 | 416 |
| |
418 | 417 |
| |
419 |
| - | |
420 |
| - | |
421 |
| - | |
422 |
| - | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
423 | 421 |
| |
424 | 422 |
| |
425 | 423 |
| |
426 |
| - | |
427 | 424 |
| |
428 | 425 |
| |
429 | 426 |
| |
|
Lines changed: 56 additions & 21 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
37 | 37 |
| |
38 | 38 |
| |
39 | 39 |
| |
40 |
| - | |
| 40 | + | |
41 | 41 |
| |
42 | 42 |
| |
43 | 43 |
| |
| |||
49 | 49 |
| |
50 | 50 |
| |
51 | 51 |
| |
| 52 | + | |
52 | 53 |
| |
53 | 54 |
| |
54 | 55 |
| |
| |||
423 | 424 |
| |
424 | 425 |
| |
425 | 426 |
| |
| 427 | + | |
| 428 | + | |
| 429 | + | |
426 | 430 |
| |
427 | 431 |
| |
428 | 432 |
| |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
429 | 440 |
| |
430 | 441 |
| |
431 | 442 |
| |
| |||
444 | 455 |
| |
445 | 456 |
| |
446 | 457 |
| |
447 |
| - | |
| 458 | + | |
| 459 | + | |
448 | 460 |
| |
449 | 461 |
| |
450 | 462 |
| |
| |||
455 | 467 |
| |
456 | 468 |
| |
457 | 469 |
| |
458 |
| - | |
| 470 | + | |
| 471 | + | |
459 | 472 |
| |
460 | 473 |
| |
461 | 474 |
| |
462 | 475 |
| |
463 | 476 |
| |
464 | 477 |
| |
465 |
| - | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
466 | 485 |
| |
467 | 486 |
| |
468 | 487 |
| |
| |||
477 | 496 |
| |
478 | 497 |
| |
479 | 498 |
| |
480 |
| - | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
481 | 518 |
| |
482 |
| - | |
483 |
| - | |
484 |
| - | |
485 |
| - | |
486 |
| - | |
487 |
| - | |
| 519 | + | |
488 | 520 |
| |
489 | 521 |
| |
490 | 522 |
| |
| |||
507 | 539 |
| |
508 | 540 |
| |
509 | 541 |
| |
510 |
| - | |
| 542 | + | |
511 | 543 |
| |
512 | 544 |
| |
513 | 545 |
| |
| |||
714 | 746 |
| |
715 | 747 |
| |
716 | 748 |
| |
717 |
| - | |
718 |
| - | |
719 |
| - | |
720 |
| - | |
721 |
| - | |
722 |
| - | |
723 |
| - | |
| 749 | + | |
724 | 750 |
| |
725 |
| - | |
726 |
| - | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
727 | 762 |
| |
728 | 763 |
| |
729 | 764 |
| |
|
0 commit comments
Comments
(0)