mirror of
https://github.com/postgres/postgres.git
synced 2025-10-16 17:07:43 +03:00
Rename RBTXN_PREPARE to RBTXN_IS_PREPARE for better clarification.
RBTXN_PREPARE flag and rbtxn_prepared macro could be misinterpreted as
either indicating the transaction type (e.g. a prepared transaction or
a normal transaction) or its currentstate (e.g. skipped or its prepare
message is sent), especially after commit 072ee847ad
introduced the
RBTXN_SENT_PREPARE flag and the rbtxn_sent_prepare macro.
The RBTXN_PREPARE flag (and its corresponding macro) have been renamed
to RBTXN_IS_PREPARE to explicitly indicate the transaction
type. Therefore, this commit also adds the RBTXN_IS_PREPARE flag to
the transaction that is a prepared transaction and has been skipped,
which previously had only the RBTXN_SKIPPED_PREPARE flag.
Reviewed-by: Amit Kapila, Peter Smith
Discussion: https://postgr.es/m/CAA4eK1KgNmBsG%3D155E7QQ6TX9RoWnM4z5Z20SvsbwxSe_QXYsg%40mail.gmail.com
This commit is contained in:
@@ -170,13 +170,15 @@ typedef struct ReorderBufferChange
|
||||
#define RBTXN_IS_SERIALIZED_CLEAR 0x0008
|
||||
#define RBTXN_IS_STREAMED 0x0010
|
||||
#define RBTXN_HAS_PARTIAL_CHANGE 0x0020
|
||||
#define RBTXN_PREPARE 0x0040
|
||||
#define RBTXN_IS_PREPARED 0x0040
|
||||
#define RBTXN_SKIPPED_PREPARE 0x0080
|
||||
#define RBTXN_HAS_STREAMABLE_CHANGE 0x0100
|
||||
#define RBTXN_SENT_PREPARE 0x0200
|
||||
#define RBTXN_IS_COMMITTED 0x0400
|
||||
#define RBTXN_IS_ABORTED 0x0800
|
||||
|
||||
#define RBTXN_PREPARE_STATUS_MASK (RBTXN_IS_PREPARED | RBTXN_SKIPPED_PREPARE | RBTXN_SENT_PREPARE)
|
||||
|
||||
/* Does the transaction have catalog changes? */
|
||||
#define rbtxn_has_catalog_changes(txn) \
|
||||
( \
|
||||
@@ -234,9 +236,9 @@ typedef struct ReorderBufferChange
|
||||
* committed. To check whether a prepare or a stream_prepare has already
|
||||
* been sent for this transaction, we need to use rbtxn_sent_prepare().
|
||||
*/
|
||||
#define rbtxn_prepared(txn) \
|
||||
#define rbtxn_is_prepared(txn) \
|
||||
( \
|
||||
((txn)->txn_flags & RBTXN_PREPARE) != 0 \
|
||||
((txn)->txn_flags & RBTXN_IS_PREPARED) != 0 \
|
||||
)
|
||||
|
||||
/* Has a prepare or stream_prepare already been sent? */
|
||||
|
Reference in New Issue
Block a user