From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Losing data because of problematic configuration?
Date: Tue, 15 Jun 2021 06:07:57 -0500
Message-ID: <328bf795-e499-4272-d1f7-e273ea0d4b9a@gmail.com> (raw)
In-Reply-To: <dd6486da33414ed48a9a314441716f3c@bih-charite.de>
References: <dd6486da33414ed48a9a314441716f3c@bih-charite.de>
On 6/15/21 5:42 AM, Holtgrewe, Manuel wrote:
>
> Hi,
>
>
> I have a database that is meant to have high-performance for bulk insert
> operations. I've attached my postgres.conf file.
>
>
> However, I'm seeing the following behaviour. At around 12:04, I have
> started the database. Then, I did a bulk insert and that completed.
>
What kind of transaction did you use?
Did you commit the transaction?
> I then went on to kill postgres processes at 12:33 with SIGSEGV signal.
>
Why?
Did you CHECKPOINT beforehand?
(I'm hypothesizing that data didn't get flushed to disk, and so Pg "cleaned
itself up" after the crash.)
> I'm getting the following log excerpt:
>
>
> *< 2021-06-15 12:33:03.656 CEST > LOG: database system was interrupted;
> last known up at 2021-06-15 12:04:13 CEST*
> < 2021-06-15 12:33:03.656 CEST > DEBUG: removing all temporary WAL segments
> < 2021-06-15 12:33:04.525 CEST > DEBUG: checkpoint record is at 60/7C377C78
> [snip]
> < 2021-06-15 12:33:04.537 CEST > DEBUG: resetting unlogged relations:
> cleanup 1 init 0
> < 2021-06-15 12:33:04.553 CEST > DEBUG: unlinked file "base/16384/107877"
> [... snip ... ]
> < 2021-06-15 12:33:27.556 CEST > DEBUG: copying base/16384/80948_init to
> base/16384/80948
> < 2021-06-15 12:33:36.705 CEST > DEBUG: performing replication slot
> checkpoint
> < 2021-06-15 12:33:38.394 CEST > DEBUG: attempting to remove WAL segments
> older than log file 00000000000000600000007C
> < 2021-06-15 12:33:38.394 CEST > DEBUG: removing write-ahead log file
> "00000001000000600000007C"
> < 2021-06-15 12:33:38.403 CEST > DEBUG: MultiXactId wrap limit is
> 2147483648, limited by database with OID 1
> < 2021-06-15 12:33:38.419 CEST > DEBUG: oldest MultiXactId member is at
> offset 1
> < 2021-06-15 12:33:38.419 CEST > DEBUG: MultiXact member stop limit is
> now 4294914944 based on MultiXact 1
> < 2021-06-15 12:33:38.428 CEST > DEBUG: shmem_exit(0): 1
> before_shmem_exit callbacks to make
> < 2021-06-15 12:33:38.428 CEST > DEBUG: shmem_exit(0): 5 on_shmem_exit
> callbacks to make
>
>
> So it looks as if the database jumps back "half an hour" to ensure
> consistent data. Everything in between is lost.
>
>
> What would be configuration settings to look into to make this more
> stable? Is there a way to "force flush state to disk" from the
> application/through postgres API/SQL?
>
>
> Thank you,
>
> Manuel
>
>
--
Angular momentum makes the world go 'round.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: ronljohnsonjr@gmail.com
Subject: Re: Losing data because of problematic configuration?
In-Reply-To: <328bf795-e499-4272-d1f7-e273ea0d4b9a@gmail.com>
References: <dd6486da33414ed48a9a314441716f3c@bih-charite.de> <328bf795-e499-4272-d1f7-e273ea0d4b9a@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox