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 1jR2im-0000vQ-Cd for pgsql-hackers@arkaria.postgresql.org; Tue, 21 Apr 2020 23:54:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jR2ik-0006fM-Tx for pgsql-hackers@arkaria.postgresql.org; Tue, 21 Apr 2020 23:54:30 +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 1jR2ik-0006fF-N1 for pgsql-hackers@lists.postgresql.org; Tue, 21 Apr 2020 23:54:30 +0000 Received: from mail-qt1-x841.google.com ([2607:f8b0:4864:20::841]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jR2ih-0001yV-Rj for pgsql-hackers@postgresql.org; Tue, 21 Apr 2020 23:54:29 +0000 Received: by mail-qt1-x841.google.com with SMTP id x8so256280qtp.13 for ; Tue, 21 Apr 2020 16:54:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=zVIG1lgdqBfk0LW6H309ag3ihjUiIDijQFvRgonp85k=; b=h2AdUsOFMC02JzfmcsW1XziTljY5xA7sSc834Ca+SShdnHZwR808Hx1cZkhIP5KNCu V6f8EwMqitDJXAa8LX5njApKIL+sZLRNBYf9GFmnaDeNYrBDEmtfK8Z21i1jCxj/KatW 9/QCT3Ygm3aRxMLqMTb8Gi5mtFGkgTKyb8EAhTMwLDmVCKEdi9o9bi9IlB8wSGecfAs7 Sl6aOkIuSY4lrQRWPeeHrokTpFWO1j6H4pJKXkNOAWAFXrZ7eT7cIqdgCxrw6KS14Kcq lwId4tHu0L8D7cnHZnQRougI9QWaKdw5TPK3hJsQpfYt1Ywb0EDOuy/8i2i2eRxZvpfi e2IA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=zVIG1lgdqBfk0LW6H309ag3ihjUiIDijQFvRgonp85k=; b=lh491xO1SDmB4CZAWiQdGj9OMyT9pZk8v3XwN7mznF56FuD7Lawgcq152LI6Itie9D qajlcGuae0VLkoi78L4VNswWWpa1Gun8u8rbV0D/rSRI2bC3EQcTD0JUVcvzIX/gnh+e l9eDCSS0lhK9OTnuIoOHTPK0COQ6399k3MwYuamaH2GJo4ibB1NyTgUK1xpgP/iUaTYj WWSWrwGy1KyLoW/lVaqbcQfEKXai+O061o9iST6iFBLY0rFL0N9fHE7t48m4F/u6iz0o fM/C9FaSS1DQAhDDyxpMazkDFsDsgNkN7GrT/9KjLFJ95UTDvgIlQdEav2Fm9lN1l5T2 RDig== X-Gm-Message-State: AGi0PubEDOKuWmkfVjrnQBS/R92+LZZ8IKU85vH9Sg0dPzIGeX2IcvdW kECLnKIvwtM65tbOBt/t7rbSwtY3rrNS5g== X-Google-Smtp-Source: APiQypInG2ORdsXMNtT7rR/QDNC0ZjMeOx8casBY5/61jbF3N1z0bgz4ZoRDt+HEhuRn9oDrhDibpw== X-Received: by 2002:aed:33a4:: with SMTP id v33mr22818249qtd.289.1587513266087; Tue, 21 Apr 2020 16:54:26 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([190.95.18.252]) by smtp.gmail.com with ESMTPSA id c23sm2751572qka.12.2020.04.21.16.54.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Apr 2020 16:54:25 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id D29CC3007EB; Tue, 21 Apr 2020 19:54:22 -0400 (-04) Date: Tue, 21 Apr 2020 19:54:22 -0400 From: Alvaro Herrera To: Antonin Houska Cc: Andres Freund , Michael Paquier , pgsql-hackers@postgresql.org Subject: Re: 2pc leaks fds Message-ID: <20200421235422.GA28667@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <70539.1586332821@antos> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-Apr-08, Antonin Houska wrote: > Specifically for 2PC, isn't it better to close some OS-level FD of an > unrelated table scan and then succeed than to ERROR immediately? Anyway, > 0dc8ead46 hasn't changed this. I think for full generality of the interface, we pass a "close" callback in addition to the "open" callback. But if we were to pass it only for WALRead, then there would be no way to call it during XLogReaderFree. I think the fix Andres applied is okay as far as it goes, but for the long term we may want to change the interface even further -- maybe by having these functions be part of the XLogReader state struct. I have this code paged out of my head ATM, but maybe tomorrow I can give it a little think. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services