Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hqIg6-0005Ot-Q9 for pgsql-general@arkaria.postgresql.org; Wed, 24 Jul 2019 14:55:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hqIg5-0007b0-GU for pgsql-general@arkaria.postgresql.org; Wed, 24 Jul 2019 14:55:37 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hqIg5-0007X7-3c for pgsql-general@lists.postgresql.org; Wed, 24 Jul 2019 14:55:37 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1hqIg0-0000Pd-AL for pgsql-general@lists.postgresql.org; Wed, 24 Jul 2019 14:55:35 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 27B9321F76; Wed, 24 Jul 2019 10:55:31 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 24 Jul 2019 10:55:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm3; bh=N AYHQvuPu5PPmgoCM5IEnswM5/t+oeqvs9J18UaQBbw=; b=qBM+gkzH7/hWDgdvC ChGkv7Xaq+DbQo22WvJgoqAN7Ttlcfi8jMKDhy+XX65N62UU/ypt+n8OxQaK7aol QTPjap+1GbGUzv6+K6K7kgNI827hQwbbuUrulKvOFq2SIXZcJqKodlZMHTBAo79O tjGLCfl5M199nfGJOgHh5uq8FMak2iLEKiBBAFIqPE7almhsQSoHTZ8Vsv5NDKMg N5AZX3KGokcmQjJsW5KoGi58iwmiKItJIYJ/rbOLPUSNFMfDAoMkr51JtZzV2QcS E9PZsYGY+2hS1ADrF8bTwmj6TUj8SCgXOZwwoAME8DCebU34rwPxux3NM9QgMrWX QSjlw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=NAYHQvuPu5PPmgoCM5IEnswM5/t+oeqvs9J18UaQB bw=; b=t9pfJ18vG5+vGhIYfEV2dYWczrIJEsvNtjY/IXayJczP0tZg9nxM0O5HM sW/DR0fgEteYyDq44vuofLJneRcQ+czT7hwmuPYH58wdxGK6VXt1DxPkgO9ozUss 0qmoEWMvCreSgUng5mXe7mi1q1JBE7PYQsjkTqWz8PCBkDNEKjTLzSyNYRs5hYLl fI/6jA+OBNVkLag3xVbfegDfjSpiMIOb8qNn+jeYpXXKXvDzoqqrT7rU16+hlWiX g7w4nctShUMtRmRd3n5i8OFhtk8otqfHHh1RtSd6i1cSg0zenKksJyT6o4FnA965 YcFwC+X8ObJrI6VIiSpEeVIKpFKkg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrkedtgdejiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefuvfhfhffkffgfgggjtgfgsehtkeertddtfeejnecuhfhrohhmpeetughrihgr nhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh eqnecukfhppeejuddrvdduvddrudehtddrvddtvdenucfrrghrrghmpehmrghilhhfrhho mheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomhenucevlhhushhtvg hrufhiiigvpedt X-ME-Proxy: Received: from [192.168.1.4] (unknown [71.212.150.202]) by mail.messagingengine.com (Postfix) with ESMTPA id 804188005A; Wed, 24 Jul 2019 10:55:30 -0400 (EDT) Subject: Re: postgres 9.5 DB corruption To: Thomas Tignor , "pgsql-general@lists.postgresql.org" References: <531909537.157210.1563979100115.ref@mail.yahoo.com> <531909537.157210.1563979100115@mail.yahoo.com> From: Adrian Klaver Message-ID: Date: Wed, 24 Jul 2019 07:55:29 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <531909537.157210.1563979100115@mail.yahoo.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 7/24/19 7:38 AM, Thomas Tignor wrote: > Hello postgres community, > > Writing again to see if there are insights on this issue. We have had > infrequent but recurring corruption since upgrading from postgres 9.1 to > postgres 9.5. We are presently on 9.5.16. Our DB-facing app continually > performs a mixture of DML, primarily inserts and updates on two specific > tables, with no single op being suspect. In the past, corruption events > have produced encoding errors on COPY operations (invalid byte sequence > for encoding "UTF8"). More recently, they have caused segmentation > faults. We were able to take a cold backup after a recent event. > SELECTing the corrupted data on our cold backup yields the following > stack. Any info on a solution or how to proceed towards a solution would > be much appreciated. More information would be useful: 1) Schema of the tables. 2) Source of the data. > > Thanks in advance. > > > (gdb) where > #0  pglz_decompress (source=source@entry=0xa617904 "0", slen=8139, dest=dest@entry=0x4268e028 "", rawsize=808452096) at pg_lzcompress.c:745 > #1  0x080f3079 in toast_decompress_datum (attr=0xa6178fc) at tuptoaster.c:2210 > #2  0x080f3716 in heap_tuple_untoast_attr (attr=0xa6178fc) at tuptoaster.c:183 > #3  0x08440955 in pg_detoast_datum_packed (datum=) at fmgr.c:2270 > #4  0x084145bf in text_to_cstring (t=0x7592fd2a) at varlena.c:176 > #5  0x0843e874 in FunctionCall1Coll (flinfo=flinfo@entry=0xa614738, collation=collation@entry=0, arg1=arg1@entry=1972567338) at fmgr.c:1297 > #6  0x0843fef8 in OutputFunctionCall (flinfo=0xa614738, val=1972567338) at fmgr.c:1950 > #7  0x080bf84b in printtup (slot=0xa613bf4, self=0xa60d714) at printtup.c:359 > #8  0x08220f9a in ExecutePlan (dest=0xa60d714, direction=, numberTuples=0, sendTuples=, operation=CMD_SELECT, planstate=0xa613974, estate=0xa6138ec) at execMain.c:1574 > #9  standard_ExecutorRun (queryDesc=0xa6134e4, direction=ForwardScanDirection, count=0) at execMain.c:337 > #10 0x08332c1b in PortalRunSelect (portal=portal@entry=0xa6114dc, forward=forward@entry=1 '\001', count=0, count@entry=2147483647, dest=dest@entry=0xa60d714) at pquery.c:942 > #11 0x08333fa7 in PortalRun (portal=portal@entry=0xa6114dc, count=count@entry=2147483647, isTopLevel=isTopLevel@entry=1 '\001', dest=dest@entry=0xa60d714, altdest=altdest@entry=0xa60d714, completionTag=completionTag@entry=0xffd5d71c "") >     at pquery.c:786 > #12 0x08330ba8 in exec_simple_query (query_string=0xa5f1754 "select * from ams.alert_attribute_bak;") at postgres.c:1096 > #13 PostgresMain (argc=1, argv=0xa53dbbc, dbname=0xa53daec "ams", username=0xa53dadc "akamai") at postgres.c:4049 > #14 0x080b53af in BackendRun (port=0xa584b78) at postmaster.c:4312 > #15 BackendStartup (port=0xa584b78) at postmaster.c:3986 > #16 ServerLoop () at postmaster.c:1705 > #17 0x082d0dd7 in PostmasterMain (argc=argc@entry=3, argv=argv@entry=0xa53d2a8) at postmaster.c:1313 > #18 0x080b68eb in main (argc=3, argv=0xa53d2a8) at main.c:228 > (gdb) > > > > Tom    :-) -- Adrian Klaver adrian.klaver@aklaver.com