Re: [PATCHES] Fix for large file support (nonsegment mode support)

Lists: pgsql-hackerspgsql-patches
From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: pgsql-patches(at)postgresql(dot)org
Subject: Fix for large file support
Date: 2007-04-06 12:45:29
Message-ID: 461640E9.3000707@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Current version of postgres support only 1GB chunks. This limit is
defined in the pg_config_manual.h header file. However this setting
allows to have maximal 2GB chunks. Main problem is that md storage
manager and buffile use "long" data type (32bits) for offset instead
"off_t" defined in <sys/types.h>.

off_t is 32bits long on 32bits OS and 64bits long on 64bits OS or when
application is compiled with large file support.

Attached patch allow to setup bigger chunks than 4GB on OS with large
file support.

I tested it on 7GB table and it works.

Please, look on it and let me know your comments or if I miss something.

TODO/questions:

1) clean/update comments about limitation

2) Is there some doc for update?

3) I would like to add some check compare sizeof(off_t) and chunk size
setting and protect postgres with missconfigured chunk size. Is mdinit()
good place for this check?

4) I'm going to take bigger machine for test with really big table.

with regards Zdenek

Attachment Content-Type Size
largefile.diff text/x-patch 16.2 KB

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Fix for large file support
Date: 2007-04-06 14:21:05
Message-ID: 46165751.2090009@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Zdenek Kotala wrote:
> Current version of postgres support only 1GB chunks. This limit is
> defined in the pg_config_manual.h header file. However this setting
> allows to have maximal 2GB chunks. Main problem is that md storage
> manager and buffile use "long" data type (32bits) for offset instead
> "off_t" defined in <sys/types.h>.
>
> off_t is 32bits long on 32bits OS and 64bits long on 64bits OS or when
> application is compiled with large file support.
>
> Attached patch allow to setup bigger chunks than 4GB on OS with large
> file support.
>
> I tested it on 7GB table and it works.
>
>
>

What does it actually buy us, though? Does it mean the maximum field
size will grow beyond 1Gb? Or give better performance?

cheers

andrew


From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Fix for large file support
Date: 2007-04-06 14:54:39
Message-ID: 46165F2F.70404@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Andrew Dunstan wrote:
>
>
> Does it mean the maximum field size will grow beyond 1Gb?

No. Because it is limited by varlena size. See
http://www.postgresql.org/docs/8.2/interactive/storage-toast.html

> Or give better performance?

Yes. List of chunks is stored as linked list and for some operation
(e.g. expand) are all chunks opened and their size is checked. On big
tables it takes some time. For example if you have 1TB big table and you
want to add new block you must go and open all 1024 files.

By the way ./configure script performs check for __LARGE_FILE_ support,
but it looks that it is nowhere used.

There could be small time penalty in 64bit arithmetics. However it
happens only if large file support is enabled on 32bit OS.

Zdenek


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Fix for large file support
Date: 2007-04-06 17:04:08
Message-ID: 14547.1175879048@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM> writes:
> Andrew Dunstan wrote:
>> Or give better performance?

> Yes. List of chunks is stored as linked list and for some operation
> (e.g. expand) are all chunks opened and their size is checked. On big
> tables it takes some time. For example if you have 1TB big table and you
> want to add new block you must go and open all 1024 files.

Indeed, but that would be far more effectively addressed by fixing the
*other* code path that doesn't segment at all (the
LET_OS_MANAGE_FILESIZE option, which is most likely broken these days
for lack of testing). I don't see the point of a halfway measure like
increasing RELSEG_SIZE.

regards, tom lane


From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Fix for large file support
Date: 2007-04-06 18:36:38
Message-ID: 46169336.50400@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Tom Lane wrote:
> Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM> writes:
>> Andrew Dunstan wrote:

> Indeed, but that would be far more effectively addressed by fixing the
> *other* code path that doesn't segment at all (the
> LET_OS_MANAGE_FILESIZE option, which is most likely broken these days
> for lack of testing). I don't see the point of a halfway measure like
> increasing RELSEG_SIZE.

LET_OS_MANAGE_FILESIZE is good way. I think one problem of this option I
fixed. It is size of offset. I went thru the code and did not see any
other problem there. However, how you mentioned it need more testing. I
going to take server with large disk array and I will test it.

I would like to add --enable-largefile switch to configure file to
enable access to wide group of users. What you think about it?

Zdenek


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [PATCHES] Fix for large file support
Date: 2007-04-06 18:45:46
Message-ID: 16229.1175885146@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

[ redirecting to -hackers for wider comment ]

Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM> writes:
> Tom Lane wrote:
> LET_OS_MANAGE_FILESIZE is good way. I think one problem of this option I
> fixed. It is size of offset. I went thru the code and did not see any
> other problem there. However, how you mentioned it need more testing. I
> going to take server with large disk array and I will test it.

> I would like to add --enable-largefile switch to configure file to
> enable access to wide group of users. What you think about it?

Yeah, I was going to suggest the same thing --- but not with that switch
name. We already use enable/disable-largefile to control whether 64-bit
file access is built at all (this mostly affects pg_dump at the moment).

I think the clearest way might be to flip the sense of the variable.
I never found "LET_OS_MANAGE_FILESIZE" to be a good name anyway. I'd
suggest "USE_SEGMENTED_FILES", which defaults to "on", and you can
turn it off via --disable-segmented-files if configure confirms your
OS has largefile support (thus you could not specify both this and
--disable-largefile).

regards, tom lane


From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [PATCHES] Fix for large file support
Date: 2007-04-06 21:29:55
Message-ID: 4616BBD3.3020300@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Tom Lane wrote:
> [ redirecting to -hackers for wider comment ]
>
> Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM> writes:
>> Tom Lane wrote:
>> LET_OS_MANAGE_FILESIZE is good way. I think one problem of this option I
>> fixed. It is size of offset. I went thru the code and did not see any
>> other problem there. However, how you mentioned it need more testing. I
>> going to take server with large disk array and I will test it.
>
>> I would like to add --enable-largefile switch to configure file to
>> enable access to wide group of users. What you think about it?
>
> Yeah, I was going to suggest the same thing --- but not with that switch
> name. We already use enable/disable-largefile to control whether 64-bit
> file access is built at all (this mostly affects pg_dump at the moment).

hmm :( It looks that ./configure largefile detection does not work on
Solaris.

> I think the clearest way might be to flip the sense of the variable.
> I never found "LET_OS_MANAGE_FILESIZE" to be a good name anyway. I'd
> suggest "USE_SEGMENTED_FILES", which defaults to "on", and you can
> turn it off via --disable-segmented-files if configure confirms your
> OS has largefile support (thus you could not specify both this and
> --disable-largefile).

It sounds good. There is one think for clarification (for the present).
How to handle buffile? It does not currently support non segmented
files. I suggest to use same switch to enable/disable segments there.

Zdenek


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [PATCHES] Fix for large file support
Date: 2007-04-06 23:00:53
Message-ID: 28766.1175900453@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM> writes:
> It sounds good. There is one think for clarification (for the present).
> How to handle buffile? It does not currently support non segmented
> files. I suggest to use same switch to enable/disable segments there.

Do you think it really matters? terabyte-sized temp files seem a bit
unlikely, and anyway I don't think the performance argument applies;
md.c's tendency to open all the files at once is irrelevant.

regards, tom lane


From: Jim Nasby <decibel(at)decibel(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [PATCHES] Fix for large file support
Date: 2007-04-11 21:38:59
Message-ID: B9BF1E96-EEEB-4A7B-A3F7-8D9D1B82730D@decibel.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

If we expose LET_OS_MANAGE_FILESIZE, should we add a flag to the
control file so that you can't start a backend that has that defined
against a cluster that was initialized without it?

On Apr 6, 2007, at 2:45 PM, Tom Lane wrote:

> [ redirecting to -hackers for wider comment ]
>
> Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM> writes:
>> Tom Lane wrote:
>> LET_OS_MANAGE_FILESIZE is good way. I think one problem of this
>> option I
>> fixed. It is size of offset. I went thru the code and did not see any
>> other problem there. However, how you mentioned it need more
>> testing. I
>> going to take server with large disk array and I will test it.
>
>> I would like to add --enable-largefile switch to configure file to
>> enable access to wide group of users. What you think about it?
>
> Yeah, I was going to suggest the same thing --- but not with that
> switch
> name. We already use enable/disable-largefile to control whether
> 64-bit
> file access is built at all (this mostly affects pg_dump at the
> moment).
>
> I think the clearest way might be to flip the sense of the variable.
> I never found "LET_OS_MANAGE_FILESIZE" to be a good name anyway. I'd
> suggest "USE_SEGMENTED_FILES", which defaults to "on", and you can
> turn it off via --disable-segmented-files if configure confirms your
> OS has largefile support (thus you could not specify both this and
> --disable-largefile).
>
> regards, tom lane
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
>

--
Jim Nasby jim(at)nasby(dot)net
EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jim Nasby <decibel(at)decibel(dot)org>
Cc: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [PATCHES] Fix for large file support
Date: 2007-04-11 22:56:50
Message-ID: 6221.1176332210@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Jim Nasby <decibel(at)decibel(dot)org> writes:
> If we expose LET_OS_MANAGE_FILESIZE, should we add a flag to the
> control file so that you can't start a backend that has that defined
> against a cluster that was initialized without it?

I imagine we'd flag that as relsegsize = 0 or some such.

regards, tom lane


From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jim Nasby <decibel(at)decibel(dot)org>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [PATCHES] Fix for large file support
Date: 2007-04-16 16:12:52
Message-ID: 4623A084.1080705@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Tom Lane wrote:
> Jim Nasby <decibel(at)decibel(dot)org> writes:
>> If we expose LET_OS_MANAGE_FILESIZE, should we add a flag to the
>> control file so that you can't start a backend that has that defined
>> against a cluster that was initialized without it?
>
> I imagine we'd flag that as relsegsize = 0 or some such.

Yes I have it in my patch. I put relsegsize = 0 in the control file when
non-segmentation mode is enabled.

Zdenek


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCHES] Fix for large file support
Date: 2007-04-27 00:54:51
Message-ID: 200704270054.l3R0spe17764@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches


This has been saved for the 8.4 release:

http://momjian.postgresql.org/cgi-bin/pgpatches_hold

---------------------------------------------------------------------------

Tom Lane wrote:
> [ redirecting to -hackers for wider comment ]
>
> Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM> writes:
> > Tom Lane wrote:
> > LET_OS_MANAGE_FILESIZE is good way. I think one problem of this option I
> > fixed. It is size of offset. I went thru the code and did not see any
> > other problem there. However, how you mentioned it need more testing. I
> > going to take server with large disk array and I will test it.
>
> > I would like to add --enable-largefile switch to configure file to
> > enable access to wide group of users. What you think about it?
>
> Yeah, I was going to suggest the same thing --- but not with that switch
> name. We already use enable/disable-largefile to control whether 64-bit
> file access is built at all (this mostly affects pg_dump at the moment).
>
> I think the clearest way might be to flip the sense of the variable.
> I never found "LET_OS_MANAGE_FILESIZE" to be a good name anyway. I'd
> suggest "USE_SEGMENTED_FILES", which defaults to "on", and you can
> turn it off via --disable-segmented-files if configure confirms your
> OS has largefile support (thus you could not specify both this and
> --disable-largefile).
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: pgsql-patches(at)postgreSQL(dot)org
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Fix for large file support (nonsegment mode support)
Date: 2007-04-30 14:11:43
Message-ID: 4635F91F.5050402@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Tom Lane wrote:
> [ redirecting to -hackers for wider comment ]
>
> Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM> writes:
>> Tom Lane wrote:
>> LET_OS_MANAGE_FILESIZE is good way. I think one problem of this option I
>> fixed. It is size of offset. I went thru the code and did not see any
>> other problem there. However, how you mentioned it need more testing. I
>> going to take server with large disk array and I will test it.
>
>> I would like to add --enable-largefile switch to configure file to
>> enable access to wide group of users. What you think about it?
>
> Yeah, I was going to suggest the same thing --- but not with that switch
> name. We already use enable/disable-largefile to control whether 64-bit
> file access is built at all (this mostly affects pg_dump at the moment).
>
> I think the clearest way might be to flip the sense of the variable.
> I never found "LET_OS_MANAGE_FILESIZE" to be a good name anyway. I'd
> suggest "USE_SEGMENTED_FILES", which defaults to "on", and you can
> turn it off via --disable-segmented-files if configure confirms your
> OS has largefile support (thus you could not specify both this and
> --disable-largefile).
>

There is latest version of nonsegment support patch. I changed
LET_OS_MANAGE_FILESIZE to USE_SEGMENTED_FILES and I added
-disable-segmented-files switch to configure. I kept tuplestore behavior
and it still split file in both mode.

I also little bit cleanup some other datatypes (e.g int->mode_t).
Autoconf and autoheader must be run after patch application.

I tested it with 9GB table and both mode works fine.

Please, let me know your comments.

Zdenek

Attachment Content-Type Size
nonseg.patch.gz application/x-gzip 7.5 KB

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
Cc: pgsql-patches(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Fix for large file support (nonsegment mode support)
Date: 2007-04-30 22:31:57
Message-ID: 200704302231.l3UMVvt15147@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches


This has been saved for the 8.4 release:

http://momjian.postgresql.org/cgi-bin/pgpatches_hold

---------------------------------------------------------------------------

Zdenek Kotala wrote:
> Tom Lane wrote:
> > [ redirecting to -hackers for wider comment ]
> >
> > Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM> writes:
> >> Tom Lane wrote:
> >> LET_OS_MANAGE_FILESIZE is good way. I think one problem of this option I
> >> fixed. It is size of offset. I went thru the code and did not see any
> >> other problem there. However, how you mentioned it need more testing. I
> >> going to take server with large disk array and I will test it.
> >
> >> I would like to add --enable-largefile switch to configure file to
> >> enable access to wide group of users. What you think about it?
> >
> > Yeah, I was going to suggest the same thing --- but not with that switch
> > name. We already use enable/disable-largefile to control whether 64-bit
> > file access is built at all (this mostly affects pg_dump at the moment).
> >
> > I think the clearest way might be to flip the sense of the variable.
> > I never found "LET_OS_MANAGE_FILESIZE" to be a good name anyway. I'd
> > suggest "USE_SEGMENTED_FILES", which defaults to "on", and you can
> > turn it off via --disable-segmented-files if configure confirms your
> > OS has largefile support (thus you could not specify both this and
> > --disable-largefile).
> >
>
> There is latest version of nonsegment support patch. I changed
> LET_OS_MANAGE_FILESIZE to USE_SEGMENTED_FILES and I added
> -disable-segmented-files switch to configure. I kept tuplestore behavior
> and it still split file in both mode.
>
> I also little bit cleanup some other datatypes (e.g int->mode_t).
> Autoconf and autoheader must be run after patch application.
>
> I tested it with 9GB table and both mode works fine.
>
> Please, let me know your comments.
>
> Zdenek

[ application/x-gzip is not supported, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
Cc: pgsql-patches(at)postgresql(dot)org, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCHES] Fix for large file support (nonsegment mode support)
Date: 2008-03-10 20:16:12
Message-ID: 22219.1205180172@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM> writes:
> There is latest version of nonsegment support patch. I changed
> LET_OS_MANAGE_FILESIZE to USE_SEGMENTED_FILES and I added
> -disable-segmented-files switch to configure. I kept tuplestore behavior
> and it still split file in both mode.

Applied with minor corrections.

regards, tom lane


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-patches(at)postgresql(dot)org
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Zdenek Kotala <Zdenek(dot)Kotala(at)sun(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCHES] Fix for large file support (nonsegment mode support)
Date: 2008-03-10 23:11:43
Message-ID: 200803110011.45816.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Tom Lane wrote:
> Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM> writes:
> > There is latest version of nonsegment support patch. I changed
> > LET_OS_MANAGE_FILESIZE to USE_SEGMENTED_FILES and I added
> > -disable-segmented-files switch to configure. I kept tuplestore behavior
> > and it still split file in both mode.
>
> Applied with minor corrections.

Why is this not the default when supported? I am wondering both from the
point of view of the user, and in terms of development direction.


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-patches(at)postgresql(dot)org, Zdenek Kotala <Zdenek(dot)Kotala(at)sun(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCHES] Fix for large file support (nonsegment mode support)
Date: 2008-03-10 23:20:43
Message-ID: 2247.1205191243@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> Tom Lane wrote:
>> Applied with minor corrections.

> Why is this not the default when supported?

Fear.

Maybe eventually, but right now I think it's too risky.

One point that I already found out the hard way is that sizeof(off_t) = 8
does not guarantee the availability of largefile support; there can also
be filesystem-level constraints, and perhaps other things we know not of
at this point.

I think this needs to be treated as experimental until it's got a few
more than zero miles under its belt. I wouldn't be too surprised to
find that we have to implement it as a run-time switch instead of
compile-time, in order to not fail miserably when somebody sticks a
tablespace on an archaic filesystem.

regards, tom lane


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-patches(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Zdenek Kotala <Zdenek(dot)Kotala(at)sun(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCHES] Fix for large file support (nonsegment mode support)
Date: 2008-03-11 01:08:47
Message-ID: 20080311010847.GM8199@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Peter Eisentraut wrote:
> Tom Lane wrote:
> > Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM> writes:
> > > There is latest version of nonsegment support patch. I changed
> > > LET_OS_MANAGE_FILESIZE to USE_SEGMENTED_FILES and I added
> > > -disable-segmented-files switch to configure. I kept tuplestore behavior
> > > and it still split file in both mode.
> >
> > Applied with minor corrections.
>
> Why is this not the default when supported? I am wondering both from the
> point of view of the user, and in terms of development direction.

Also it would get more buildfarm coverage if it were default. If it
breaks something we'll notice earlier.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-patches(at)postgresql(dot)org, Zdenek Kotala <Zdenek(dot)Kotala(at)sun(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCHES] Fix for large file support (nonsegment mode support)
Date: 2008-03-11 01:45:48
Message-ID: 5761.1205199948@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> Also it would get more buildfarm coverage if it were default. If it
> breaks something we'll notice earlier.

Since nothing the regression tests do even approach 1GB, the odds that
the buildfarm will notice problems are approximately zero.

regards, tom lane


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-patches(at)postgresql(dot)org
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Zdenek Kotala <Zdenek(dot)Kotala(at)sun(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCHES] Fix for large file support (nonsegment mode support)
Date: 2008-03-11 07:27:07
Message-ID: 200803110827.10690.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Tom Lane wrote:
> I think this needs to be treated as experimental until it's got a few
> more than zero miles under its belt.

OK, then maybe we should document that.

> I wouldn't be too surprised to
> find that we have to implement it as a run-time switch instead of
> compile-time, in order to not fail miserably when somebody sticks a
> tablespace on an archaic filesystem.

Yes, that sounds quite useful. Let's wait and see what happens.


From: "Zeugswetter Andreas OSB SD" <Andreas(dot)Zeugswetter(at)s-itsolutions(dot)at>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Peter Eisentraut" <peter_e(at)gmx(dot)net>
Cc: <pgsql-patches(at)postgresql(dot)org>, "Zdenek Kotala" <Zdenek(dot)Kotala(at)sun(dot)com>, "Andrew Dunstan" <andrew(at)dunslane(dot)net>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] Fix for large file support (nonsegment mode support)
Date: 2008-03-11 08:49:59
Message-ID: E1539E0ED7043848906A8FF995BDA57902DD3016@m0143.s-mxs.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches


> > Why is this not the default when supported?
>
> Fear.
>
> Maybe eventually, but right now I think it's too risky.
>
> One point that I already found out the hard way is that sizeof(off_t)
= 8
> does not guarantee the availability of largefile support; there can
also
> be filesystem-level constraints, and perhaps other things we know not
of
> at this point.

Exactly, e.g. AIX is one of those. jfs (not the newer jfs2) has an
option
to enable large files, which is not the default and cannot be changed
post crfs.
And even if it is enabled, jfs has a 64 Gb filesize limit !
Anybody know others that support large but not huge files ?

Andreas


From: "Zeugswetter Andreas OSB SD" <Andreas(dot)Zeugswetter(at)s-itsolutions(dot)at>
To: "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>, "Peter Eisentraut" <peter_e(at)gmx(dot)net>
Cc: <pgsql-patches(at)postgresql(dot)org>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Zdenek Kotala" <Zdenek(dot)Kotala(at)sun(dot)com>, "Andrew Dunstan" <andrew(at)dunslane(dot)net>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] Fix for large file support (nonsegment mode support)
Date: 2008-03-11 08:51:17
Message-ID: E1539E0ED7043848906A8FF995BDA57902DD3018@m0143.s-mxs.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches


> > Why is this not the default when supported? I am wondering both
from the
> > point of view of the user, and in terms of development direction.
>
> Also it would get more buildfarm coverage if it were default. If it
> breaks something we'll notice earlier.

No we don't, because the buildfarm does not test huge files.

Andreas


From: Larry Rosenman <ler(at)lerctr(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-patches(at)postgresql(dot)org, Zdenek Kotala <Zdenek(dot)Kotala(at)sun(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCHES] Fix for large file support (nonsegment mode support)
Date: 2008-03-11 13:59:58
Message-ID: 20080311085901.W66911@thebighonker.lerctr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

On Mon, 10 Mar 2008, Tom Lane wrote:

> Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
>> Tom Lane wrote:
>>> Applied with minor corrections.
>
>> Why is this not the default when supported?
>
> Fear.
>
> Maybe eventually, but right now I think it's too risky.
>
> One point that I already found out the hard way is that sizeof(off_t) = 8
> does not guarantee the availability of largefile support; there can also
> be filesystem-level constraints, and perhaps other things we know not of
> at this point.
>
Just to note an additional filesystem that will need special action...
The VxFS filesystem has a largefiles option, per filesystem. At least that
was the case on SCO UnixWare (No, I no longer run it).

LER

>
> regards, tom lane
>
>

--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 512-248-2683 E-Mail: ler(at)lerctr(dot)org
US Mail: 430 Valona Loop, Round Rock, TX 78681-3893


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-patches(at)postgresql(dot)org, Zdenek Kotala <Zdenek(dot)Kotala(at)sun(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCHES] Fix for large file support (nonsegment mode support)
Date: 2008-03-11 14:41:57
Message-ID: 19415.1205246517@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> Tom Lane wrote:
>> I think this needs to be treated as experimental until it's got a few
>> more than zero miles under its belt.

> OK, then maybe we should document that.

Agreed, but at this point we don't even know what hazards we need to
document.

regards, tom lane


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Zeugswetter Andreas OSB SD" <Andreas(dot)Zeugswetter(at)s-itsolutions(dot)at>
Cc: "Peter Eisentraut" <peter_e(at)gmx(dot)net>, pgsql-patches(at)postgresql(dot)org, "Zdenek Kotala" <Zdenek(dot)Kotala(at)sun(dot)com>, "Andrew Dunstan" <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCHES] Fix for large file support (nonsegment mode support)
Date: 2008-03-11 14:48:59
Message-ID: 19622.1205246939@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

"Zeugswetter Andreas OSB SD" <Andreas(dot)Zeugswetter(at)s-itsolutions(dot)at> writes:
> Exactly, e.g. AIX is one of those. jfs (not the newer jfs2) has an
> option
> to enable large files, which is not the default and cannot be changed
> post crfs.
> And even if it is enabled, jfs has a 64 Gb filesize limit !
> Anybody know others that support large but not huge files ?

Yeah, HPUX 10 is similar --- 128GB hard maximum. It does say you
can convert an existing filesystem to largefile support, but it has
to be unmounted.

These examples suggest that maybe what we want is not so much a "no
segments ever" mode as a segment size larger than 1GB.

regards, tom lane


From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Zeugswetter Andreas OSB SD <Andreas(dot)Zeugswetter(at)s-itsolutions(dot)at>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-patches(at)postgresql(dot)org, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCHES] Fix for large file support (nonsegment mode support)
Date: 2008-03-11 16:07:30
Message-ID: 47D6AE42.7000608@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Tom Lane napsal(a):
> "Zeugswetter Andreas OSB SD" <Andreas(dot)Zeugswetter(at)s-itsolutions(dot)at> writes:
>> Exactly, e.g. AIX is one of those. jfs (not the newer jfs2) has an
>> option
>> to enable large files, which is not the default and cannot be changed
>> post crfs.
>> And even if it is enabled, jfs has a 64 Gb filesize limit !
>> Anybody know others that support large but not huge files ?
>
> Yeah, HPUX 10 is similar --- 128GB hard maximum. It does say you
> can convert an existing filesystem to largefile support, but it has
> to be unmounted.
>
> These examples suggest that maybe what we want is not so much a "no
> segments ever" mode as a segment size larger than 1GB.

Patch allows to use bigger than 2/4GB segment files and it is possible
changed it in source file. But how it was mentioned in this thread maybe
somethink like this "CREATE TABLESPACE name LOCATION '/my/location'
SEGMENTS 10GB" should good solution. If segments is not mentioned then
default value is used.

Zdenek

PS: ZFS is happy with 2^64bit size and UFS has 1TB file size limit
(depends on solaris version)


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
Cc: Zeugswetter Andreas OSB SD <Andreas(dot)Zeugswetter(at)s-itsolutions(dot)at>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-patches(at)postgresql(dot)org, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCHES] Fix for large file support (nonsegment mode support)
Date: 2008-03-11 16:20:57
Message-ID: 22898.1205252457@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM> writes:
> Tom Lane napsal(a):
>> These examples suggest that maybe what we want is not so much a "no
>> segments ever" mode as a segment size larger than 1GB.

> PS: ZFS is happy with 2^64bit size and UFS has 1TB file size limit
> (depends on solaris version)

So even on Solaris, "no segments ever" is actually a pretty awful idea.
As it stands, the code would fail on tables > 1TB.

I'm thinking we need to reconsider this patch. Rather than disabling
segmentation altogether, we should see it as allowing use of segments
larger than 1GB. I suggest that we ought to just flat rip out the "non
segmenting" code paths in md.c, and instead look into what segment sizes
are appropriate on different platforms.

regards, tom lane


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>, Zeugswetter Andreas OSB SD <Andreas(dot)Zeugswetter(at)s-itsolutions(dot)at>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-patches(at)postgresql(dot)org, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCHES] Fix for large file support (nonsegment mode support)
Date: 2008-03-11 16:28:32
Message-ID: 200803111628.m2BGSWh14286@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Tom Lane wrote:
> Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM> writes:
> > Tom Lane napsal(a):
> >> These examples suggest that maybe what we want is not so much a "no
> >> segments ever" mode as a segment size larger than 1GB.
>
> > PS: ZFS is happy with 2^64bit size and UFS has 1TB file size limit
> > (depends on solaris version)
>
> So even on Solaris, "no segments ever" is actually a pretty awful idea.
> As it stands, the code would fail on tables > 1TB.
>
> I'm thinking we need to reconsider this patch. Rather than disabling
> segmentation altogether, we should see it as allowing use of segments
> larger than 1GB. I suggest that we ought to just flat rip out the "non
> segmenting" code paths in md.c, and instead look into what segment sizes
> are appropriate on different platforms.

Agreed.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://postgres.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Zeugswetter Andreas OSB SD <Andreas(dot)Zeugswetter(at)s-itsolutions(dot)at>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-patches(at)postgresql(dot)org, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCHES] Fix for large file support (nonsegment mode support)
Date: 2008-03-11 16:41:07
Message-ID: 47D6B623.1040202@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Tom Lane napsal(a):
> Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM> writes:
>> Tom Lane napsal(a):
>>> These examples suggest that maybe what we want is not so much a "no
>>> segments ever" mode as a segment size larger than 1GB.
>
>> PS: ZFS is happy with 2^64bit size and UFS has 1TB file size limit
>> (depends on solaris version)
>
> So even on Solaris, "no segments ever" is actually a pretty awful idea.
> As it stands, the code would fail on tables > 1TB.
>
> I'm thinking we need to reconsider this patch. Rather than disabling
> segmentation altogether, we should see it as allowing use of segments
> larger than 1GB. I suggest that we ought to just flat rip out the "non
> segmenting" code paths in md.c, and instead look into what segment sizes
> are appropriate on different platforms.

Yes, agree. It seems only ZFS is OK at this moment and if somebody sets
32TB he gets nonsegment mode anyway. I looked into posix standard and
there is useful function which can be used. See

http://www.opengroup.org/onlinepubs/009695399/functions/pathconf.html

Maybe we can put additional test into configure and collect appropriate
data from buildfarm.

I think current patch could stay in CVS and I will rip out non segment
code path in a new patch.

Zdenek


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
Cc: Zeugswetter Andreas OSB SD <Andreas(dot)Zeugswetter(at)s-itsolutions(dot)at>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-patches(at)postgresql(dot)org, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCHES] Fix for large file support (nonsegment mode support)
Date: 2008-03-11 17:18:56
Message-ID: 26485.1205255936@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM> writes:
> I think current patch could stay in CVS and I will rip out non segment
> code path in a new patch.

Sure, I feel no need to revert what's applied. Have at it.

regards, tom lane


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Zdenek Kotala <Zdenek(dot)Kotala(at)sun(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Zeugswetter Andreas OSB SD <Andreas(dot)Zeugswetter(at)s-itsolutions(dot)at>, pgsql-patches(at)postgresql(dot)org, Andrew Dunstan <andrew(at)dunslane(dot)net>
Subject: Re: [PATCHES] Fix for large file support (nonsegment mode support)
Date: 2008-03-11 17:39:13
Message-ID: 200803111839.15657.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Zdenek Kotala wrote:
> Yes, agree. It seems only ZFS is OK at this moment and if somebody sets
> 32TB he gets nonsegment mode anyway.

Surely if you set the segment size to INT64_MAX, you will get nonsegmented
behavior anyway, so two code paths might not be necessary at all.

> I looked into posix standard and
> there is useful function which can be used. See
>
> http://www.opengroup.org/onlinepubs/009695399/functions/pathconf.html
>
> Maybe we can put additional test into configure and collect appropriate
> data from buildfarm.

It might be good to just check first if it returns realistic values for the
example cases that have been mentioned.


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org, Zdenek Kotala <Zdenek(dot)Kotala(at)sun(dot)com>, Zeugswetter Andreas OSB SD <Andreas(dot)Zeugswetter(at)s-itsolutions(dot)at>, pgsql-patches(at)postgresql(dot)org, Andrew Dunstan <andrew(at)dunslane(dot)net>
Subject: Re: [PATCHES] Fix for large file support (nonsegment mode support)
Date: 2008-03-11 18:02:09
Message-ID: 29585.1205258529@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> Zdenek Kotala wrote:
>> Maybe we can put additional test into configure and collect appropriate
>> data from buildfarm.

> It might be good to just check first if it returns realistic values for the
> example cases that have been mentioned.

Yeah, please just make up a ten-line C program that prints the numbers
you want, and post it on -hackers for people to try. If manual testing
says that it's printing useful numbers, then it would be time enough to
think about how to get it into the buildfarm.

regards, tom lane


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-patches(at)postgresql(dot)org
Cc: Zdenek Kotala <Zdenek(dot)Kotala(at)sun(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Zeugswetter Andreas OSB SD <Andreas(dot)Zeugswetter(at)s-itsolutions(dot)at>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCHES] Fix for large file support (nonsegment mode support)
Date: 2008-03-19 08:38:12
Message-ID: 200803190938.15589.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Zdenek Kotala wrote:
> But how it was mentioned in this thread maybe
> somethink like this "CREATE TABLESPACE name LOCATION '/my/location'
> SEGMENTS 10GB" should good solution. If segments is not mentioned then
> default value is used.

I think you would need a tool to resegmentize a table or tablespace offline,
usable for example when recovering a backup.

Also, tablespace configuration information is of course also stored in a
table. pg_tablespace probably won't become large, but it would probably
still need to be special-cased, along with other system catalogs perhaps.

An then, how to coordindate offline resegmenting and online tablespace
operations in a crash-safe way?

Another factor I just thought of is that tar, commonly used as part of a
backup procedure, can on some systems only handle files up to 8 GB in size.
There are supposed to be newer formats that can avoid that restriction, but
it's not clear how widely available these are and what the incantation is to
get at them. Of course we don't use tar directly, but if we ever make large
segments the default, we ought to provide some clear advice for the user on
how to make their backups.


From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-patches(at)postgresql(dot)org, Zdenek Kotala <Zdenek(dot)Kotala(at)sun(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Zeugswetter Andreas OSB SD <Andreas(dot)Zeugswetter(at)s-itsolutions(dot)at>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCHES] Fix for large file support (nonsegment mode support)
Date: 2008-03-19 09:51:12
Message-ID: 20080319095112.GB11286@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

On Wed, Mar 19, 2008 at 09:38:12AM +0100, Peter Eisentraut wrote:
> Another factor I just thought of is that tar, commonly used as part of a
> backup procedure, can on some systems only handle files up to 8 GB in size.
> There are supposed to be newer formats that can avoid that restriction, but
> it's not clear how widely available these are and what the incantation is to
> get at them. Of course we don't use tar directly, but if we ever make large
> segments the default, we ought to provide some clear advice for the user on
> how to make their backups.

By my reading, GNU tar handles larger files and no-one else (not even a
POSIX standard tar) can...

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.


From: Kenneth Marshall <ktm(at)rice(dot)edu>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-patches(at)postgresql(dot)org, Zdenek Kotala <Zdenek(dot)Kotala(at)sun(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Zeugswetter Andreas OSB SD <Andreas(dot)Zeugswetter(at)s-itsolutions(dot)at>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCHES] Fix for large file support (nonsegment mode support)
Date: 2008-03-19 12:25:15
Message-ID: 20080319122515.GC23158@it.is.rice.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

On Wed, Mar 19, 2008 at 10:51:12AM +0100, Martijn van Oosterhout wrote:
> On Wed, Mar 19, 2008 at 09:38:12AM +0100, Peter Eisentraut wrote:
> > Another factor I just thought of is that tar, commonly used as part of a
> > backup procedure, can on some systems only handle files up to 8 GB in size.
> > There are supposed to be newer formats that can avoid that restriction, but
> > it's not clear how widely available these are and what the incantation is to
> > get at them. Of course we don't use tar directly, but if we ever make large
> > segments the default, we ought to provide some clear advice for the user on
> > how to make their backups.
>
> By my reading, GNU tar handles larger files and no-one else (not even a
> POSIX standard tar) can...
>
> Have a nice day,
> --
> Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> > Please line up in a tree and maintain the heap invariant while
> > boarding. Thank you for flying nlogn airlines.

The star program written by Joerg Schilling is a very well written
POSIX compatible tar program that can easily handle files larger than
8GB. It is another backup option.

Cheers,
Ken


From: Zdeněk Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-patches(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Zeugswetter Andreas OSB SD <Andreas(dot)Zeugswetter(at)s-itsolutions(dot)at>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCHES] Fix for large file support (nonsegment mode support)
Date: 2008-03-19 12:39:41
Message-ID: 47E1098D.6070609@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Peter Eisentraut napsal(a):
> Zdenek Kotala wrote:
>> But how it was mentioned in this thread maybe
>> somethink like this "CREATE TABLESPACE name LOCATION '/my/location'
>> SEGMENTS 10GB" should good solution. If segments is not mentioned then
>> default value is used.
>
> I think you would need a tool to resegmentize a table or tablespace offline,
> usable for example when recovering a backup.

Do you mean something like strip(1) command? I don't see any usecase for
terrabytes data. You usually have a problem to find place where you can backup.

> Also, tablespace configuration information is of course also stored in a
> table. pg_tablespace probably won't become large, but it would probably
> still need to be special-cased, along with other system catalogs perhaps.

It is true and unfortunately singularity. Same as database list which is in a
table as well, but it is stored also as a text file for startup purpose. I more
incline to use non table configuration file for tablespaces, because I don't see
any advantage to have it under MVCC control and it allow also to define storage
for pg_global and pg_default.

> An then, how to coordindate offline resegmenting and online tablespace
> operations in a crash-safe way?
>
> Another factor I just thought of is that tar, commonly used as part of a
> backup procedure, can on some systems only handle files up to 8 GB in size.
> There are supposed to be newer formats that can avoid that restriction, but
> it's not clear how widely available these are and what the incantation is to
> get at them. Of course we don't use tar directly, but if we ever make large
> segments the default, we ought to provide some clear advice for the user on
> how to make their backups.

I think tar is OK - minimal on Solaris. See man largefile.

Default segment size still should be 1GB. If DBA makes a decision to increase
this to higher value, then it is his responsibility to find way how to process
this big files.

Zdenek