Обсуждение: BUG #5725: server couldn't start when installing on liveCD

Поиск
Список
Период
Сортировка

BUG #5725: server couldn't start when installing on liveCD

От
"VMaury"
Дата:
The following bug has been logged online:

Bug reference:      5725
Logged by:          VMaury
Email address:      vmaury79@yahoo.fr
PostgreSQL version: 8.4
Operating system:   Ubuntu 10.10
Description:        server couldn't start when installing on liveCD
Details:

Hi,

I tried to install postgresql-8.4 from sources on a Ubuntu 10.10 liveCD (in
order to make a custom liveCD).
I get an error during the installation process:
[...]
Configuring postgresql.conf to use port 5432...
update-alternatives: using
/usr/share/postgresql/8.4/man/man1/postmaster.1.gz to provide
/usr/share/man/man1/postmaster.1.gz (postmaster.1.gz) in auto mode.
* Starting PostgreSQL 8.4 database server
* The PostgreSQL server failed to start. Please check the log output.
[fail]

and the log shows:
2010-10-25 08:45:56 UTC LOG:  database system was shut down at 2010-10-25
08:45:55 UTC
2010-10-25 08:45:56 UTC PANIC:  could not open file
"pg_xlog/000000010000000000000000" (log file 0, segment 0): Invalid
argument
2010-10-25 08:45:56 UTC LOG:  incomplete startup packet

This bug has been reported by someone else (in spanish):
https://bugs.launchpad.net/ubuntu/+source/postgresql-8.4/+bug/658857

However, this install works perfectly once Ubuntu is installed.
Why is there a difference between install and live?
Thank you very much for your help,

Vincent

Re: BUG #5725: server couldn't start when installing on liveCD

От
Alvaro Herrera
Дата:
Excerpts from VMaury's message of lun oct 25 15:44:01 -0300 2010:

> This bug has been reported by someone else (in spanish):
> https://bugs.launchpad.net/ubuntu/+source/postgresql-8.4/+bug/658857
>
> However, this install works perfectly once Ubuntu is installed.
> Why is there a difference between install and live?

Not as far as PostgreSQL is concerned.  You should probably take this up
with the Ubuntu packagers.  Perhaps it's a problem with the mount
options for the filesystem.

Hmm, my manpage says that open() could fail with EINVAL if O_DIRECT is
used and not supported by the filesystem.  We use O_DIRECT in some
wal_sync_method configurations.  Maybe the Ubuntu live is not getting
that flag right.

I think you should take this up with Martin Pitt, the packager.

--
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

Re: BUG #5725: server couldn't start when installing on liveCD

От
Craig Ringer
Дата:
On 10/26/2010 02:44 AM, VMaury wrote:

> 2010-10-25 08:45:56 UTC PANIC:  could not open file
> "pg_xlog/000000010000000000000000" (log file 0, segment 0): Invalid
> argument

> This bug has been reported by someone else (in spanish):
> https://bugs.launchpad.net/ubuntu/+source/postgresql-8.4/+bug/658857
>
> However, this install works perfectly once Ubuntu is installed.
> Why is there a difference between install and live?
> Thank you very much for your help,

The live CD uses a union file system over the squashfs from the CD. I
seem to remember that the writable part of the union is a tempfs, but
I'm not 100% sure of that. Anyway, the union file system and/or the
underlying tempfs are probably missing features required for
PostgreSQL's operation.

You can probably get it to run by pre-creating the postgresql data
directory and mounting a real file system on it, without the union with
squashfs. A dedicated tempfs might work, so try that. If it doesn't,
you'll need some writable storage (a partition on the computer's hard
disk, an external HDD, even a USB key if you're prepared for
horrifyingly bad performance) to put a real file system like ext3 on.

Even if tempfs works, be aware that it uses your system's RAM - and when
that runs low, spills to swap space. If there isn't enough RAM and
there's no swap space, it'll fail. Of course, the data also goes away on
reboot. It's a very bad place to run PostgreSQL for anything but the
most utterly trivial toy experimentation.

--
Craig Ringer

Re: BUG #5725: server couldn't start when installing on liveCD

От
Robert Haas
Дата:
On Mon, Oct 25, 2010 at 5:43 PM, Alvaro Herrera
<alvherre@commandprompt.com> wrote:
> Excerpts from VMaury's message of lun oct 25 15:44:01 -0300 2010:
>
>> This bug has been reported by someone else (in spanish):
>> https://bugs.launchpad.net/ubuntu/+source/postgresql-8.4/+bug/658857
>>
>> However, this install works perfectly once Ubuntu is installed.
>> Why is there a difference between install and live?
>
> Not as far as PostgreSQL is concerned. =A0You should probably take this up
> with the Ubuntu packagers. =A0Perhaps it's a problem with the mount
> options for the filesystem.
>
> Hmm, my manpage says that open() could fail with EINVAL if O_DIRECT is
> used and not supported by the filesystem. =A0We use O_DIRECT in some
> wal_sync_method configurations. =A0Maybe the Ubuntu live is not getting
> that flag right.
>
> I think you should take this up with Martin Pitt, the packager.

If this really is caused by a WAL setting that's incompatible with the
filesystem, maybe we should add a HINT.  This makes two reports today,
plus apparently at least one more on the Ubuntu sight.

--=20
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: BUG #5725: server couldn't start when installing on liveCD

От
Alvaro Herrera
Дата:
Excerpts from Robert Haas's message of lun oct 25 23:37:31 -0300 2010:
> On Mon, Oct 25, 2010 at 5:43 PM, Alvaro Herrera
> <alvherre@commandprompt.com> wrote:

> > Hmm, my manpage says that open() could fail with EINVAL if O_DIRECT is
> > used and not supported by the filesystem.  We use O_DIRECT in some
> > wal_sync_method configurations.  Maybe the Ubuntu live is not getting
> > that flag right.

> If this really is caused by a WAL setting that's incompatible with the
> filesystem, maybe we should add a HINT.  This makes two reports today,
> plus apparently at least one more on the Ubuntu sight.

Maybe we should retry the syscall without the flag in the EINVAL case.
It's not a critical flag for correctness, just desired for performance.

--
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

Re: BUG #5725: server couldn't start when installing on liveCD

От
Tom Lane
Дата:
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Excerpts from Robert Haas's message of lun oct 25 23:37:31 -0300 2010:
>> If this really is caused by a WAL setting that's incompatible with the
>> filesystem, maybe we should add a HINT.  This makes two reports today,
>> plus apparently at least one more on the Ubuntu sight.

> Maybe we should retry the syscall without the flag in the EINVAL case.
> It's not a critical flag for correctness, just desired for performance.

It's not really apparent to me that we should jump through hoops
to support a configuration that nobody would ever use "for real".
I think it'd be sufficient if we could add a HINT suggesting to use a
different wal_sync_method if we get EINVAL here.  Packagers who ship
Postgres on live CDs that have this problem could also consider changing
the default sync method, if they know that the alternatives have similar
performance anyway on their platform.

            regards, tom lane

Re: BUG #5725: server couldn't start when installing on liveCD

От
Vincent Maury
Дата:
Hello

Thank you very much.
However, postgresql 8.4 can be installed on ubuntu 9.10 live cd. Why wouldn=
't it work with 10.10 live cd?
I'm aware of RAM considerations, but my database is very light (a few hundr=
ed records), so there is no problem running it on a liveUSB.
Thank you very much in advance for your help.

Vincent

Le 26 oct. 2010 =E0 01:52, Craig Ringer <craig@postnewspapers.com.au> a =E9=
crit :

On 10/26/2010 02:44 AM, VMaury wrote:

2010-10-25 08:45:56 UTC PANIC:  could not open file
"pg_xlog/000000010000000000000000" (log file 0, segment 0): Invalid
argument

This bug has been reported by someone else (in spanish):
https://bugs.launchpad.net/ubuntu/+source/postgresql-8.4/+bug/658857

However, this install works perfectly once Ubuntu is installed.
Why is there a difference between install and live?
Thank you very much for your help,

The live CD uses a union file system over the squashfs from the CD. I seem =
to remember that the writable part of the union is a tempfs, but I'm not 10=
0% sure of that. Anyway, the union file system and/or the underlying tempfs=
 are probably missing features required for PostgreSQL's operation.

You can probably get it to run by pre-creating the postgresql data director=
y and mounting a real file system on it, without the union with squashfs. A=
 dedicated tempfs might work, so try that. If it doesn't, you'll need some =
writable storage (a partition on the computer's hard disk, an external HDD,=
 even a USB key if you're prepared for horrifyingly bad performance) to put=
 a real file system like ext3 on.

Even if tempfs works, be aware that it uses your system's RAM - and when th=
at runs low, spills to swap space. If there isn't enough RAM and there's no=
 swap space, it'll fail. Of course, the data also goes away on reboot. It's=
 a very bad place to run PostgreSQL for anything but the most utterly trivi=
al toy experimentation.

--
Craig Ringer

Re: BUG #5725: server couldn't start when installing on liveCD

От
Tom Lane
Дата:
Vincent Maury <vmaury79@yahoo.fr> writes:
> However, postgresql 8.4 can be installed on ubuntu 9.10 live cd. Why wouldn't it work with 10.10 live cd?

Either they changed the live CD to use a different filesystem that
doesn't support O_DIRECT, or this is a kernel bug introduced since 9.10.

            regards, tom lane

Re: BUG #5725: server couldn't start when installing on liveCD

От
Alvaro Herrera
Дата:
Excerpts from Vincent Maury's message of mar oct 26 10:17:36 -0300 2010:
> Hello
>
> Thank you very much.
> However, postgresql 8.4 can be installed on ubuntu 9.10 live cd. Why wouldn't it work with 10.10 live cd?
> I'm aware of RAM considerations, but my database is very light (a few hundred records), so there is no problem
runningit on a liveUSB. 
> Thank you very much in advance for your help.

Please do not report a new bug to reply to a comment on a previous bug.
Just reply to the email instead, making sure pgsql-bugs@postgresql.org
is copied.  Thanks.

--
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support