From 7758348b68b7bfb87867f489a1a446f384a260e8 Mon Sep 17 00:00:00 2001 From: bjyb <1091839467@qq.com> Date: Tue, 26 Sep 2023 14:08:17 +0800 Subject: [PATCH] Update execClusterResize.cpp --- .../runtime/executor/execClusterResize.cpp | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/gausskernel/runtime/executor/execClusterResize.cpp b/src/gausskernel/runtime/executor/execClusterResize.cpp index 4eb0444a5..131453e0b 100644 --- a/src/gausskernel/runtime/executor/execClusterResize.cpp +++ b/src/gausskernel/runtime/executor/execClusterResize.cpp @@ -69,6 +69,31 @@ static inline bool redis_offset_retrive_function(const char* funcname, Oid retty ((nargs) == 4 && (rettype) == TIDOID && (argstype)[0] == TEXTOID && (argstype)[1] == NAMEOID && \ (argstype)[2] == INT4OID && (argstype)[3] == INT4OID)) +/*The function of this code is to implement some functions related to Redis. Specifically includes the following aspects: +1. Some macros are defined to specify some constants. +2. Some inline functions are declared to judge whether a function is a corresponding Redis function. +3. Some functions are implemented, including recording deleted tuples, judging whether the relationship is in cluster +redistribution, checking whether the table is a deletion operation table, and judging whether the process is in the process of cluster redistribution. +The function RecordDeletedTuple is used to record the tupleid of a given tuple into the `pg _ delete _ delta` table. As follows: + +-parameters: +-`Relid`: OID of the target relationship of the update/delete operation. +-`bucket id`: ID of the bucket where the target tuple is located. +-`tupleid': the tupleid to be recorded. +-`deldelta_rel: the corresponding `pg _ delete _ delta` relationship. + +The function RelationInClusterResizing' is used to determine whether the relationship is in the operation of cluster resizing. + +The function `relationinclusteresinggreadonly` is used to determine whether the relationship is in a read-only cluster resizing operation. + +The function `relationinclusteresizingendachup' is used to determine whether the relationship is in an operation (write error) before the end of cluster resizing. + +The function CheckRangeVarInRedistribution' is used to check whether the relationship is in redistribution through the relationship variable. + +The function RelationIsDeleteDeltaTable is used to determine whether the given table name is a delete_delta table. + +The function `clusterSizingProgress' is used to determine whether the cluster resizing process is in progress.*/ + static inline bool redis_tupleid_retrive_function(const char* funcname, Oid rettype, const Oid* argstype, int nargs) {