Re: Proposing pg_hibernate - Mailing list pgsql-hackers

From Gurjeet Singh
Subject Re: Proposing pg_hibernate
Date
Msg-id CABwTF4XGbpgwmkKt6ezSFVnpF11KmAg5m969twkGoDhnPj-QLA@mail.gmail.com
Whole thread Raw
In response to Re: Proposing pg_hibernate  (Josh Kupershmidt <schmiddy@gmail.com>)
List pgsql-hackers
On Fri, May 30, 2014 at 5:33 PM, Josh Kupershmidt <schmiddy@gmail.com> wrote:
> On Tue, May 27, 2014 at 10:01 PM, Gurjeet Singh <gurjeet@singh.im> wrote:
>
>> When the Postgres server is being stopped/shut down, the `Buffer
>> Saver` scans the
>> shared-buffers of Postgres, and stores the unique block identifiers of
>> each cached
>> block to the disk. This information is saved under the `$PGDATA/pg_hibernator/`
>> directory. For each of the database whose blocks are resident in shared buffers,
>> one file is created; for eg.: `$PGDATA/pg_hibernator/2.postgres.save`.
>
> This file-naming convention seems a bit fragile. For example, on my
> filesystem (HFS) if I create a database named "foo / bar", I'll get a
> complaint like:
>
> ERROR:  could not open "pg_hibernator/5.foo / bar.save": No such file
> or directory
>
> during shutdown.

Thanks for the report. I have reworked the file naming, and now the
save-file name is simply '<integer>.save', so the name of a database
does not affect the file name on disk. Instead, the null-terminated
database name is now written in the file, and read back for use when
restoring the buffers.

Attached is the new version of pg_hibernator, with updated code and README.

Just a heads up for anyone who might have read/reviewed previous
version's code, there's some unrelated trivial code and Makefile
changes as well in this version, which can be easily spotted by a
`diff -r`.

Best regards,
--
Gurjeet Singh http://gurjeet.singh.im/

EDB www.EnterpriseDB.com

Attachment

pgsql-hackers by date:

Previous
From: Hai Qian
Date:
Subject: Re: [GSoC] Clustering in MADlib - status update
Next
From: Michael Paquier
Date:
Subject: Re: pg_stat directory and pg_stat_statements