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 1ksaqR-0002ZW-DX for pgsql-bugs@arkaria.postgresql.org; Fri, 25 Dec 2020 00:20:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ksaqP-0004dW-Af for pgsql-bugs@arkaria.postgresql.org; Fri, 25 Dec 2020 00:20:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ksaqP-0004dP-2b for pgsql-bugs@lists.postgresql.org; Fri, 25 Dec 2020 00:20:33 +0000 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ksaqM-0003lN-Em for pgsql-bugs@lists.postgresql.org; Fri, 25 Dec 2020 00:20:32 +0000 Received: by mail-pj1-x102f.google.com with SMTP id w1so2771211pjc.0 for ; Thu, 24 Dec 2020 16:20:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:to:subject:from:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=7IyMk28/4jPqmBy0ISwfRj6odewgVVczwGZMLFgtmFU=; b=VcmazyzAb7eOiZPq9fDnXTl64HWkX3YLB9Sp5omh1ayni8ysqZ9D9WZZ6mkvDpGj3+ RRV5XleQTmIYCU0I4Xw5BPNbTbVLCH/sSnftPGG25Rf++L3M9FMP99RErEBk/0hfnptl WJxjdK+bb0fGSQNeuwR7T6DBhRGqSCt2H6yp8mcx1t+QcqzCmm/eBGANwfqfIooLM5/a OVFsdUYK4v7VkeEFBByE7briL6CFBOiRe1gtSoCSEiV1+W2+hRLo4ioWX7Ha9cOnJw0H PqkbRdoPFFOpEF21Dp8kw/U7/spD4KbPWKwQ37ADGDIqrmVU0WIS+NabF0D9dRUxJVAz gYHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:to:subject:from:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=7IyMk28/4jPqmBy0ISwfRj6odewgVVczwGZMLFgtmFU=; b=lAGZKK8aU+ugEmtiaJkiEmIT8FCV2kll3Z9xpuk8AkkK+0HqvsHKUiEvJvFftJc4Td eL+2prTlOKQXk68YS3pTsNj6MY2moxNGb37tIorSgi2HcbSsXSIyrBBxcm0OCgkHBE2P ixM1RTKWdlIjuB6rptAqHZwYoNGZ350HXbR7XIL5dQe8ZysiF5KtidG15e4/QtO1DrZT GusyQLnOsEpYsDxyXsacIxOch7igJax3yBI3kXYpxUywYCWLlcO2O5Ik5yFSHuGML0rb 1nOfcfugPJH6vInwfU3rOBDkqB4JjSHCzEfGhFJNnOHU1cSuwbrLGzqWYhQQiZkJC89M o+kg== X-Gm-Message-State: AOAM531NjNxyuZC3h+koYxYOZ+jI0nM5Im67mGWby8B6130Z3c5Rw5Gu Mh+iJd6myVuKraDBxY52xmzt5Gh61m8= X-Google-Smtp-Source: ABdhPJwUjqFvim70YvZTEOCiPL7zAjD3rY1G1DJVpKcAYLcKaD4tWNFGAbvRBy+WzRkCb9l+IAP9NA== X-Received: by 2002:a17:90a:4042:: with SMTP id k2mr6537853pjg.160.1608855628260; Thu, 24 Dec 2020 16:20:28 -0800 (PST) Received: from localhost (KD036014041111.ppp-bb.dion.ne.jp. [36.14.41.111]) by smtp.gmail.com with ESMTPSA id 77sm27725080pfx.156.2020.12.24.16.20.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 24 Dec 2020 16:20:27 -0800 (PST) Date: Fri, 25 Dec 2020 09:20:25 +0900 (JST) Message-Id: <20201225.092025.358717070845212934.horikyota.ntt@gmail.com> To: bchen90@163.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16771: Server process killed by signal 9, after recovery drop tablespace failed From: Kyotaro Horiguchi In-Reply-To: <16771-cbef7d97ba93f4b9@postgresql.org> References: <16771-cbef7d97ba93f4b9@postgresql.org> User-Agent: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello. At Fri, 11 Dec 2020 11:34:47 +0000, PG Bug reporting form wrote in > The following bug has been logged on the website: > > Bug reference: 16771 > Logged by: Bo Chen > Email address: bchen90@163.com > PostgreSQL version: 11.8 > Operating system: euleros v2r7 x86_64 > Description: > > hi > > I encounter a problem of drop tablespace failed for reasion 'tablespace is > not empty'. The problem occurs in the following scenarios: > > I start a transaction to create some table located in an alreaedy created > tablespace, before the transaction commits, the process of creating data is > killed by somebady with signal 9. when the database recoveried I try to drop > the tablesapce, it failed for 'tablespace is not empty'. > > Does this bug need to be resolved ? It seems to be a known behavior that hasn't been fixed for a long time. It comes from a mechanism in PostgreSQL called "pending deletes", by which deletion of underlynig files is delayed until commit/abort time. Since the "to-be-deleted at abort" infomation is not persistent, it should be lost if the server crashed before the transaction ends. I happend to be proposing a patch [*1] for another issue and I realized that the approach could solve this issue as well. *1: https://www.postgresql.org/message-id/20201225.091252.53717619425847881.horikyota.ntt%40gmail.com regards. -- Kyotaro Horiguchi NTT Open Source Software Center