Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fnpD7-0006Oi-Oa for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Aug 2018 17:58:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fnpD6-000360-6l for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Aug 2018 17:58:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fnpD5-00035t-W2 for pgsql-hackers@lists.postgresql.org; Thu, 09 Aug 2018 17:58:56 +0000 Received: from mail-qk0-x243.google.com ([2607:f8b0:400d:c09::243]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fnpD2-0005zk-1V for pgsql-hackers@postgresql.org; Thu, 09 Aug 2018 17:58:55 +0000 Received: by mail-qk0-x243.google.com with SMTP id x192-v6so4642790qkb.3 for ; Thu, 09 Aug 2018 10:58:51 -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=JLQ2x1/4jIR8ZvQJetGaaJBVsEPA8siSySk69l14ABU=; b=mVJplD5zk24VXkDw+PPya/kURE6y2r5jLW46Cb7Stwh3hB/J157TmvYkydJCZRLQkq 3x7PNjiSRISC/ryhFG0q9O5OhMGApMbStoRPSJ8ovNDPhSRHKzTD9VX8RArY4R7r2AWs R9qsdwUh3HJ5bJG/2YvhjNKZJlEX/7veTMsWFDDOn29/pYsp44aKgZDieKPqDzZg5yXH TDssT8vLhe5A8uF9TURa++QGiwjdsuww8dwmXZSRe17gp9czcGW5LwtkRDXt++0eYJPT HwiVDMxoChqdYnQA62cB1vYFTGrJBO3R8GIlf31NbspZvsqUSbt2Rgexyeit4J5M4gLX ujdA== 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=JLQ2x1/4jIR8ZvQJetGaaJBVsEPA8siSySk69l14ABU=; b=BAmR4HJmDGcYQGq4rV3pWY+ZZk2fagXmtaWmdvLNNj7gFuYW4COdfos6nbLNN4PZWM mCpmMa/nLC5jqxoG+iSqCdhPJtQ/Ms+3o0/9Onq9K7PyKJ1DNok0Z7auzp//bNBihDse AtRWLnKRlabFVE0AMt0/ojuSov8IYWbc3JsI6vjd9nKm8TMZl7BRhgeSiA+XXSMqTUt6 N+UfuskmM95Mez5WWldUUSN87f66kSDFwHFauuPDWpCOqn8lY4/0uPXqtJSHfI4+ERUH n3vIz8f8MUZCFmM2PSYOiytUCfHw/I3QGyxWKIMRBDSaPw+6i0EUsm8Q53q/eldJTqOU mhag== X-Gm-Message-State: AOUpUlFV0hgGhhrHXEGybLi9RRZOotDh82gTf1lkpDcPQnP7VJ/nnCOS GIqwj6I1HB7zVsVIewoN/dKNCQ== X-Google-Smtp-Source: AA+uWPx+YKA1Bs+2ix8Te8tism8Y1L/4wScjdFRoylX7duscNSyr87GmpcJ8fLnY7EmunHftD/2kpw== X-Received: by 2002:a37:e305:: with SMTP id y5-v6mr2941308qki.394.1533837529288; Thu, 09 Aug 2018 10:58:49 -0700 (PDT) Received: from alvin.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id t3-v6sm3714253qto.26.2018.08.09.10.58.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Aug 2018 10:58:48 -0700 (PDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id B11C7465; Thu, 9 Aug 2018 13:58:46 -0400 (-04) Date: Thu, 9 Aug 2018 13:58:46 -0400 From: Alvaro Herrera To: Tom Lane Cc: Tomas Vondra , PostgreSQL-development Subject: Re: logical decoding / rewrite map vs. maxAllocatedDescs Message-ID: <20180809175846.gyycn5rgbo7eksy5@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <12170.1533836537@sss.pgh.pa.us> User-Agent: NeoMutt/20170306-137-4415bd-dirty (1.8.0) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2018-Aug-09, Tom Lane wrote: > It sounds like whoever wrote that code was completely impervious to the > API spec for AllocateFile(): > > * Note that files that will be open for any significant length of time > * should NOT be handled this way, since they cannot share kernel file > * descriptors with other files; there is grave risk of running out of FDs > * if anyone locks down too many FDs. > > Perhaps these files should be accessed through fd.c's VFD infrastructure > rather than ignoring it. Reinventing it is especially not the way to go. Ah, right. Maybe ReorderBufferRestoreChanges should use PathNameOpenFile / FileRead ... -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services