This is an automated email from the ASF dual-hosted git repository.

yjhjstz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git

commit 495309595a57fb724728cc5a0516d1627afb5c4d
Author: Adam Lee <[email protected]>
AuthorDate: Wed Oct 19 16:34:25 2022 +0800

    Rename UpdateSerializableCommandId() to UpdateCommandIdInSnapshot()
    
    The name of UpdateSerializableCommandId is a bit wrong, now that 
SERIALIZABLE
    and REPEATABLE READ are not the same. From comparison, the if-check above 
was
    changed from checking IsXactIsoLevelSerializable to 
IsolationUsesXactSnapshot().
    
    This commit renames it and resolves that GPDB_91_MERGE_FIXME.
    
            commit 5eb15c9942a9bd6aaf712f2ab6175005e035168a
            Author: Joe Conway <[email protected]>
            Date:   Sat Sep 11 18:38:58 2010 +0000
    
                SERIALIZABLE transactions are actually implemented beneath the 
covers with
                transaction snapshots, i.e. a snapshot registered at the 
beginning of
                a transaction. Change variable naming and comments to reflect 
this reality
                in preparation for a future, truly serializable mode, e.g.
                Serializable Snapshot Isolation (SSI).
    
                For the moment transaction snapshots are still used to implement
                SERIALIZABLE, but hopefully not for too much longer. Patch by 
Kevin
                Grittner and Dan Ports with review and some minor wording 
changes by me.
---
 src/backend/storage/ipc/procarray.c | 3 +--
 src/backend/utils/time/snapmgr.c    | 6 +-----
 src/include/storage/procarray.h     | 2 +-
 3 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/src/backend/storage/ipc/procarray.c 
b/src/backend/storage/ipc/procarray.c
index 25a66171a3..c872907a46 100644
--- a/src/backend/storage/ipc/procarray.c
+++ b/src/backend/storage/ipc/procarray.c
@@ -4019,10 +4019,9 @@ HaveVirtualXIDsDelayingChkptGuts(VirtualTransactionId 
*vxids, int nvxids,
 
 /*
  * MPP: Special code to update the command id in the SharedLocalSnapshot
- * when we are in SERIALIZABLE isolation mode.
  */
 void
-UpdateSerializableCommandId(CommandId curcid)
+UpdateCommandIdInSnapshot(CommandId curcid)
 {
        if ((DistributedTransactionContext == 
DTX_CONTEXT_QE_TWO_PHASE_EXPLICIT_WRITER ||
                 DistributedTransactionContext == 
DTX_CONTEXT_QE_TWO_PHASE_IMPLICIT_WRITER) &&
diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c
index ddf2194eea..c51a60a029 100644
--- a/src/backend/utils/time/snapmgr.c
+++ b/src/backend/utils/time/snapmgr.c
@@ -335,11 +335,7 @@ GetTransactionSnapshot(void)
                         getDistributedTransactionId(),
                         DtxContextToString(DistributedTransactionContext));
 
-               // GPDB_91_MERGE_FIXME: the name of UpdateSerializableCommandId 
is a bit
-               // wrong, now that SERIALIZABLE and REPEATABLE READ are not the 
same.
-               // From comparison, the if-check above was changed from checking
-               // IsXactIsoLevelSerializable to IsolationUsesXactSnapshot()
-               UpdateSerializableCommandId(CurrentSnapshot->curcid);
+               UpdateCommandIdInSnapshot(CurrentSnapshot->curcid);
 
                return CurrentSnapshot;
        }
diff --git a/src/include/storage/procarray.h b/src/include/storage/procarray.h
index 8f58ea62c8..c3fe54f4d7 100644
--- a/src/include/storage/procarray.h
+++ b/src/include/storage/procarray.h
@@ -101,7 +101,7 @@ extern void XidCacheRemoveRunningXids(TransactionId xid,
                                                                          
TransactionId latestXid);
                                                  
 extern PGPROC *FindProcByGpSessionId(long gp_session_id);
-extern void UpdateSerializableCommandId(CommandId curcid);
+extern void UpdateCommandIdInSnapshot(CommandId curcid);
 
 extern void updateSharedLocalSnapshot(struct DtxContextInfo *dtxContextInfo,
                                                                          
DtxContext distributedTransactionContext,


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to