forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit834aa56
committed
Fix the logic for putting relations into the relcache init file.
Commitf3b5565 was a couple of bricks shyof a load; specifically, it missed putting pg_trigger_tgrelid_tgname_indexinto the relcache init file, because that index is not used by anysyscache. However, we have historically nailed that index into cache forperformance reasons. The upshot was that load_relcache_init_file alwaysdecided that the init file was busted and silently ignored it, resultingin a significant hit to backend startup speed.To fix, reinstantiate RelationIdIsInInitFile() as a wrapper aroundRelationSupportsSysCache(), which can know about additional relationsthat should be in the init file despite being unknown to syscache.c.Also install some guards against future mistakes of this type: makewrite_relcache_init_file Assert that all nailed relations get written tothe init file, and make load_relcache_init_file emit a WARNING if it takesthe "wrong number of nailed relations" exit path. Now that we remove theinit files during postmaster startup, that case should never occur in thefield, even if we are starting a minor-version update that added or removedrels from the nailed set. So the warning shouldn't ever be seen by endusers, but it will show up in the regression tests if somebody breaks thislogic.Back-patch to all supported branches, like the previous commit.1 parent7e5859c commit834aa56
File tree
3 files changed
+53
-11
lines changed- src
- backend/utils/cache
- include/utils
3 files changed
+53
-11
lines changedLines changed: 1 addition & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
463 | 463 |
| |
464 | 464 |
| |
465 | 465 |
| |
466 |
| - | |
467 |
| - | |
468 |
| - | |
469 | 466 |
| |
470 |
| - | |
| 467 | + | |
471 | 468 |
| |
472 | 469 |
| |
473 | 470 |
| |
|
Lines changed: 51 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4441 | 4441 |
| |
4442 | 4442 |
| |
4443 | 4443 |
| |
4444 |
| - | |
4445 |
| - | |
4446 |
| - | |
| 4444 | + | |
| 4445 | + | |
| 4446 | + | |
| 4447 | + | |
4447 | 4448 |
| |
4448 | 4449 |
| |
4449 | 4450 |
| |
4450 | 4451 |
| |
4451 | 4452 |
| |
| 4453 | + | |
| 4454 | + | |
| 4455 | + | |
| 4456 | + | |
4452 | 4457 |
| |
| 4458 | + | |
4453 | 4459 |
| |
4454 | 4460 |
| |
4455 | 4461 |
| |
4456 | 4462 |
| |
4457 | 4463 |
| |
| 4464 | + | |
| 4465 | + | |
| 4466 | + | |
| 4467 | + | |
4458 | 4468 |
| |
| 4469 | + | |
4459 | 4470 |
| |
4460 | 4471 |
| |
4461 | 4472 |
| |
| |||
4573 | 4584 |
| |
4574 | 4585 |
| |
4575 | 4586 |
| |
4576 |
| - | |
4577 |
| - | |
4578 |
| - | |
| 4587 | + | |
| 4588 | + | |
| 4589 | + | |
| 4590 | + | |
| 4591 | + | |
| 4592 | + | |
4579 | 4593 |
| |
4580 |
| - | |
| 4594 | + | |
| 4595 | + | |
| 4596 | + | |
| 4597 | + | |
4581 | 4598 |
| |
| 4599 | + | |
4582 | 4600 |
| |
4583 | 4601 |
| |
4584 | 4602 |
| |
| |||
4694 | 4712 |
| |
4695 | 4713 |
| |
4696 | 4714 |
| |
| 4715 | + | |
| 4716 | + | |
| 4717 | + | |
| 4718 | + | |
| 4719 | + | |
| 4720 | + | |
| 4721 | + | |
| 4722 | + | |
| 4723 | + | |
| 4724 | + | |
| 4725 | + | |
| 4726 | + | |
| 4727 | + | |
| 4728 | + | |
| 4729 | + | |
| 4730 | + | |
| 4731 | + | |
| 4732 | + | |
| 4733 | + | |
| 4734 | + | |
| 4735 | + | |
| 4736 | + | |
| 4737 | + | |
| 4738 | + | |
| 4739 | + | |
| 4740 | + | |
4697 | 4741 |
| |
4698 | 4742 |
| |
4699 | 4743 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
105 | 105 |
| |
106 | 106 |
| |
107 | 107 |
| |
| 108 | + | |
108 | 109 |
| |
109 | 110 |
| |
110 | 111 |
| |
|
0 commit comments
Comments
(0)