Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ltSKP-0006IT-7o for pgsql-general@arkaria.postgresql.org; Wed, 16 Jun 2021 09:59:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ltSKM-00008G-Uk for pgsql-general@arkaria.postgresql.org; Wed, 16 Jun 2021 09:59:18 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ltSKM-000087-HW for pgsql-general@lists.postgresql.org; Wed, 16 Jun 2021 09:59:18 +0000 Received: from mail-cbf-ext.charite.de ([193.175.73.208]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ltSKK-0005Jr-0Q for pgsql-general@lists.postgresql.org; Wed, 16 Jun 2021 09:59:17 +0000 Received: from exchange.charite.de (s-mx14-ht02.charite.de [10.32.37.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail-cbf.charite.de (Postfix) with ESMTPS id 4G4gdC3Kj3z20kvC; Wed, 16 Jun 2021 11:59:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bih-charite.de; s=jan2021; t=1623837551; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ZkkTlvSXpboU0vk/c87Maqu3TS6g4kfTqceft0deu40=; b=LO6Wa+ZHhPBxtrN29Lfba+MRQLcnGJq5xfbtzV7QGJcbr9GYuomzA/SeEcWCLgZNWi6b9/ Tg6Jd4GVN7slqAAEaWBzxWPqgQT3c+S8bVbzXAjvZ+XbWv7+EuzPtcWMzImjCRecVBf1/f D2zq8cOIQSY30cjhPOMWgEZBpeGYC1J36Jl3c/4yy+EYy7+I0n7VT94KeBi6hTUaUJayy7 orBf3gPHocFOhg3AS81QTEEZoA/YT8RTYONY1OSs+CCOeglXA7MvTwtJ+Z1l1w/kDjWici 5MJr0LfdwtMP6wO0qJ3qNK7bvrkTvaMXY3bhF9OfW+ttfZy4VyDhbBGGy1Lijg== Received: from s-mx16-bih02.charite.de (10.32.83.24) by s-mx14-ht02.charite.de (10.32.37.106) with Microsoft SMTP Server (TLS) id 14.3.487.0; Wed, 16 Jun 2021 11:59:11 +0200 Received: from s-mx16-bih01.charite.de (10.32.83.23) by s-mx16-bih02.charite.de (10.32.83.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Wed, 16 Jun 2021 11:59:10 +0200 Received: from s-mx16-bih01.charite.de ([fe80::a4ac:ef94:4cc6:8783]) by s-mx16-bih01.charite.de ([fe80::a4ac:ef94:4cc6:8783%9]) with mapi id 15.01.2242.008; Wed, 16 Jun 2021 11:59:10 +0200 From: "Holtgrewe, Manuel" To: Tom Lane CC: "pgsql-general@lists.postgresql.org" Subject: Re: [ext] Re: Losing data because of problematic configuration? Thread-Topic: [ext] Re: Losing data because of problematic configuration? Thread-Index: AQHXYdLD/rK5fCc4M0OgzI3xWiaLdasU8pCAgABGbv6AAR0vx4AAEpsM Date: Wed, 16 Jun 2021 09:59:10 +0000 Message-ID: References: ,<354782.1623764371@sss.pgh.pa.us>,,<979b9abe88e24ab989a199a312348779@bih-charite.de> In-Reply-To: <979b9abe88e24ab989a199a312348779@bih-charite.de> Accept-Language: en-US, de-DE Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.32.83.246] Content-Type: multipart/alternative; boundary="_000_a983ed6d6b5140adbca00d4b4b5fc649bihcharitede_" MIME-Version: 1.0 ARC-Seal: i=1; s=jan2021; d=bih-charite.de; t=1623837551; a=rsa-sha256; cv=none; b=oHvsoj1ybMW7nJVDoB6hzfE1SfBIGJkYAsKzt/jzm7A/G47ncm3bt2Ixn5SwIX6aG6cgwp B4KPS3571sJLCLUUXWhKj/7vVVUeJxpIISOmfTHBowf1qYfQtgERRpRvxLGFXD+6+NMJse ftyPz107HrDd6N+2ihZKsjsRKbuQkK6Kd3J9wfQJn32OGwUwGO8nXQOt1k3+Bd0rw4i1P4 or5xzugS+CookckdtdA22WdLNLR9QvjbG0Uzq1HH0HVbQJeVV9jv+GpGVy/O/thTAJJ+xe WwZgeg3m0biiCgA3oDPLTVyWX4kXtX09q3g9Rq1J+/1iPN9FSpT6AXiKyOVjgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=bih-charite.de; s=jan2021; t=1623837551; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ZkkTlvSXpboU0vk/c87Maqu3TS6g4kfTqceft0deu40=; b=g94xlQL+95YPeEKoJJqwz7mW3AveLvZqv2FZ4P5R9viGfmsqO5jMs557Xh+XsWRZ57dQIt pkXM9RZe2a/0C+57Y7Jc6mmmAtaYHH+a3b5DAfgXUdvzv+h0DRklXibgW/TrBgBF7UY8BO B6XEZKEL0q8zlsIjHVVKsqNiihsiAI4IDvGiOJ8AUXDCGsQ/osXBZRto2mhVyRr0zzEX4o Xcp18Y+OvjpPV5CKIBk2oiqdmL73NpJxbpCbyz2wOd0qN/29zqFjXeMraz16Ja01K6kQgH UD4Fpy0fr0VA4/flu8t+Tdb96BE//mQlzJJB5naoqS4LjHVA8Eh1vkycvlcp8w== ARC-Authentication-Results: i=1; mail-cbf.charite.de; none List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --_000_a983ed6d6b5140adbca00d4b4b5fc649bihcharitede_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Please ignore this email. I could not reproduce it after all. -- Dr. Manuel Holtgrewe, Dipl.-Inform. Bioinformatician Core Unit Bioinformatics =96 CUBI Berlin Institute of Health / Max Delbr=FCck Center for Molecular Medicine i= n the Helmholtz Association / Charit=E9 =96 Universit=E4tsmedizin Berlin Visiting Address: Invalidenstr. 80, 3rd Floor, Room 03 028, 10117 Berlin Postal Address: Chariteplatz 1, 10117 Berlin E-Mail: manuel.holtgrewe@bihealth.de Phone: +49 30 450 543 607 Fax: +49 30 450 7 543 901 Web: cubi.bihealth.org www.bihealth.org www.mdc-berlin.de www.charite.de ________________________________ From: Holtgrewe, Manuel Sent: Wednesday, June 16, 2021 10:54:49 AM To: Tom Lane Cc: pgsql-general@lists.postgresql.org Subject: Re: [ext] Re: Losing data because of problematic configuration? Hi again, thank you for pinpointing the issue. I have now updated the table with "ALTER TABLE $table SET LOGGED" (actually= it's a partitioned table and I've altered both the main table and the part= itions). I wanted to double-check the result and what I found out using "select relp= ersistence, relname from pg_class" that, e.g., ${table_name}_383_pkey still= has its relpersistence set to "u" whereas ${table_name}_383 has its relper= sistence set to "p" now. Does anyone have an idea what I'm doing wrong here? Thank you! Manuel ________________________________ From: Holtgrewe, Manuel Sent: Tuesday, June 15, 2021 5:53:54 PM To: Tom Lane Cc: pgsql-general@lists.postgresql.org Subject: Re: [ext] Re: Losing data because of problematic configuration? >> < 2021-06-15 12:33:04.537 CEST > DEBUG: resetting unlogged relations: c= leanup 1 init 0 > > Are you perhaps keeping your data in an UNLOGGED table? If so, resetting > it to empty after a crash is exactly what's supposed to happen. The > entire point of UNLOGGED is that the performance benefits come at the > cost of losing the data on crash. D'oh! Yes, that is the case. I once used this but I was convinced that I took thi= s back in some version. It is not in my main deployment, though. Now I have= to find out (a) why I have diverging deployment and (b) how that bug came = about to be. Thanks a lot! ________________________________ From: Tom Lane Sent: Tuesday, June 15, 2021 3:39:31 PM To: Holtgrewe, Manuel Cc: pgsql-general@lists.postgresql.org Subject: [ext] Re: Losing data because of problematic configuration? "Holtgrewe, Manuel" writes: > So it looks as if the database jumps back "half an hour" to ensure consis= tent data. Everything in between is lost. Postgres does not lose committed data --- if it did, we'd consider that a fairly serious bug. (Well, there are caveats of course. But most of them have to do with operating-system crashes or power loss, neither of which are at stake here.) I am wondering about this though: > < 2021-06-15 12:33:04.537 CEST > DEBUG: resetting unlogged relations: cl= eanup 1 init 0 Are you perhaps keeping your data in an UNLOGGED table? If so, resetting it to empty after a crash is exactly what's supposed to happen. The entire point of UNLOGGED is that the performance benefits come at the cost of losing the data on crash. regards, tom lane --_000_a983ed6d6b5140adbca00d4b4b5fc649bihcharitede_ Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable

Please ignore this email. I could not reproduce it after all.


--
Dr. Manuel Holtgrewe, Dipl.-Inform.
Bioinformatician
Core Unit Bioinformatics =96 CUBI
Berlin Institute of Health / Max Delbr=FCck Center for Molecular Medicine i= n the Helmholtz Association / Charit=E9 =96 Universit=E4tsmedizin Berlin
Visiting Address: Invalidenstr. 80, 3rd Floor, Room 03 028, 10117 Berlin Postal Address: Chariteplatz 1, 10117 Berlin

E-Mail: manuel.holtgrewe@bihealth.de
Phone: +49 30 450 543 607
Fax: +49 30 450 7 543 901
Web: cubi.bihealth.org  www.bihealth.org  www.mdc-berlin.de = www.charite.de

From: Holtgrewe, Manuel <= ;manuel.holtgrewe@bih-charite.de>
Sent: Wednesday, June 16, 2021 10:54:49 AM
To: Tom Lane
Cc: pgsql-general@lists.postgresql.org
Subject: Re: [ext] Re: Losing data because of problematic configurat= ion?
 

Hi again,


thank you for pinpointing the issue.


I have now updated the table with "ALTER TABLE $table SET LOGGED&qu= ot; (actually it's a partitioned table and I've altered both the main table= and the partitions).


I wanted to double-check the result and what I found out using "select relpersistence, relname from pg_class" that, e.g., ${= table_name}_383_pkey still has its relpersistence set to "= ;u" whereas ${table_name}_383 has its relpersistence set to "p" now.


Does anyone have an idea what I'm doing wrong here?


Thank you!


Manuel


From: Holtgrewe, Manuel <= ;manuel.holtgrewe@bih-charite.de>
Sent: Tuesday, June 15, 2021 5:53:54 PM
To: Tom Lane
Cc: pgsql-general@lists.postgresql.org
Subject: Re: [ext] Re: Losing data because of problematic configurat= ion?
 

>> < 2021-06-15= 12:33:04.537 CEST > DEBUG:  resetting unlogged relations: cleanup = 1 init 0
>
> Are you = perhaps keeping your data in an UNLOGGED table?  If so, resetting
> it to em= pty after a crash is exactly what's supposed to happen.  The
> entire p= oint of UNLOGGED is that the performance benefits come at the
> cost of = losing the data on crash.


D'oh!


Yes, that is the case. I once used this but I was convinced that I took = this back in some version. It is not in my main deployment, though. Now I h= ave to find out (a) why I have diverging deployment and (b) how that bug ca= me about to be.


Thanks a lot!



From: Tom Lane <tgl@ss= s.pgh.pa.us>
Sent: Tuesday, June 15, 2021 3:39:31 PM
To: Holtgrewe, Manuel
Cc: pgsql-general@lists.postgresql.org
Subject: [ext] Re: Losing data because of problematic configuration?=
 
"Holtgrewe, Manuel" <manuel.holtgrewe= @bih-charite.de> writes:
> So it looks as if the database jumps back "half an hour" to = ensure consistent data. Everything in between is lost.

Postgres does not lose committed data --- if it did, we'd consider that a fairly serious bug.  (Well, there are caveats of course.  But mos= t of them
have to do with operating-system crashes or power loss, neither of which are at stake here.)

I am wondering about this though:

> < 2021-06-15 12:33:04.537 CEST > DEBUG:  resetting unlogged= relations: cleanup 1 init 0

Are you perhaps keeping your data in an UNLOGGED table?  If so, resett= ing
it to empty after a crash is exactly what's supposed to happen.  The entire point of UNLOGGED is that the performance benefits come at the
cost of losing the data on crash.

            &nb= sp;           regards, to= m lane


--_000_a983ed6d6b5140adbca00d4b4b5fc649bihcharitede_--