pgsql: Oops, don't forget to rewind the directory before scanning it to
Log Message:
-----------
Oops, don't forget to rewind the directory before scanning it to fsync files in CREATE DATABASE
Modified Files:
--------------
pgsql/src/port:
copydir.c (r1.28 -> r1.29)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/port/copydir.c?r1=1.28&r2=1.29)
stark@postgresql.org (Greg Stark) writes:
Oops, don't forget to rewind the directory before scanning it to fsync files in CREATE DATABASE
This is certainly not right:
+ AllocateDir(fromdir);
if (xldir == NULL)
ereport(ERROR,
There's no guarantee AllocateDir will hand back the same pointer as
it did the previous time.
regards, tom lane
On Mon, Feb 22, 2010 at 9:11 AM, Greg Stark <stark@postgresql.org> wrote:
Log Message:
-----------
Oops, don't forget to rewind the directory before scanning it to fsync files in CREATE DATABASE
}
+ Free(xldir);
s/Free/FreeDir ?
Regards,
--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center
Fujii Masao <masao.fujii@gmail.com> writes:
+ Free(xldir);
s/Free/FreeDir ?
Yeah, that too. I think it's all good now, but please test.
One thing I was wondering was whether the stat-wrong-file problem
could explain the buildfarm failures that we thought were evidence
of a portability issue. I was tempted to re-enable the #ifdef NOTYET
code, but didn't want to pull that trigger while there were other
problems outstanding.
regards, tom lane
On Monday 22 February 2010 04:58:29 Tom Lane wrote:
Fujii Masao <masao.fujii@gmail.com> writes:
+ Free(xldir);
s/Free/FreeDir ?
Yeah, that too. I think it's all good now, but please test.
At least I havent seen any of the problems pointed out in "fsync fun".
One thing I was wondering was whether the stat-wrong-file problem
could explain the buildfarm failures that we thought were evidence
of a portability issue. I was tempted to re-enable the #ifdef NOTYET
code, but didn't want to pull that trigger while there were other
problems outstanding.
I unfortunately dont think so. The mkdir above should not have been bothered
by the stat issue - especially as it was only introduced by the commit to
disable the fsyncing.
I also think it should scan the todir not the fromdir, just on
general principles to avoid any possibility of race conditions.
That one actually was my idea/code and intentional with the idea to error out
at one more place if anything goes wrong in the copy loop - I could not think
of any race issues created by that which were not there before.
On the other hand its unlikely to catch anything so I dont mind.
Andres