forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit88e9823
committed
Replace checkpoint_segments with min_wal_size and max_wal_size.
Instead of having a single knob (checkpoint_segments) that both triggerscheckpoints, and determines how many checkpoints to recycle, they are nowseparate concerns. There is still an internal variable calledCheckpointSegments, which triggers checkpoints. But it no longer determineshow many segments to recycle at a checkpoint. That is now auto-tuned bykeeping a moving average of the distance between checkpoints (in bytes),and trying to keep that many segments in reserve. The advantage of this isthat you can set max_wal_size very high, but the system won't actuallyconsume that much space if there isn't any need for it. The min_wal_sizesets a floor for that; you can effectively disable the auto-tuning behaviorby setting min_wal_size equal to max_wal_size.The max_wal_size setting is now the actual target size of WAL at which anew checkpoint is triggered, instead of the distance between checkpoints.Previously, you could calculate the actual WAL usage with the formula"(2 + checkpoint_completion_target) * checkpoint_segments + 1". With thispatch, you set the desired WAL usage with max_wal_size, and the systemcalculates the appropriate CheckpointSegments with the reverse of thatformula. That's a lot more intuitive for administrators to set.Reviewed by Amit Kapila and Venkata Balaji N.1 parent0fec000 commit88e9823
File tree
9 files changed
+327
-108
lines changed- doc/src/sgml
- src
- backend
- access/transam
- postmaster
- utils/misc
- include
- access
- utils
9 files changed
+327
-108
lines changedLines changed: 30 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1325 | 1325 |
| |
1326 | 1326 |
| |
1327 | 1327 |
| |
1328 |
| - | |
| 1328 | + | |
1329 | 1329 |
| |
1330 | 1330 |
| |
1331 | 1331 |
| |
| |||
2394 | 2394 |
| |
2395 | 2395 |
| |
2396 | 2396 |
| |
2397 |
| - | |
2398 |
| - | |
| 2397 | + | |
| 2398 | + | |
2399 | 2399 |
| |
2400 |
| - | |
| 2400 | + | |
2401 | 2401 |
| |
2402 |
| - | |
2403 | 2402 |
| |
2404 | 2403 |
| |
2405 |
| - | |
2406 |
| - | |
2407 |
| - | |
2408 |
| - | |
| 2404 | + | |
| 2405 | + | |
| 2406 | + | |
| 2407 | + | |
| 2408 | + | |
| 2409 | + | |
| 2410 | + | |
2409 | 2411 |
| |
2410 | 2412 |
| |
2411 | 2413 |
| |
| |||
2458 | 2460 |
| |
2459 | 2461 |
| |
2460 | 2462 |
| |
2461 |
| - | |
| 2463 | + | |
2462 | 2464 |
| |
2463 | 2465 |
| |
2464 | 2466 |
| |
| |||
2468 | 2470 |
| |
2469 | 2471 |
| |
2470 | 2472 |
| |
| 2473 | + | |
| 2474 | + | |
| 2475 | + | |
| 2476 | + | |
| 2477 | + | |
| 2478 | + | |
| 2479 | + | |
| 2480 | + | |
| 2481 | + | |
| 2482 | + | |
| 2483 | + | |
| 2484 | + | |
| 2485 | + | |
| 2486 | + | |
| 2487 | + | |
| 2488 | + | |
| 2489 | + | |
| 2490 | + | |
2471 | 2491 |
| |
2472 | 2492 |
| |
2473 | 2493 |
| |
|
Lines changed: 8 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1328 | 1328 |
| |
1329 | 1329 |
| |
1330 | 1330 |
| |
1331 |
| - | |
1332 |
| - | |
| 1331 | + | |
| 1332 | + | |
1333 | 1333 |
| |
1334 | 1334 |
| |
1335 |
| - | |
1336 |
| - | |
| 1335 | + | |
| 1336 | + | |
1337 | 1337 |
| |
1338 | 1338 |
| |
1339 | 1339 |
| |
1340 | 1340 |
| |
1341 | 1341 |
| |
1342 | 1342 |
| |
1343 |
| - | |
| 1343 | + | |
1344 | 1344 |
| |
1345 | 1345 |
| |
1346 | 1346 |
| |
| |||
1445 | 1445 |
| |
1446 | 1446 |
| |
1447 | 1447 |
| |
1448 |
| - | |
| 1448 | + | |
1449 | 1449 |
| |
1450 | 1450 |
| |
1451 | 1451 |
| |
| |||
1512 | 1512 |
| |
1513 | 1513 |
| |
1514 | 1514 |
| |
1515 |
| - | |
| 1515 | + | |
1516 | 1516 |
| |
1517 | 1517 |
| |
1518 | 1518 |
| |
| |||
1577 | 1577 |
| |
1578 | 1578 |
| |
1579 | 1579 |
| |
1580 |
| - | |
| 1580 | + | |
1581 | 1581 |
| |
1582 | 1582 |
| |
1583 | 1583 |
| |
|
Lines changed: 43 additions & 26 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
472 | 472 |
| |
473 | 473 |
| |
474 | 474 |
| |
475 |
| - | |
476 |
| - | |
477 |
| - | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
478 | 479 |
| |
479 | 480 |
| |
480 | 481 |
| |
| |||
486 | 487 |
| |
487 | 488 |
| |
488 | 489 |
| |
489 |
| - | |
490 |
| - | |
| 490 | + | |
| 491 | + | |
491 | 492 |
| |
492 | 493 |
| |
493 | 494 |
| |
| |||
510 | 511 |
| |
511 | 512 |
| |
512 | 513 |
| |
513 |
| - | |
| 514 | + | |
514 | 515 |
| |
515 | 516 |
| |
516 | 517 |
| |
517 |
| - | |
| 518 | + | |
518 | 519 |
| |
519 | 520 |
| |
520 | 521 |
| |
| |||
525 | 526 |
| |
526 | 527 |
| |
527 | 528 |
| |
528 |
| - | |
529 |
| - | |
530 |
| - | |
531 |
| - | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
532 | 533 |
| |
533 | 534 |
| |
534 | 535 |
| |
| |||
545 | 546 |
| |
546 | 547 |
| |
547 | 548 |
| |
548 |
| - | |
549 |
| - | |
550 |
| - | |
551 |
| - | |
552 |
| - | |
553 |
| - | |
554 |
| - | |
555 |
| - | |
556 |
| - | |
557 |
| - | |
558 |
| - | |
559 |
| - | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
560 | 578 |
| |
561 | 579 |
| |
562 | 580 |
| |
| |||
571 | 589 |
| |
572 | 590 |
| |
573 | 591 |
| |
574 |
| - | |
575 |
| - | |
576 |
| - | |
| 592 | + | |
| 593 | + | |
577 | 594 |
| |
578 | 595 |
| |
579 | 596 |
| |
|
0 commit comments
Comments
(0)