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 1kSX6M-0002u8-AY for pgsql-bugs@arkaria.postgresql.org; Wed, 14 Oct 2020 03:05:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kSX6L-0003AI-7N for pgsql-bugs@arkaria.postgresql.org; Wed, 14 Oct 2020 03:05:17 +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 1kSX6K-00039y-VU for pgsql-bugs@lists.postgresql.org; Wed, 14 Oct 2020 03:05:17 +0000 Received: from mail-pj1-x1041.google.com ([2607:f8b0:4864:20::1041]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kSX6I-0003K3-Fx for pgsql-bugs@lists.postgresql.org; Wed, 14 Oct 2020 03:05:16 +0000 Received: by mail-pj1-x1041.google.com with SMTP id h4so780132pjk.0 for ; Tue, 13 Oct 2020 20:05:14 -0700 (PDT) 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=7dfv86sBmR3p9JDL003L2GOGw+k9PgiUWMfxe7j+p4M=; b=GQyg7QHRLMAOUdciQRGmsniilb9+42CntpPaeY1vWPI3vve3+6Z5IKul7UoqZ2TJo1 XXLYT8YZ25GK5cbDdVcuklDnVPYbfr02Oj1p2q7/Avj6s3ljyKBSgNKS8CbFzI51THti orsZRqLZhijhSgHIvcAAS/93mTurko+rwL0glEMH9P2gtImC1YBDhWenzwxeas9piY8b fOK+dNQRC51udKpNKxULQzmRiuBZgVgISkqE0vWvPi9zG8GB+9BvqIheL1qUVdPB57Ue aePLkqVrDYu05VsM3a89JFtXembFPE6lF9qIR++ZKQx5EW6bL5UaL0Ip/GZ5d51ZN05p aRiQ== 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=7dfv86sBmR3p9JDL003L2GOGw+k9PgiUWMfxe7j+p4M=; b=DCZIg6nQhaH0BngGKMapoi9Fd9uVPxwLttW9reat2P5GSbPkRDO//08mBASTd/Vb2x n3o7SL4OLqELRamtdbR/me3mpkRcYEIH0NJmU+AyIpRbsBfGqVUFCarmqo+cy9DvdRop uot1Z3BqslGCCakGd/Ck4Ul5puSdAg1ZcgeKL+M20i/W1nukazWdbkV+1dwqhFAk9ivU sVCBDi79BhBmi6mrJPwU+V9XJzdsD06rG+CWFBnqpf5IW8ncKMacz4uO+G3k4URBB6Wp TbZ63QbmAkbgEa0ER0dKWKAvTqAjSOXB9LAet44HgVALmivOzTGqRGC4X+3Ilycg2QEh ow3A== X-Gm-Message-State: AOAM533ABIKzsjSOmHtOBuDxlpM/GQ9aUrsYUc74+OZoC3CaM1NIOlJa vdHYYz7Nc3poIBTm02a/7n8= X-Google-Smtp-Source: ABdhPJxTfOP5zuoDRmkJZ72Ky11nGQrIfQi2xfDTkZp+QIHSLrULMHoUC5aG6w4474gM7nayasvxQw== X-Received: by 2002:a17:90b:3649:: with SMTP id nh9mr1381680pjb.123.1602644712537; Tue, 13 Oct 2020 20:05:12 -0700 (PDT) Received: from localhost (KD036014041111.ppp-bb.dion.ne.jp. [36.14.41.111]) by smtp.gmail.com with ESMTPSA id c10sm1107997pgl.92.2020.10.13.20.05.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Oct 2020 20:05:11 -0700 (PDT) Date: Wed, 14 Oct 2020 12:05:10 +0900 (JST) Message-Id: <20201014.120510.184391841712786310.horikyota.ntt@gmail.com> To: denis.patron@previnet.it, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16663: DROP INDEX did not free up disk space: idle connection hold file marked as deleted From: Kyotaro Horiguchi In-Reply-To: <16663-fe97ccf9932fc800@postgresql.org> References: <16663-fe97ccf9932fc800@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 This is not a bug. At Fri, 09 Oct 2020 13:24:15 +0000, PG Bug reporting form wrote in > The following bug has been logged on the website: > > Bug reference: 16663 > Logged by: Denis Patron > Email address: denis.patron@previnet.it > PostgreSQL version: 11.9 > Operating system: CentOS 7 > Description: > > I have an index, which at the file system level, is made up of multiple > segments (file: .1, .2 ecc). When I DROP INDEX, the index is dropped > in Postgresql but at the file system level, the segments are marked as > "deleted". if I check with the lsof command, I see that the segments are in > use from an idle connection. This does not happen if the index is formed by > only one segment (in my case <1Gb). How can I prevent this? > thanks That references to deleted files will dissapear at the beginning of the next transaction. At the time a relation including an index is dropped, the first segment file (named as "" without a suffix number) is left behind so the file is not shown as "(deleted)" in lsof output. The next checkpoint removes the first segment. -- Kyotaro Horiguchi NTT Open Source Software Center