|
80 | 80 | * Portions Copyright (c) 1994, Regents of the University of California
|
81 | 81 | *
|
82 | 82 | * IDENTIFICATION
|
83 |
| - * $PostgreSQL: pgsql/src/backend/utils/cache/inval.c,v 1.74 2005/11/22 18:17:24 momjian Exp $ |
| 83 | + * $PostgreSQL: pgsql/src/backend/utils/cache/inval.c,v 1.75 2006/01/19 21:49:21 tgl Exp $ |
84 | 84 | *
|
85 | 85 | *-------------------------------------------------------------------------
|
86 | 86 | */
|
@@ -625,6 +625,36 @@ AcceptInvalidationMessages(void)
|
625 | 625 | {
|
626 | 626 | ReceiveSharedInvalidMessages(LocalExecuteInvalidationMessage,
|
627 | 627 | InvalidateSystemCaches);
|
| 628 | + |
| 629 | + /* |
| 630 | + * Test code to force cache flushes anytime a flush could happen. |
| 631 | + * |
| 632 | + * If used with CLOBBER_FREED_MEMORY, CLOBBER_CACHE_ALWAYS provides a |
| 633 | + * fairly thorough test that the system contains no cache-flush hazards. |
| 634 | + * However, it also makes the system unbelievably slow --- the regression |
| 635 | + * tests take about 100 times longer than normal. |
| 636 | + * |
| 637 | + * If you're a glutton for punishment, try CLOBBER_CACHE_RECURSIVELY. |
| 638 | + * This slows things by at least a factor of 10000, so I wouldn't suggest |
| 639 | + * trying to run the entire regression tests that way. It's useful to |
| 640 | + * try a few simple tests, to make sure that cache reload isn't subject |
| 641 | + * to internal cache-flush hazards, but after you've done a few thousand |
| 642 | + * recursive reloads it's unlikely you'll learn more. |
| 643 | + */ |
| 644 | +#if defined(CLOBBER_CACHE_ALWAYS) |
| 645 | + { |
| 646 | + static bool in_recursion = false; |
| 647 | + |
| 648 | + if (!in_recursion) |
| 649 | + { |
| 650 | + in_recursion = true; |
| 651 | + InvalidateSystemCaches(); |
| 652 | + in_recursion = false; |
| 653 | + } |
| 654 | + } |
| 655 | +#elif defined(CLOBBER_CACHE_RECURSIVELY) |
| 656 | + InvalidateSystemCaches(); |
| 657 | +#endif |
628 | 658 | }
|
629 | 659 |
|
630 | 660 | /*
|
|
0 commit comments