Re: [Proposal] Fully WAL logged CREATE DATABASE - No Checkpoints - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [Proposal] Fully WAL logged CREATE DATABASE - No Checkpoints
Date
Msg-id 101580.1659801544@sss.pgh.pa.us
Whole thread Raw
In response to Re: [Proposal] Fully WAL logged CREATE DATABASE - No Checkpoints  (Dilip Kumar <dilipbalaut@gmail.com>)
List pgsql-hackers
Dilip Kumar <dilipbalaut@gmail.com> writes:
> PFA patches for different problems discussed in the thread

> 0001 - Fix the problem of skipping the empty block and buffer lock on
> source buffer
> 0002 - Remove fake relcache entry (same as 0001-BugfixInWalLogCreateDB.patch)
> 0003 - Optimization to avoid extending block by block

I pushed 0001, because it seems fairly critical to get that in before
beta3.  The others can stand more leisurely discussion.

I note from
https://coverage.postgresql.org/src/backend/storage/buffer/bufmgr.c.gcov.html
that the block-skipping path is actually taken in our tests (this won't be
visible there for very much longer of course).  So we actually *are*
making a corrupt copy, and we haven't noticed.  This is perhaps not too
surprising, because the only test case that I can find is in
020_createdb.pl:

$node->issues_sql_like(
    [ 'createdb', '-T', 'foobar2', '-S', 'wal_log', 'foobar6' ],
    qr/statement: CREATE DATABASE foobar6 STRATEGY wal_log TEMPLATE foobar2/,
    'create database with WAL_LOG strategy');

which is, um, not exactly a robust test of whether anything happened
at all, let alone whether it was correct.  I'm not real sure that
this test would even notice if the CREATE reported failure.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Zhang Mingli
Date:
Subject: Re: A cost issue in ORDER BY + LIMIT
Next
From: Tom Lane
Date:
Subject: Re: [Proposal] Fully WAL logged CREATE DATABASE - No Checkpoints