Re: two questions related to tablespace in PG8.0.1

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: two questions related to tablespace in PG8.0.1
Date: 2005-03-09 06:00:24
Message-ID: 20590.1110348024@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu> writes:
> Here are two questions related to PG8.0.1:
> 1. durability of "create tablespace" - what happens if several checkpoints
> done after "create tablespace" then system crashes - without redo, will the
> PG_VERSION file and symlinks survive in win32? Seems checkpoint didn't sync
> the content of PG_VERSION file.

There is no such thing as crash without redo: that is what WAL is all
about. The creation of the tablespace will be correctly replayed from
WAL. (Of course, this claim depends on various assumptions about
whether fsync behaves per spec ... but if it does not, tablespace
creation is hardly the only thing that will fail.)

> 2. possible race on "set_short_version(location)" while creating
> tablespace - what if two processes reach this point at the same time?

There is no "race" --- the point of that code is to ensure that if
two users concurrently try to create two tablespaces pointing at the
same directory, only one will succeed. In any case, since tablespace
creation requires superuser permissions, there is no issue about
whether the user might be malicious ... an attacker who has gained
database superuser can already break things in arbitrary ways.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Neil Conway 2005-03-09 06:06:38 Re: postgreSQL-8.0.1 configure --enable-thread-safety with
Previous Message Qingqing Zhou 2005-03-09 04:41:51 two questions related to tablespace in PG8.0.1