pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Cc: David Rowley <david.rowley@2ndquadrant.com>
Cc: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Cc: Dmitry Dolgov <9erthalion6@gmail.com>
Cc: Jeff Janes <jeff.janes@gmail.com>
Cc: Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>
Cc: Pavel Stehule <pavel.stehule@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: why partition pruning doesn't work?
Date: Mon, 11 Jun 2018 19:05:04 -0400
Message-ID: <27543.1528758304@sss.pgh.pa.us> (raw)
In-Reply-To: <b91ddbe3-f45c-ec4f-3799-b5612f78bf38@2ndQuadrant.com>
References: <CAFj8pRBjrufA3ocDm8o4LPGNye9Y+pm1b9kCwode4X04CULG3g@mail.gmail.com>
	<CA+q6zcVL=7as7ud5ZNgndH_ytUn-h1=q_v8Cqpfea4-LULweMw@mail.gmail.com>
	<10432.1528045900@sss.pgh.pa.us>
	<CA+q6zcVX9Gp0o06AXrozc0k4zkfera_wQiSyTkKXzgCsEqM6Yg@mail.gmail.com>
	<569483c5-a273-6537-1b5d-7a271ce439fb@lab.ntt.co.jp>
	<CAKJS1f9y_L-sXHwh74CGOoYcQRj8mDX9PnJqJLbpKujH1AS2ow@mail.gmail.com>
	<CAKJS1f-D1Tbi=Ozug7wfiZRf7wJs3tJ1G0cX5MK0nwstrc++tA@mail.gmail.com>
	<e6e751ea-0db4-0e7b-9513-97460edb60b3@lab.ntt.co.jp>
	<CAKJS1f_jatg5+qbrha2fGog63t3VdbNnOkYZitJtx-uo5H5EsQ@mail.gmail.com>
	<22805.1528386192@sss.pgh.pa.us>
	<CAKJS1f9xHoMntARi1RhqwAVZ-E0qp5a5f+Tf_chH9Vr8xOWiAw@mail.gmail.com>
	<21787.1528428171@sss.pgh.pa.us>
	<CAKJS1f9JMif8oCfM! SUQxmFEYmRSbpSvC7H99g1OaAZQSeBU5jA@mail.gmail.com>
	<6366.1528571895@sss.pgh.pa.us>
	<12624.1528578026@sss.pgh.pa.us>
	<CAKJS1f--wyKiJFS0WeGFFYT7Rz1Yy=zFLEaS6n=J-e9uzn61dA@mail.gmail.com>
	<26279.1528670981@sss.pgh.pa.us>
	<17850.1528755844@sss.pgh.pa.us>
	<b91ddbe3-f45c-ec4! f-3799-b5612f78bf38@2ndQuadrant.com>

Andrew Dunstan <andrew.dunstan@2ndquadrant.com> writes:
> On 06/11/2018 06:24 PM, Tom Lane wrote:
>> If we had any buildfarm critters running valgrind on
>> RELCACHE_FORCE_RELEASE or CLOBBER_CACHE_ALWAYS builds, they'd have
>> detected use of uninitialized memory here ... but I don't think we have
>> any.  (The combination of valgrind and CCA would probably be too slow to
>> be practical :-(, though maybe somebody with a fast machine could do
>> the other thing.)

> I don't have a fast machine, but I do have a slow machine already 
> running valgrind and not doing much else :-) Let's see how lousyjack 
> does with -DRELCACHE_FORCE_RELEASE

I just tried the case here, and it doesn't even get as far as any
of the partitioning tests: it bombs out in inherit.sql :-(

==00:00:06:55.816 26107== Invalid read of size 4
==00:00:06:55.816 26107==    at 0x5F3978: ATExecDropInherit (tablecmds.c:11928)
==00:00:06:55.816 26107==    by 0x60212A: ATExecCmd (tablecmds.c:4241)
==00:00:06:55.816 26107==    by 0x602CC4: ATController (tablecmds.c:3976)
==00:00:06:55.816 26107==    by 0x7910EA: ProcessUtilitySlow (utility.c:1117)
==00:00:06:55.816 26107==    by 0x79180F: standard_ProcessUtility (utility.c:920)
==00:00:06:55.816 26107==    by 0x78D748: PortalRunUtility (pquery.c:1178)
==00:00:06:55.816 26107==    by 0x78E6D0: PortalRunMulti (pquery.c:1331)
==00:00:06:55.816 26107==    by 0x78EF8F: PortalRun (pquery.c:799)
==00:00:06:55.816 26107==    by 0x78B35C: exec_simple_query (postgres.c:1122)
==00:00:06:55.816 26107==    by 0x78C8B3: PostgresMain (postgres.c:4153)
==00:00:06:55.816 26107==    by 0x70FBD5: PostmasterMain (postmaster.c:4361)
==00:00:06:55.816 26107==    by 0x67AE4F: main (main.c:228)
==00:00:06:55.816 26107==  Address 0xe823e90 is 179,504 bytes inside a recently re-allocated block of size 524,288 alloc'd
==00:00:06:55.816 26107==    at 0x4A06A2E: malloc (vg_replace_malloc.c:270)
==00:00:06:55.816 26107==    by 0x8BBB35: AllocSetAlloc (aset.c:923)
==00:00:06:55.816 26107==    by 0x8C4473: palloc (mcxt.c:938)
==00:00:06:55.816 26107==    by 0x488DEF: CreateTemplateTupleDesc (tupdesc.c:66)
==00:00:06:55.816 26107==    by 0x88D2C0: RelationBuildDesc (relcache.c:416)
==00:00:06:55.816 26107==    by 0x8904B5: RelationIdGetRelation (relcache.c:1943)
==00:00:06:55.816 26107==    by 0x4C93BF: relation_open (heapam.c:1135)
==00:00:06:55.816 26107==    by 0x4D8305: index_open (indexam.c:154)
==00:00:06:55.816 26107==    by 0x62D6EB: ExecOpenIndices (execIndexing.c:197)
==00:00:06:55.816 26107==    by 0x53B607: CatalogOpenIndexes (indexing.c:49)
==00:00:06:55.816 26107==    by 0x556467: recordMultipleDependencies (pg_depend.c:112)
==00:00:06:55.816 26107==    by 0x560D44: create_toast_table (toasting.c:385)


That one's pretty obvious when you look at the code:

	/* keep our lock on the parent relation until commit */
	heap_close(parent_rel, NoLock);

	ObjectAddressSet(address, RelationRelationId,
					 RelationGetRelid(parent_rel));

It looks like this might be a fruitful source of creepie-crawlies.

			regards, tom lane




view thread (72+ messages)  latest in thread

Message-ID: <27543.1528758304@sss.pgh.pa.us>
Permalink:  ../27543.1528758304@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/27543.1528758304@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andrew.dunstan@2ndquadrant.com, david.rowley@2ndquadrant.com, Langote_Amit_f8@lab.ntt.co.jp, 9erthalion6@gmail.com, jeff.janes@gmail.com, ashutosh.bapat@enterprisedb.com, pavel.stehule@gmail.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: why partition pruning doesn't work?
  In-Reply-To: <27543.1528758304@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox