• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

taosdata / TDengine / #3633

11 Mar 2025 12:59PM UTC coverage: 0.0% (-60.7%) from 60.719%
#3633

push

travis-ci

web-flow
Merge pull request #30118 from taosdata/wl30

udpate ci workflow

0 of 280412 branches covered (0.0%)

Branch coverage included in aggregate %.

0 of 275582 relevant lines covered (0.0%)

0.0 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/source/dnode/mnode/impl/inc/mndTrans.h
1
/*
2
 * Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
3
 *
4
 * This program is free software: you can use, redistribute, and/or modify
5
 * it under the terms of the GNU Affero General Public License, version 3
6
 * or later ("AGPL"), as published by the Free Software Foundation.
7
 *
8
 * This program is distributed in the hope that it will be useful, but WITHOUT
9
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10
 * FITNESS FOR A PARTICULAR PURPOSE.
11
 *
12
 * You should have received a copy of the GNU Affero General Public License
13
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14
 */
15

16
#ifndef _TD_MND_TRANS_H_
17
#define _TD_MND_TRANS_H_
18

19
#include "mndInt.h"
20

21
#ifdef __cplusplus
22
extern "C" {
23
#endif
24

25
typedef enum {
26
  TRANS_START_FUNC_TEST = 1,
27
  TRANS_STOP_FUNC_TEST = 2,
28
  TRANS_START_FUNC_MQ_REB = 3,
29
  TRANS_STOP_FUNC_MQ_REB = 4,
30
  TRANS_FUNC_RECOVER_STREAM_STEP_NEXT = 5,
31
} ETrnFunc;
32

33
typedef enum {
34
  TRANS_ACTION_NULL = 0,
35
  TRANS_ACTION_MSG = 1,
36
  TRANS_ACTION_RAW = 2,
37
} ETrnAct;
38

39
typedef struct {
40
  int32_t   id;
41
  int32_t   errCode;
42
  int32_t   acceptableCode;
43
  int32_t   retryCode;
44
  ETrnAct   actionType;
45
  ETrnStage stage;
46
  int8_t    reserved;
47
  int8_t    rawWritten;
48
  int8_t    msgSent;
49
  int8_t    msgReceived;
50
  tmsg_t    msgType;
51
  SEpSet    epSet;
52
  int32_t   contLen;
53
  void     *pCont;
54
  SSdbRaw  *pRaw;
55

56
  int64_t mTraceId;
57
  int64_t startTime;
58
  int64_t endTime;
59
} STransAction;
60

61
typedef void (*TransCbFp)(SMnode *pMnode, void *param, int32_t paramLen);
62

63
int32_t mndInitTrans(SMnode *pMnode);
64
void    mndCleanupTrans(SMnode *pMnode);
65
STrans *mndAcquireTrans(SMnode *pMnode, int32_t transId);
66
void    mndReleaseTrans(SMnode *pMnode, STrans *pTrans);
67

68
STrans *mndTransCreate(SMnode *pMnode, ETrnPolicy policy, ETrnConflct conflict, const SRpcMsg *pReq,
69
                       const char *opername);
70
void    mndTransDrop(STrans *pTrans);
71

72
int32_t mndTransAppendPrepareLog(STrans *pTrans, SSdbRaw *pRaw);
73
int32_t mndTransAppendRedolog(STrans *pTrans, SSdbRaw *pRaw);
74
int32_t mndTransAppendUndolog(STrans *pTrans, SSdbRaw *pRaw);
75
int32_t mndTransAppendCommitlog(STrans *pTrans, SSdbRaw *pRaw);
76
int32_t mndTransAppendNullLog(STrans *pTrans);
77

78
int32_t mndTransAppendRedoAction(STrans *pTrans, STransAction *pAction);
79
int32_t mndTransAppendUndoAction(STrans *pTrans, STransAction *pAction);
80
void    mndTransSetRpcRsp(STrans *pTrans, void *pCont, int32_t contLen);
81
void    mndTransSetCb(STrans *pTrans, ETrnFunc startFunc, ETrnFunc stopFunc, void *param, int32_t paramLen);
82
void    mndTransSetDbName(STrans *pTrans, const char *dbname, const char *stbname);
83
void    mndTransAddArbGroupId(STrans *pTrans, int32_t groupId);
84
void    mndTransSetSerial(STrans *pTrans);
85
void    mndTransSetBeKilled(STrans *pTrans, bool ableToBeKilled);
86
void    mndTransSetKillMode(STrans *pTrans, ETrnKillMode killMode);
87
void    mndTransSetParallel(STrans *pTrans);
88
void    mndTransSetChangeless(STrans *pTrans);
89
void    mndTransSetOper(STrans *pTrans, EOperType oper);
90
int32_t mndTransCheckConflict(SMnode *pMnode, STrans *pTrans);
91
int32_t mndTransCheckConflictWithCompact(SMnode *pMnode, STrans *pTrans);
92
#ifndef BUILD_NO_CALL
93
static int32_t mndTrancCheckConflict(SMnode *pMnode, STrans *pTrans) {
×
94
    return mndTransCheckConflict(pMnode, pTrans);
×
95
}
96
#endif
97
int32_t mndTransPrepare(SMnode *pMnode, STrans *pTrans);
98
int32_t mndTransProcessRsp(SRpcMsg *pRsp);
99
void    mndTransPullup(SMnode *pMnode);
100
int32_t mndKillTrans(SMnode *pMnode, STrans *pTrans);
101
void    mndTransExecute(SMnode *pMnode, STrans *pTrans);
102
void    mndTransRefresh(SMnode *pMnode, STrans *pTrans);
103
int32_t mndSetRpcInfoForDbTrans(SMnode *pMnode, SRpcMsg *pMsg, EOperType oper, const char *dbname);
104

105
SSdbRaw *mndTransEncode(STrans *pTrans);
106
SSdbRow *mndTransDecode(SSdbRaw *pRaw);
107
void     mndTransDropData(STrans *pTrans);
108

109
bool mndTransPerformPrepareStage(SMnode *pMnode, STrans *pTrans, bool topHalf);
110
#ifdef __cplusplus
111
}
112
#endif
113

114
#endif /*_TD_MND_TRANS_H_*/
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc