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 1lKHPE-0005Jn-CH for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Mar 2021 09:14:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lKHPC-0004x3-PU for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Mar 2021 09:14:54 +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 1lKHPC-0004ww-FW for pgsql-hackers@lists.postgresql.org; Thu, 11 Mar 2021 09:14:54 +0000 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lKHP9-0006ws-6E for pgsql-hackers@postgresql.org; Thu, 11 Mar 2021 09:14:53 +0000 Received: by mail-wm1-x329.google.com with SMTP id 124-20020a1c00820000b029010b871409cfso12709646wma.4 for ; Thu, 11 Mar 2021 01:14:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=wg3tdqW8V53hUubmDtj3Bw/O8dQq/xMOJu+YK8rP4E8=; b=UfvXToBiI/Q1a8zBS3iJsFGyQrEk4s2Qr2GSpAHevPcAEyCkHCpq8sRsVEU20Q14Hz s+nNlb8lLWLzpid118/ZFfphusN5YFl6PGbUUmsVl9+29C4kPr7x9EqPCssX/nUt7pZx yauHGHWP6tqUyGfRP7cCB7BmEtPv9kWvtxF6m8vPfFh/LNpc3yHvoW1s52dV5RRGR5I4 nO4/9uM24/giugZQOx33uoh9tyn0WeUyye8CJ6MXtBemK/j+c24iw3IjEHDRm6VUWEnn CZMP0mm6bjKNvfcreIWYzGGeqHeS8OzwLk6vuUWEFkr4fGc2Atq6Ah5sbPgAnpZ8hCfJ YQYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=wg3tdqW8V53hUubmDtj3Bw/O8dQq/xMOJu+YK8rP4E8=; b=s9Nzzbu3Ks9W5Rkc/xXWn+CEq94vzu7i+IbMkqcobpcvSfCTayoie7TrvVbXCeFIL1 byUfd6p5bxz4pdk6MnitODBAczXvD7Tx9oJpNXEiNmxo2F0NykUvY0J8OKPxes+9gd0I D3WnLuYlywBbFmQ7poUFzwM6zvkHw+SGh/K8zwuWgQjmU83O/721zIBfDIPe1eFJVebM BcL3wEqd44awwUfujvzzZPNN8/4r30SNOjjGJXXLDsc3RMIuSXVZgS3YLJF/Wk9Mkjj5 4bLHAcKpZjtNEIvY7rlwiKoa9o8QyItmQK1j0XTavLPyZtE+i51iBtDGQR/ZkI1vlj0j 72HQ== X-Gm-Message-State: AOAM532AM8ckgW4wIiVBaUL5NaJf4xSA7AfX2ICwgdXvMgRbomc00yoj nDT8uAhFDjDXsTR/ZhnwEiAvtxpYKVQmwjGK25m2xHZ44OWxenG7YJkfK9/3LoyEMB0UpMjwKLi 9dmS3DGhWUz5CukK0NEhMuJF7yhu4+LXHkkVD/FWIlzZKgygBlcqG8sqrDnyIZgOv6mFLexRxVG xr/VdI8GchaVg6VRjQ2HNtvvKFPYaIWulE57bp X-Google-Smtp-Source: ABdhPJwWppuflC7QcM7cQAeHjZ5BbhuA/3NInQyevYyf1LfO7sc2bXsArNgb6R4TC2If7+tbsg90Qw== X-Received: by 2002:a1c:c244:: with SMTP id s65mr7193122wmf.96.1615454090011; Thu, 11 Mar 2021 01:14:50 -0800 (PST) Received: from [10.80.10.41] ([185.110.89.141]) by smtp.gmail.com with ESMTPSA id a13sm1029352wrp.31.2021.03.11.01.14.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 Mar 2021 01:14:49 -0800 (PST) Subject: Re: [PATCH] Provide more information to filter_prepare To: Amit Kapila Cc: "pgsql-hackers@postgresql.org" , Ajin Cherian References: From: Markus Wanner Message-ID: Date: Thu, 11 Mar 2021 10:14:48 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 11.03.21 04:58, Amit Kapila wrote: > But this happens when we are decoding prepare, so it is clear that the > transaction is prepared, why any additional check? An output plugin cannot assume the transaction is still prepared and uncommitted at the point in time it gets to decode the prepare. Therefore, the transaction may or may not be still in progress. However, my point is that the xid is the more generally useful identifier than the gid. > What in this can't be done with GID and how XID can achieve it? It's a convenience. Of course, an output plugin could lookup the xid via the gid. But why force it to have to do that when the xid would be so readily available? (Especially given that seems rather expensive. Or how would an extension lookup the xid by gid?) The initial versions by Nikhil clearly did include it (actually a full ReorderBufferTXN, which I think would be even better). I'm not clear on your motivations to restrict the API. What's clear to me is that the more information Postgres exposes to plugins and extensions, the easier it becomes to extend Postgres. (Modulo perhaps API stability considerations. A TransactionId clearly is not a concern in that area. Especially given we expose the entire ReorderBufferTXN struct for other callbacks.) Regards Markus