pgsql: Fix Assert failure in new plancache code.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix Assert failure in new plancache code.
Date: 2011-09-17 05:48:37
Message-ID: E1R4nlV-00058c-Kq@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix Assert failure in new plancache code.

The regression tests were failing with CLOBBER_CACHE_ALWAYS enabled,
as reported by buildfarm member jaguar. There was an Assert in
BuildCachedPlan that asserted that the CachedPlanSource hadn't been
invalidated since we called RevalidateCachedQuery, which in theory can't
happen because we are holding locks on all the relevant database objects.
However, CLOBBER_CACHE_ALWAYS generates a false positive by making an
invalidation happen anyway; and on reflection, that could also occur as a
result of a badly-timed sinval reset due to queue overflow. We could just
remove the Assert and forge ahead with the not-really-stale querytree, but
it seems safer to do another RevalidateCachedQuery call just to make real
sure everything's OK.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/c4ae968633b37e3b0a5da83e9d7d2a5518191564

Modified Files
--------------
src/backend/utils/cache/plancache.c | 17 +++++++++++++++--
1 files changed, 15 insertions(+), 2 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2011-09-19 03:46:19 pgsql: Fix another Assert issue exposed by CLOBBER_CACHE_ALWAYS.
Previous Message Tom Lane 2011-09-16 22:25:41 pgsql: Remove debug logging for pgstat wait timeout.