- Notifications
You must be signed in to change notification settings - Fork28
Commit7fd89f4
committed
Fix async.c to not register any SLRU stats counts in the postmaster.
Previously, AsyncShmemInit forcibly initialized the first page of theasync SLRU, to save dealing with that case in asyncQueueAddEntries.But this is a poor tradeoff, since many installations do not ever useNOTIFY; for them, expending those cycles in AsyncShmemInit is acomplete waste. Besides, this only saves a couple of instructionsin asyncQueueAddEntries, which hardly seems likely to be measurable.The real reason to change this now, though, is that now that we trackSLRU access stats, the existing code is causing the postmaster toaccumulate some access counts, which then get inherited into childprocesses by fork(), messing up the statistics. Delaying theinitialization into the first child that does a NOTIFY fixes that.Hence, we can revertf3d23d8, which was an incorrect attempt atfixing that issue. Also, add an Assert to pgstat.c that shouldcatch any future errors of the same sort.Discussion:https://postgr.es/m/8367.1589391884@sss.pgh.pa.us1 parentd82a505 commit7fd89f4
2 files changed
+24
-14
lines changedLines changed: 18 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
200 | 200 |
| |
201 | 201 |
| |
202 | 202 |
| |
203 |
| - | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
204 | 207 |
| |
205 | 208 |
| |
206 | 209 |
| |
| |||
515 | 518 |
| |
516 | 519 |
| |
517 | 520 |
| |
518 |
| - | |
519 | 521 |
| |
520 | 522 |
| |
521 | 523 |
| |
| |||
562 | 564 |
| |
563 | 565 |
| |
564 | 566 |
| |
565 |
| - | |
566 |
| - | |
567 |
| - | |
568 |
| - | |
569 |
| - | |
570 |
| - | |
571 |
| - | |
572 | 567 |
| |
573 | 568 |
| |
574 | 569 |
| |
| |||
1470 | 1465 |
| |
1471 | 1466 |
| |
1472 | 1467 |
| |
1473 |
| - | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
1474 | 1476 |
| |
1475 |
| - | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
1476 | 1483 |
| |
1477 | 1484 |
| |
1478 | 1485 |
| |
|
Lines changed: 6 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2906 | 2906 |
| |
2907 | 2907 |
| |
2908 | 2908 |
| |
2909 |
| - | |
2910 |
| - | |
2911 |
| - | |
2912 | 2909 |
| |
2913 | 2910 |
| |
2914 | 2911 |
| |
| |||
6727 | 6724 |
| |
6728 | 6725 |
| |
6729 | 6726 |
| |
| 6727 | + | |
| 6728 | + | |
| 6729 | + | |
| 6730 | + | |
| 6731 | + | |
| 6732 | + | |
6730 | 6733 |
| |
6731 | 6734 |
| |
6732 | 6735 |
| |
|
0 commit comments
Comments
(0)