forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit4656e3d
committed
Replace CLOBBER_CACHE_ALWAYS with run-time GUC
Forced cache invalidation (CLOBBER_CACHE_ALWAYS) has been impracticalto use for testing in PostgreSQL because it's so slow and because it'stoggled on/off only at build time. It is helpful when hunting bugs inany code that uses the sycache/relcache because causes cacheinvalidations to be injected whenever it would be possible for aninvalidation to occur, whether or not one was really pending.Address this by providing run-time control over cache clobberbehaviour using the new debug_invalidate_system_caches_always GUC.Support is not compiled in at all unless assertions are enabled orCLOBBER_CACHE_ENABLED is explicitly defined at compile time. Itdefaults to 0 if compiled in, so it has negligible effect on assertbuild performance by default.When support is compiled in, test code can now setdebug_invalidate_system_caches_always=1 locally to a backend to testspecific queries, functions, extensions, etc. Or tests can toggle itglobally for a specific test case while retaining normal performanceduring test setup and teardown.For backwards compatibility with existing test harnesses and scripts,debug_invalidate_system_caches_always defaults to 1 ifCLOBBER_CACHE_ALWAYS is defined, and to 3 if CLOBBER_CACHE_RECURSIVEis defined.CLOBBER_CACHE_ENABLED is now visible in pg_config_manual.h, as is therelated RECOVER_RELATION_BUILD_MEMORY setting for the relcache.Author: Craig Ringer <craig.ringer@2ndquadrant.com>Discussion:https://www.postgresql.org/message-id/flat/CAMsr+YF=+ctXBZj3ywmvKNUjWpxmuTuUKuv-rgbHGX5i5pLstQ@mail.gmail.com1 parent8900b5a commit4656e3d
File tree
9 files changed
+169
-54
lines changed- doc/src/sgml
- src
- backend/utils
- adt
- cache
- misc
- include
- utils
9 files changed
+169
-54
lines changedLines changed: 37 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
9989 | 9989 |
| |
9990 | 9990 |
| |
9991 | 9991 |
| |
| 9992 | + | |
| 9993 | + | |
| 9994 | + | |
| 9995 | + | |
| 9996 | + | |
| 9997 | + | |
| 9998 | + | |
| 9999 | + | |
| 10000 | + | |
| 10001 | + | |
| 10002 | + | |
| 10003 | + | |
| 10004 | + | |
| 10005 | + | |
| 10006 | + | |
| 10007 | + | |
| 10008 | + | |
| 10009 | + | |
| 10010 | + | |
| 10011 | + | |
| 10012 | + | |
| 10013 | + | |
| 10014 | + | |
| 10015 | + | |
| 10016 | + | |
| 10017 | + | |
| 10018 | + | |
| 10019 | + | |
| 10020 | + | |
| 10021 | + | |
| 10022 | + | |
| 10023 | + | |
| 10024 | + | |
| 10025 | + | |
| 10026 | + | |
| 10027 | + | |
| 10028 | + | |
9992 | 10029 |
| |
9993 | 10030 |
| |
9994 | 10031 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
372 | 372 |
| |
373 | 373 |
| |
374 | 374 |
| |
375 |
| - | |
| 375 | + | |
| 376 | + | |
376 | 377 |
| |
377 | 378 |
| |
378 | 379 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
629 | 629 |
| |
630 | 630 |
| |
631 | 631 |
| |
632 |
| - | |
| 632 | + | |
633 | 633 |
| |
634 | 634 |
| |
635 | 635 |
| |
|
Lines changed: 24 additions & 24 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
109 | 109 |
| |
110 | 110 |
| |
111 | 111 |
| |
| 112 | + | |
112 | 113 |
| |
113 | 114 |
| |
114 | 115 |
| |
| |||
179 | 180 |
| |
180 | 181 |
| |
181 | 182 |
| |
| 183 | + | |
| 184 | + | |
182 | 185 |
| |
183 | 186 |
| |
184 | 187 |
| |
| |||
689 | 692 |
| |
690 | 693 |
| |
691 | 694 |
| |
692 |
| - | |
693 |
| - | |
694 |
| - | |
695 |
| - | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
696 | 699 |
| |
697 |
| - | |
698 |
| - | |
699 |
| - | |
700 |
| - | |
701 |
| - | |
702 |
| - | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
703 | 715 |
| |
704 |
| - | |
705 |
| - | |
706 |
| - | |
707 |
| - | |
708 |
| - | |
709 |
| - | |
710 |
| - | |
711 |
| - | |
712 |
| - | |
713 |
| - | |
714 |
| - | |
715 |
| - | |
| 716 | + | |
716 | 717 |
| |
717 | 718 |
| |
718 | 719 |
| |
719 |
| - | |
720 |
| - | |
| 720 | + | |
721 | 721 |
| |
722 | 722 |
| |
723 | 723 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
897 | 897 |
| |
898 | 898 |
| |
899 | 899 |
| |
900 |
| - | |
| 900 | + | |
901 | 901 |
| |
902 | 902 |
| |
903 | 903 |
| |
|
Lines changed: 40 additions & 27 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
91 | 91 |
| |
92 | 92 |
| |
93 | 93 |
| |
94 |
| - | |
95 |
| - | |
96 |
| - | |
| 94 | + | |
| 95 | + | |
97 | 96 |
| |
98 |
| - | |
99 |
| - | |
100 |
| - | |
| 97 | + | |
| 98 | + | |
101 | 99 |
| |
102 | 100 |
| |
| 101 | + | |
| 102 | + | |
103 | 103 |
| |
104 | 104 |
| |
105 | 105 |
| |
| |||
1040 | 1040 |
| |
1041 | 1041 |
| |
1042 | 1042 |
| |
1043 |
| - | |
1044 |
| - | |
1045 |
| - | |
1046 |
| - | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
1047 | 1050 |
| |
1048 |
| - | |
1049 |
| - | |
1050 |
| - | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
1051 | 1054 |
| |
1052 |
| - | |
1053 |
| - | |
1054 |
| - | |
1055 |
| - | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
1056 | 1062 |
| |
1057 | 1063 |
| |
1058 | 1064 |
| |
| |||
1065 | 1071 |
| |
1066 | 1072 |
| |
1067 | 1073 |
| |
1068 |
| - | |
1069 |
| - | |
1070 |
| - | |
1071 |
| - | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
1072 | 1081 |
| |
1073 | 1082 |
| |
1074 | 1083 |
| |
| |||
1247 | 1256 |
| |
1248 | 1257 |
| |
1249 | 1258 |
| |
1250 |
| - | |
1251 |
| - | |
1252 |
| - | |
1253 |
| - | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
1254 | 1266 |
| |
1255 | 1267 |
| |
1256 | 1268 |
| |
| |||
1646 | 1658 |
| |
1647 | 1659 |
| |
1648 | 1660 |
| |
1649 |
| - | |
1650 |
| - | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
1651 | 1664 |
| |
1652 | 1665 |
| |
1653 | 1666 |
| |
|
Lines changed: 24 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
99 | 99 |
| |
100 | 100 |
| |
101 | 101 |
| |
| 102 | + | |
102 | 103 |
| |
103 | 104 |
| |
104 | 105 |
| |
| |||
3402 | 3403 |
| |
3403 | 3404 |
| |
3404 | 3405 |
| |
| 3406 | + | |
| 3407 | + | |
| 3408 | + | |
| 3409 | + | |
| 3410 | + | |
| 3411 | + | |
| 3412 | + | |
| 3413 | + | |
| 3414 | + | |
| 3415 | + | |
| 3416 | + | |
| 3417 | + | |
| 3418 | + | |
| 3419 | + | |
| 3420 | + | |
| 3421 | + | |
| 3422 | + | |
| 3423 | + | |
| 3424 | + | |
| 3425 | + | |
| 3426 | + | |
| 3427 | + | |
| 3428 | + | |
3405 | 3429 |
| |
3406 | 3430 |
| |
3407 | 3431 |
| |
|
Lines changed: 39 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
309 | 309 |
| |
310 | 310 |
| |
311 | 311 |
| |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
312 | 351 |
| |
313 | 352 |
| |
314 | 353 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
18 | 18 |
| |
19 | 19 |
| |
20 | 20 |
| |
| 21 | + | |
21 | 22 |
| |
22 | 23 |
| |
23 | 24 |
| |
|
0 commit comments
Comments
(0)