public inbox for [email protected]  
help / color / mirror / Atom feed
From: Yushi Ogiwara <[email protected]>
To: Pgsql Hackers <[email protected]>
Subject: Fix attributes of consume_xids and consume_xids_until
Date: Fri, 11 Oct 2024 15:59:05 +0900
Message-ID: <[email protected]> (raw)

Hi,

I found the attributes of the functions  consume_xids and 
consume_xids_until are incorrectly specified:

- Both functions are marked as IMMUTABLE attribute, but they advance the 
transaction ID, which modifies the system state. Thus, they should be 
marked as VOLATILE.
- Additionally, both functions are marked as PARALLEL SAFE. Since these 
functions call the AssignTransactionId function, which cannot be invoked 
in parallel mode, they should be marked as PARALLEL UNSAFE.

This patch fixes the attributes of consume_xids and consume_xids_until 
accordingly.

Best,
Yushi

Attachments:

  [text/x-diff] fix_attr.diff (1.0K, ../[email protected]/2-fix_attr.diff)
  download | inline diff:
From 601c3510cb77c99abde03722ef72ba77862c40f2 Mon Sep 17 00:00:00 2001
From: Yushi Ogiwara <[email protected]>
Date: Fri, 11 Oct 2024 15:07:08 +0900
Subject: [PATCH] fix attr

---
 src/test/modules/xid_wraparound/xid_wraparound--1.0.sql | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/test/modules/xid_wraparound/xid_wraparound--1.0.sql b/src/test/modules/xid_wraparound/xid_wraparound--1.0.sql
index 51d25fc4c6..96356b4b97 100644
--- a/src/test/modules/xid_wraparound/xid_wraparound--1.0.sql
+++ b/src/test/modules/xid_wraparound/xid_wraparound--1.0.sql
@@ -4,9 +4,9 @@
 \echo Use "CREATE EXTENSION xid_wraparound" to load this file. \quit
 
 CREATE FUNCTION consume_xids(nxids bigint)
-RETURNS xid8 IMMUTABLE PARALLEL SAFE STRICT
+RETURNS xid8 VOLATILE PARALLEL UNSAFE STRICT
 AS 'MODULE_PATHNAME' LANGUAGE C;
 
 CREATE FUNCTION consume_xids_until(targetxid xid8)
-RETURNS xid8 IMMUTABLE PARALLEL SAFE STRICT
+RETURNS xid8 VOLATILE PARALLEL UNSAFE STRICT
 AS 'MODULE_PATHNAME' LANGUAGE C;
-- 
2.40.1



view thread (2+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: Fix attributes of consume_xids and consume_xids_until
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox