Re: proposal: CREATE DATABASE vs. (partial) CHECKPOINT

From: Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
To: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
Cc: Tomas Vondra <tv(at)fuzzy(dot)cz>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: CREATE DATABASE vs. (partial) CHECKPOINT
Date: 2014-10-27 11:23:21
Message-ID: CAOeZVicDgcFgwHB99ma9MpQ03HJMPY2ridF-n8GNkRtgk7FEgw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Oct 27, 2014 at 4:44 PM, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com
> wrote:

> On 10/27/2014 01:06 PM, Atri Sharma wrote:
>
>>
>>>
>>>
>>>> To solve #1, we could redesign CREATE DATABASE so that replaying the
>>> DBASE_CREATE record doesn't zap the old directory, and also doesn't copy
>>> any files. We could instead just assume that if the transaction commits,
>>> all the files have been copied and fsync'd already, like we assume that
>>> if
>>> a CREATE INDEX commits in wal_level=minimal, the underlying file was
>>> fsync'd before the commit.
>>>
>>>
>> Do you mean that during a recovery, we just let the database directory be
>> and assume that it is in good shape since the transaction committed
>> originally?
>>
>
> Right.

It does make sense, however, with the checkpoint after creating the files
gone, the window between the creation of files and actual commit might be
increased, increasing the possibility of a crash during that period and
causing an orphan database. However, my understanding of the consequences
of removing the checkpoint might be incorrect, so my fears might be wrong.

Regards,

Atri

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2014-10-27 11:27:38 Re: Directory/File Access Permissions for COPY and Generic File Access Functions
Previous Message sudalai 2014-10-27 11:15:41 Master ip from hot_standby..