Thread: Timing problem in DROP TABLESPACE?

Timing problem in DROP TABLESPACE?

From
Simon Riggs
Date:
I've run regression tests many, many times recently, usually in the form
of a looping installcheck, rather than just make check.

On a recent test the last command of the last test has failed:
DROP TABLESPACE testspace;
ERROR:  tablespace "testspace" is not empty

The directory was confirmed as non-empty, though when running the
command again it worked successfully.

However, I've run it many times and it hasn't happened at all, so it's
sporadic and fairly rare. When I isolate just that test case in a tight
loop, I've seen no problems.

Now I'm not sure what causes that and although I am working on patches I
don't think I'm causing it myself. This error happens on the *master*,
not on the standby server.

Is there a timing problem? I see that we attempt to do a checkpoint to
clean up deleted files. Is that working? Is it ignoring certain
messages?

-- Simon Riggs           www.2ndQuadrant.comPostgreSQL Training, Services and Support



Re: Timing problem in DROP TABLESPACE?

From
Alvaro Herrera
Date:
Simon Riggs wrote:
> I've run regression tests many, many times recently, usually in the form
> of a looping installcheck, rather than just make check.
> 
> On a recent test the last command of the last test has failed:
> DROP TABLESPACE testspace;
> ERROR:  tablespace "testspace" is not empty
> 
> The directory was confirmed as non-empty, though when running the
> command again it worked successfully.

Maybe it is failing due to files that are scheduled to be deleted by
next checkpoint?  If it runs a checkpoint internally, perhaps there's a
race condition in the code that waits until the files are gone.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


Re: Timing problem in DROP TABLESPACE?

From
Tom Lane
Date:
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Simon Riggs wrote:
>> On a recent test the last command of the last test has failed:
>> DROP TABLESPACE testspace;
>> ERROR:  tablespace "testspace" is not empty

> Maybe it is failing due to files that are scheduled to be deleted by
> next checkpoint?  If it runs a checkpoint internally, perhaps there's a
> race condition in the code that waits until the files are gone.

The buildfarm has shown this type of error occasionally, though AFAIR
only on Windows boxen.  I had assumed it was a Windows-specific issue.
        regards, tom lane


Re: Timing problem in DROP TABLESPACE?

From
Simon Riggs
Date:
On Thu, 2008-11-06 at 10:20 -0500, Tom Lane wrote:
> Alvaro Herrera <alvherre@commandprompt.com> writes:
> > Simon Riggs wrote:
> >> On a recent test the last command of the last test has failed:
> >> DROP TABLESPACE testspace;
> >> ERROR:  tablespace "testspace" is not empty
> 
> > Maybe it is failing due to files that are scheduled to be deleted by
> > next checkpoint?  If it runs a checkpoint internally, perhaps there's a
> > race condition in the code that waits until the files are gone.
> 
> The buildfarm has shown this type of error occasionally, though AFAIR
> only on Windows boxen.  I had assumed it was a Windows-specific issue.

No MS Windows here.

-- Simon Riggs           www.2ndQuadrant.comPostgreSQL Training, Services and Support