Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1umsM2-004zlH-Sx for pgsql-hackers@arkaria.postgresql.org; Fri, 15 Aug 2025 11:12:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1umsM1-00EqiO-70 for pgsql-hackers@arkaria.postgresql.org; Fri, 15 Aug 2025 11:12:13 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1umsM0-00EqiF-JN for pgsql-hackers@lists.postgresql.org; Fri, 15 Aug 2025 11:12:13 +0000 Received: from meesny.iki.fi ([195.140.195.201]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1umsLw-000hum-2h for pgsql-hackers@postgresql.org; Fri, 15 Aug 2025 11:12:11 +0000 Received: from [10.0.2.15] (unknown [130.41.208.2]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: hlinnaka) by meesny.iki.fi (Postfix) with ESMTPSA id 4c3KFK1pw0zyTF; Fri, 15 Aug 2025 14:12:04 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1755256326; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=RzQysNNKy3WVWeHlrJv6ZvM+i6VuQvE7ZgivEsbLwxc=; b=Sk/A11anYM4aXObGCv1vI19PgxyRx4VqDqGsbsazW6k7dpAe9p1wqn00rN5ujh6x6rcm6f UTrlX1luA1KfKGnUsLNgpaeUBaXw7dnAVWc8xRTElayQtKuTf2h6HGf72oxPK8tIodMIGN 24Qqje+8Wj2X4fhqX/0iYXoJUtmbP54= ARC-Seal: i=1; s=meesny; d=iki.fi; t=1755256326; a=rsa-sha256; cv=none; b=u98vvZ193fDElS9K2yTCjKdsY0icfXd4RgAooGR2usXdI7XkqPxRUYmjM39S654PKSFHIJ MI79gO1HihFn5benkfENczDNCY56P3VPZtLw/W/IxO1cWdJ84X65omUIxqIfSs7f5YdmaY C9VyPzLf0rUqx/DvvBsos5fwYucLSxA= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=hlinnaka smtp.mailfrom=hlinnaka@iki.fi ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1755256326; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=RzQysNNKy3WVWeHlrJv6ZvM+i6VuQvE7ZgivEsbLwxc=; b=rBvYiumHXO9Fq+b4Lo+FXw4T1+oLLn1v0kCNnnyAaMdJE8IGJ3WIlkrYaBz/xzzK/wlJrj L5tbgobfc//I2dOssJJMucLb2Rc1+yvtrvNUKsqdnT29O36w+TtEtRslyCGJpcqoSRFC5+ FJlFMnfJzG86HmoAh9tXzYrLoCudKSU= Content-Type: multipart/mixed; boundary="------------VOYQmFCoKRWKPAlr0Tk8x2XD" Message-ID: <217b1d29-a4e5-4b27-8a67-bbeaa20a5609@iki.fi> Date: Fri, 15 Aug 2025 14:12:03 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: A few patches to clarify snapshot management To: Noah Misch Cc: Andres Freund , Nathan Bossart , "pgsql-hackers@postgresql.org" References: <7c56f180-b9e1-481e-8c1d-efa63de3ecbb@iki.fi> <0cc21d6a-32c4-4d34-9eeb-7a0cf6dca9e8@iki.fi> <20250809222338.cc.nmisch@google.com> Content-Language: en-US From: Heikki Linnakangas In-Reply-To: <20250809222338.cc.nmisch@google.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------VOYQmFCoKRWKPAlr0Tk8x2XD Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 10/08/2025 01:23, Noah Misch wrote: > On Tue, Jan 07, 2025 at 11:55:00AM +0200, Heikki Linnakangas wrote: >> On 07/01/2025 00:00, Andres Freund wrote: >>> On 2024-12-20 19:31:01 +0200, Heikki Linnakangas wrote: >>>> While playing around some more with this, I noticed that this code in >>>> GetTransactionSnapshot() is never reached, and AFAICS has always been dead >>>> code: >>>> >>>>> Snapshot >>>>> GetTransactionSnapshot(void) >>>>> { >>>>> /* >>>>> * Return historic snapshot if doing logical decoding. We'll never need a >>>>> * non-historic transaction snapshot in this (sub-)transaction, so there's >>>>> * no need to be careful to set one up for later calls to >>>>> * GetTransactionSnapshot(). >>>>> */ >>>>> if (HistoricSnapshotActive()) >>>>> { >>>>> Assert(!FirstSnapshotSet); >>>>> return HistoricSnapshot; >>>>> } >>>> >>>> when you think about it, that's good, because it doesn't really make sense >>>> to call GetTransactionSnapshot() during logical decoding. We jump through >>>> hoops to make the historic catalog decoding possible with historic >>>> snapshots, tracking subtransactions that modify catalogs and WAL-logging >>>> command ids, but they're not suitable for general purpose queries. So I >>>> think we should turn that into an error, per attached patch. >>> >>> Hm. I'm not sure it's a good idea to forbid this. Couldn't there be sane C >>> code in an output functions calling GetTransactionSnapshot() or such to do >>> some internal lookups? >> >> I haven't seen any. And I don't think that would work correctly while doing >> logical decoding anyway, because historical snapshots only track XIDs that >> modify catalogs. regclassout and enumout do work because they use the >> catalog snapshot rather than GetTransactionSnapshot(). >> >> (I committed that change in commit 1585ff7387 already, but discussion is >> still welcome of course) > > https://github.com/2ndQuadrant/pglogical does rely on the pre-1585ff7387 code > for its row_filter feature. row_filter calls ExecEvalExpr() from the output > plugin, e.g. to evaluate expression "id between 2 AND 4" arising from this > configuration in the pglogical test suite: > > SELECT * FROM pglogical.replication_set_add_table('default', 'basic_dml', false, row_filter := $rf$id between 2 AND 4$rf$); > > One of the GetTransactionSnapshot() calls is in pglogical_output_plugin.c > itself. For that, I could work around the change by forcing the old > HistoricSnapshot use: > > - PushActiveSnapshot(GetTransactionSnapshot()); > + Assert(HistoricSnapshotActive()); > + PushActiveSnapshot(GetCatalogSnapshot(InvalidOid)); > > That doesn't get far. Calling a plpgsql function in the expression reaches > the "cannot take query snapshot during logical decoding" error via this stack > trace: > > GetTransactionSnapshot at snapmgr.c:279:3 > exec_eval_simple_expr at pl_exec.c:6214:3 > (inlined by) exec_eval_expr at pl_exec.c:5699:6 > exec_stmt_raise at pl_exec.c:3820:8 > (inlined by) exec_stmts at pl_exec.c:2096:10 > exec_stmt_block at pl_exec.c:1955:6 > exec_toplevel_block at pl_exec.c:1646:7 > plpgsql_exec_function at pl_exec.c:636:5 > plpgsql_call_handler at pl_handler.c:278:11 > fmgr_security_definer at fmgr.c:755:52 > ExecInterpExpr at execExprInterp.c:927:7 > pglogical_change_filter at pglogical_output_plugin.c:663:7 > (inlined by) pg_decode_change at pglogical_output_plugin.c:691:7 > change_cb_wrapper at logical.c:1121:22 > ReorderBufferApplyChange at reorderbuffer.c:2078:3 > (inlined by) ReorderBufferProcessTXN at reorderbuffer.c:2383:7 > DecodeCommit at decode.c:743:3 > (inlined by) xact_decode at decode.c:242:5 > LogicalDecodingProcessRecord at decode.c:123:1 > XLogSendLogical at walsender.c:3442:33 > WalSndLoop at walsender.c:2837:7 > StartLogicalReplication at walsender.c:1504:2 > (inlined by) exec_replication_command at walsender.c:2158:6 > PostgresMain at postgres.c:4762:10 > BackendMain at backend_startup.c:80:2 > postmaster_child_launch at launch_backend.c:291:3 > BackendStartup at postmaster.c:3587:8 > (inlined by) ServerLoop at postmaster.c:1702:6 > PostmasterMain at postmaster.c:1252:6 > main at main.c:165:4 > >>> Hm. I'm not sure it's a good idea to forbid this. Couldn't there be sane C >>> code in an output functions calling GetTransactionSnapshot() or such to do >>> some internal lookups? > > I think pglogical_output_plugin.c w/ plpgsql is largely sane when used with a > plpgsql function that consults only catalogs and the output tuple. If the > pglogical test suite is representative, that's the usual case for a > row_filter. A plpgsql function that reads user tables will be fragile with > concurrent pruning, but a user might sanely accept that fragility. A plpgsql > function that writes tuples is not sane in a row_filter. How do you see it? > > So far, I know of these options: > > 1. Make pglogical block the row_filter feature for any v18+ origin. > 2. Revert postgresql.git commit 1585ff7387. > 3. Make pglogical use HistoricSnapshot where pglogical_output_plugin.c handles > snapshots directly. That should keep simple row_filter expressions like > "col > 0" functioning. Entering plpgsql or similarly-complex logic will > fail with "cannot take query snapshot during logical decoding", and we'll > consider that to be working as intended. > 4. Fail later and lazily, for just the most-unreasonable cases. For example, > fail when HistoricSnapshot applies to a write operation. (Maybe this > already fails. I didn't check.) > > Which of those or other options should we consider? Hmm, so what snapshot should you use for these row filter expressions anyway? As long as you don't try to access any tables, it doesn't matter much. Although, the effective catalog snapshot also affects how any functions used in the expression are resolved. If you CREATE OR REPLACE the row filter function while logical decoding is active, what version of the function do you expect to be used? I think that's a little fuzzy, and you might get different answer for the initial sync step and the on-going decoding. We don't necessarily need to solve that here. Nevertheless, what would be the least surprising answer to that? Currently, in v17 and below, we will use the historic snapshot, which represents the point in time that we are decoding. Is that the right choice? I'm not sure. A historic snapshot is only supposed to be used for catalogs, it's not clear if it works correctly for arbitrary queries. And it's not clear it's the right choice for resolving the row filter functions either. How about always using a fresh snapshot instead? Instead of pushing the historic snapshot as the active snapshot, _disable_ the historic snapshot and use GetTransactionSnapshot() to acquire a regular snapshot? We could implement that in GetTransactionSnapshot() ifself by just removing the check for HistoricSnapshotActive(), and let it call GetSnapshotData() as usual. But I still think it's a useful sanity check that you don't call GetTransactionSnapshot() while a historic snapshot is active, so I'd prefer for the caller to explicitly disable the historic snapshot first. Attached is a patch to pglogical to demonstrate that. Another apprach is to continue down the path you attempted. There are many places in plpgsql and elsewhere where we call GetTransactionSnapshot(), but are they really necessary when you're executing something like the row filter expression? I think the row filter expression is supposed to be read-only. There are optimizations already to avoid GetTransactionSnapshot() calls in read-only functions (i.e. immutable), but we could expand those to any function in a read-only transaction, and set XactReadOnly while evaluating the row filter expression. The second attached patch makes that change in PostgreSQL code. With those changes, the pglogical change you attempted to do "PushActiveSnapshot(GetCatalogSnapshot(InvalidOid))" seems to work. I'm not sure it covers all the cases though, there might be more GetTransactionSnapshot() calls lurking. I think I prefer the change to pglogical to disable the historic snapshot. It feels more robust. I'm not sure if there's a performance penalty though, as you now need to call GetSnapshotData() for every decoded transaction. Finally, attached is a pglogical test case to test what happens if you change the datatype of the table, while there's decoding active with a complex row filter function that also accesses the table. I'm not sure how that should behave and I think that falls into the category of "don't do that". But FWIW, on v17 it tries to read it fails with this: ERROR: could not read blocks 0..0 in file "base/16384/17512": read only 0 of 8192 bytes while with the attached pglogical-disable-historic-snapshot.patch it fails more nicely: [2025-08-15 14:05:41.514 EEST] [3824375] [regression] ERROR: attribute 1 of type rowfilter_ddl_tbl has wrong type [2025-08-15 14:05:41.514 EEST] [3824375] [regression] DETAIL: Table has type text, but query expects integer. - Heikki --------------VOYQmFCoKRWKPAlr0Tk8x2XD Content-Type: text/x-patch; charset=UTF-8; name="pglogical-disable-historic-snapshot.patch" Content-Disposition: attachment; filename="pglogical-disable-historic-snapshot.patch" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL3BnbG9naWNhbF9vdXRwdXRfcGx1Z2luLmMgYi9wZ2xvZ2ljYWxfb3V0 cHV0X3BsdWdpbi5jCmluZGV4IDlmMWJmOWMuLjk4YWFlNjIgMTAwNjQ0Ci0tLSBhL3BnbG9n aWNhbF9vdXRwdXRfcGx1Z2luLmMKKysrIGIvcGdsb2dpY2FsX291dHB1dF9wbHVnaW4uYwpA QCAtNjMwLDYgKzYzMCwxMCBAQCBwZ2xvZ2ljYWxfY2hhbmdlX2ZpbHRlcihQR0xvZ2ljYWxP dXRwdXREYXRh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AqZGF0YSwgUmVsYXRpb24gcmVsYXRpb24sCiAJCUZyZWVFeGVjdXRvclN0YXRlKGVzdGF0 ZSk7CiAKIAkJUG9wQWN0aXZlU25hcHNob3QoKTsKKyNpZiBQR19WRVJTSU9OX05VTSA+PSAx ODAwMDAKKwkJU2V0dXBIaXN0b3JpY1NuYXBzaG90KGhpc3RvcmljX3NuYXBzaG90LCB0dXBs ZWNpZHMpOworI2VuZGlmCiAJfQogCiAJLyogTWFrZSBzdXJlIGNhbGxlciBpcyBhd2FyZSBv ZiBhbnkgYXR0cmlidXRlIGZpbHRlci4gKi8K --------------VOYQmFCoKRWKPAlr0Tk8x2XD Content-Type: text/x-patch; charset=UTF-8; name="use-readonly-mode-for-decode.patch" Content-Disposition: attachment; filename="use-readonly-mode-for-decode.patch" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL3NyYy9iYWNrZW5kL2V4ZWN1dG9yL2Z1bmN0aW9ucy5jIGIvc3JjL2Jh Y2tlbmQvZXhlY3V0b3IvZnVuY3Rpb25zLmMKaW5kZXggMzU5YWFmZWE2ODEuLjRjOWExN2Ey ZmM5IDEwMDY0NAotLS0gYS9zcmMvYmFja2VuZC9leGVjdXRvci9mdW5jdGlvbnMuYworKysg Yi9zcmMvYmFja2VuZC9leGVjdXRvci9mdW5jdGlvbnMuYwpAQCAtMTY0NCw2ICsxNjQ0LDcg QEAgZm1ncl9zcWwoUEdfRlVOQ1RJT05fQVJHUykKIAl3aGlsZSAoZXMpCiAJewogCQlib29s CQljb21wbGV0ZWQ7CisJCWJvb2wJCW5lZWRfc25hcHNob3QgPSAhZmNhY2hlLT5mdW5jLT5y ZWFkb25seV9mdW5jICYmICFYYWN0UmVhZE9ubHk7CiAKIAkJaWYgKGVzLT5zdGF0dXMgPT0g Rl9FWEVDX1NUQVJUKQogCQl7CkBAIC0xNjUzLDcgKzE2NTQsNyBAQCBmbWdyX3NxbChQR19G VU5DVElPTl9BUkdTKQogCQkJICogdmlzaWJsZS4gIF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vbmx5IG5lZWQgdG8gc2VuZCBi ZWdpbi9iZWdpbi1wcmVwYXJlIGZvciBub24tc3RyZWFtZWQKZGlmZiAtLWdpdCBhL3NyYy9w bC9wbHBnc3FsL3NyYy9wbF9leGVjLmMgYi9zcmMvcGwvcGxwZ3NxbC9zcmMvcGxfZXhlYy5j CmluZGV4IGI5YWNjNzkwZGM2Li5iMjc4NjdkMDYxMyAxMDA2NDQKLS0tIGEvc3JjL3BsL3Bs cGdzcWwvc3JjL3BsX2V4ZWMuYworKysgYi9zcmMvcGwvcGxwZ3NxbC9zcmMvcGxfZXhlYy5j CkBAIC00MDEzLDcgKzQwMTMsNyBAQCBwbHBnc3FsX2VzdGF0ZV9zZXR1cChQTHBnU1FMX2V4 ZWNzdGF0ZSAqZXN0YXRlLAogCWVzdGF0ZS0+cmV0aXN0dXBsZSA9IGZ1bmMtPmZuX3JldGlz dHVwbGU7CiAJZXN0YXRlLT5yZXRpc3NldCA9IGZ1bmMtPmZuX3JldHNldDsKIAotCWVzdGF0 ZS0+cmVhZG9ubHlfZnVuYyA9IGZ1bmMtPmZuX3JlYWRvbmx5OworCWVzdGF0ZS0+cmVhZG9u bHlfZnVuYyA9IGZ1bmMtPmZuX3JlYWRvbmx5IHx8IFhhY3RSZWFkT25seTsKIAllc3RhdGUt PmF0b21pYyA9IHRydWU7CiAKIAllc3RhdGUtPmV4aXRsYWJlbCA9IE5VTEw7Cg== --------------VOYQmFCoKRWKPAlr0Tk8x2XD Content-Type: application/sql; name="row_filter_ddl.sql" Content-Disposition: attachment; filename="row_filter_ddl.sql" Content-Transfer-Encoding: base64 U0VMRUNUICogRlJPTSBwZ2xvZ2ljYWxfcmVncmVzc192YXJpYWJsZXMoKQpcZ3NldAoKXGMg OnByb3ZpZGVyX2RzbgoKU0VMRUNUIHBnbG9naWNhbC5yZXBsaWNhdGVfZGRsX2NvbW1hbmQo JCQKCUNSRUFURSBUQUJMRSBwdWJsaWMucm93ZmlsdGVyX2RkbF90YmwgKGlkI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