Re: Second call for platform testing - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Second call for platform testing
Date
Msg-id 18188.1007406090@sss.pgh.pa.us
Whole thread Raw
In response to Re: Second call for platform testing  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Second call for platform testing  (Mark Knox <markk@pixin.net>)
Re: Second call for platform testing  (Mark Knox <segfault@hardline.org>)
List pgsql-hackers
Mark Knox <segfault@hardline.org> writes:
>> Had a look at 7.2b3 and sadly it's failing several tests. I saw several 
>> "ERROR:  PGSTAT: Creation of DB hash table failed" which I haven't seen before.

That error is coming from the following ugly coding:
   *dbhash = hash_create("Databases hash", PGSTAT_DB_HASH_SIZE, &hash_ctl,                         HASH_ELEM |
HASH_FUNCTION| mcxt_flags);   if (pgStatDBHash == NULL)/* raise error */
 

AFAICT dbhash always points at the static variable pgStatDBHash, so the
code is not quite incorrect, though it's certainly trouble waiting to
happen as soon as someone changes things so that dbhash might point
elsewhere.  What I'm wondering is if your compiler is missing the
potential for aliasing and is emitting code that loads pgStatDBHash
before the store through dbhash occurs.  Does it help if you change
the second line (line 2094 in src/backend/postmaster/pgstat.c) to:
   if (*dbhash == NULL)

I'm going to commit this change in CVS anyway, but I'm wondering if it
explains your problem or not.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Second call for platform testing
Next
From: Daniel Kalchev
Date:
Subject: Re: 7.1.3 not using index