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 1nCtc4-0003kG-3t for pgsql-general@arkaria.postgresql.org; Thu, 27 Jan 2022 01:30:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nCtc3-0000Gi-17 for pgsql-general@arkaria.postgresql.org; Thu, 27 Jan 2022 01:30:11 +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 1nCtc2-0000GM-MA for pgsql-general@lists.postgresql.org; Thu, 27 Jan 2022 01:30:10 +0000 Received: from dog.elm.relay.mailchannels.net ([23.83.212.48]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nCtbz-0006s4-FC for pgsql-general@postgresql.org; Thu, 27 Jan 2022 01:30:09 +0000 X-Sender-Id: a2hosting|x-authuser|bench@silentmedia.com Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 167FC2817EA for ; Thu, 27 Jan 2022 01:30:05 +0000 (UTC) Received: from a2ss24.a2hosting.com (unknown [127.0.0.6]) (Authenticated sender: a2hosting) by relay.mailchannels.net (Postfix) with ESMTPA id 904FB2817AF for ; Thu, 27 Jan 2022 01:30:04 +0000 (UTC) X-Sender-Id: a2hosting|x-authuser|bench@silentmedia.com Received: from a2ss24.a2hosting.com (a2ss24.a2hosting.com [75.98.175.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384) by 100.121.92.88 (trex/6.4.3); Thu, 27 Jan 2022 01:30:05 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: a2hosting|x-authuser|bench@silentmedia.com X-MailChannels-Auth-Id: a2hosting X-Left-Imminent: 7c59d7d07c613552_1643247004950_19601565 X-MC-Loop-Signature: 1643247004950:1887274380 X-MC-Ingress-Time: 1643247004950 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=silentmedia.com; s=default; h=Content-Type:MIME-Version:Date:Message-ID: Subject:From:To:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=fgbWyjJvEtU/yN5xCLRa7NFyEzlVE37CW1xOCaUmlyk=; b=ubVdldi5b5cA14lpoxq0Yku1Jj XvSiRaeEHuRvZAGB2sd5fKygCzB5zF5wJ1HQQM776bkRlh9LO6kPrJDVFHd+5x67kO/Uncf9G7W1j uzY9TAA3m00TTI/nlSNNcR7RH3k++9NNTuA+0Guwa+gbdGnyjuIVCM3aUSbgq0ELUC1egJwBVcD+Q mHsxKtXqLzte2+StRYs2LwD6ykVjvZmkcBKU5bnGhimM5d1w/NTIs8pAsB/CGpVroc3Zrov/TFh5p Y20saGTAlE/oWL5ENSuXLHFnsgEfyqxaUQ7Esza6U0VYIJmGWj/83GSlAFsQTLSqJeIU5lPjK5MBl ZEljJquw==; Received: from 97-113-88-109.tukw.qwest.net ([97.113.88.109]:59517 helo=Rolo.local) by a2ss24.a2hosting.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1nCtbG-00DVRE-NM for pgsql-general@postgresql.org; Wed, 26 Jan 2022 20:30:03 -0500 To: pgsql-general From: Ben Chobot Subject: could not open relation with OID Message-ID: <93f68bda-97d2-9944-3e09-2045339b71ab@silentmedia.com> Date: Wed, 26 Jan 2022 17:30:01 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:52.0) Gecko/20100101 PostboxApp/7.0.54 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------16958AE822EF7C6FAE8680A4" Content-Language: en-US X-AuthUser: bench@silentmedia.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------16958AE822EF7C6FAE8680A4 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit We do a lot of queries per day, over a lot of hosts, all of which are on 12.9. We've recently started doing a better job at analyzing our db logs and have found that, a few times a day, every day, we see some of our queries fail with errors like: could not open relation with OID 201940279 In the cases we've examined so far, the failed query succeeds just fine when we run it manually. The failed query also had run on an async streaming replica, and the primary has completed at least one autovacuum since the failure. I don't know if either of those two facts are relevant, but I'm not sure what else to blame. The internet seems to want to blame issues like this on temp tables, which makes sense, but in our case, most of the queries that are failing this way are simple PK scans, which then fall back to the table to pull all the columns. The tables themselves are small in row count - although some values are likely TOASTed - so I would be surprised if anything is spilling to disk for sorting, which might have counted as a temp table enough to give such an error. This is a minuscule failure percentage, so replicating it is going to be hard, but it is still breaking for reasons I don't understand, and so I'd like to fix it. Has anybody else seen this, or have an ideas of what to look at? Other things we've considered:     - we run pg_repack, which certainly seems like it could make an error like this, but we see this error in places and times that pg_repack isn't currently running     - although all our servers are currently on 12.9, I don't think this is a new error for us. I believe we might have seen it on previous minor versions of 12 and probably on 9.5 as well.     - our filesystem is xfs and seems reliable. I would expect that if it was a filesystem level error, it would not be so transient. We do, occasionally, expand our filesystems, but not at all the times we've seen this error. --------------16958AE822EF7C6FAE8680A4 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit We do a lot of queries per day, over a lot of hosts, all of which are on 12.9. We've recently started doing a better job at analyzing our db logs and have found that, a few times a day, every day, we see some of our queries fail with errors like:

could not open relation with OID 201940279

In the cases we've examined so far, the failed query succeeds just fine when we run it manually. The failed query also had run on an async streaming replica, and the primary has completed at least one autovacuum since the failure. I don't know if either of those two facts are relevant, but I'm not sure what else to blame. The internet seems to want to blame issues like this on temp tables, which makes sense, but in our case, most of the queries that are failing this way are simple PK scans, which then fall back to the table to pull all the columns. The tables themselves are small in row count - although some values are likely TOASTed - so I would be surprised if anything is spilling to disk for sorting, which might have counted as a temp table enough to give such an error.

This is a minuscule failure percentage, so replicating it is going to be hard, but it is still breaking for reasons I don't understand, and so I'd like to fix it. Has anybody else seen this, or have an ideas of what to look at?

Other things we've considered:
    - we run pg_repack, which certainly seems like it could make an error like this, but we see this error in places and times that pg_repack isn't currently running
    - although all our servers are currently on 12.9, I don't think this is a new error for us. I believe we might have seen it on previous minor versions of 12 and probably on 9.5 as well.
    - our filesystem is xfs and seems reliable. I would expect that if it was a filesystem level error, it would not be so transient. We do, occasionally, expand our filesystems, but not at all the times we've seen this error.

--------------16958AE822EF7C6FAE8680A4--