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

taosdata / TDengine / #4513

17 Jul 2025 02:02AM UTC coverage: 31.359% (-31.1%) from 62.446%
#4513

push

travis-ci

web-flow
Merge pull request #31914 from taosdata/fix/3.0/compare-ans-failed

fix:Convert line endings from LF to CRLF for ans file

68541 of 301034 branches covered (22.77%)

Branch coverage included in aggregate %.

117356 of 291771 relevant lines covered (40.22%)

602262.98 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
  int32_t groupId;
60
} STransAction;
61

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

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

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

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

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

108
SSdbRaw *mndTransEncode(STrans *pTrans);
109
SSdbRow *mndTransDecode(SSdbRaw *pRaw);
110
void     mndTransDropData(STrans *pTrans);
111

112
bool mndTransPerformPrepareStage(SMnode *pMnode, STrans *pTrans, bool topHalf);
113
#ifdef __cplusplus
114
}
115
#endif
116

117
#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