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

taosdata / TDengine / #3562

20 Dec 2024 09:57AM UTC coverage: 26.655% (-32.2%) from 58.812%
#3562

push

travis-ci

web-flow
Merge pull request #29229 from taosdata/enh/TS-5749-3.0

enh: seperate tsdb async tasks to different thread pools

21498 of 109421 branches covered (19.65%)

Branch coverage included in aggregate %.

66 of 96 new or added lines in 7 files covered. (68.75%)

39441 existing lines in 157 files now uncovered.

35007 of 102566 relevant lines covered (34.13%)

53922.97 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
} STransAction;
58

59
typedef void (*TransCbFp)(SMnode *pMnode, void *param, int32_t paramLen);
60

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

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

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

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

101
SSdbRaw *mndTransEncode(STrans *pTrans);
102
SSdbRow *mndTransDecode(SSdbRaw *pRaw);
103
void     mndTransDropData(STrans *pTrans);
104

105
bool mndTransPerformPrepareStage(SMnode *pMnode, STrans *pTrans, bool topHalf);
106
#ifdef __cplusplus
107
}
108
#endif
109

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