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

taosdata / TDengine / #4506

15 Jul 2025 12:33AM UTC coverage: 62.026% (-0.7%) from 62.706%
#4506

push

travis-ci

web-flow
docs: update stream docs (#31874)

155391 of 320094 branches covered (48.55%)

Branch coverage included in aggregate %.

240721 of 318525 relevant lines covered (75.57%)

6529048.03 hits per line

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

5.56
/source/dnode/vnode/src/vnd/vnodeRetention.c
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
#include "vnd.h"
17

18
extern int32_t tsdbAsyncRetention(STsdb *tsdb, int64_t now);
19
extern int32_t tsdbAsyncSsMigrate(STsdb *tsdb, SSsMigrateVgroupReq *pReq);
20
extern int32_t tsdbQuerySsMigrateProgress(STsdb *tsdb, int32_t ssMigrateId, int32_t *rspSize, void** ppRsp);
21
extern int32_t tsdbUpdateSsMigrateState(STsdb* tsdb, SVnodeSsMigrateState* pState);
22

23

24
int32_t vnodeAsyncRetention(SVnode *pVnode, int64_t now) {
12✔
25
  // async retention
26
  return tsdbAsyncRetention(pVnode->pTsdb, now);
12✔
27
}
28

29
int32_t vnodeAsyncSsMigrate(SVnode *pVnode, SSsMigrateVgroupReq *pReq) {
×
30
  // async migration
31
#ifdef USE_SHARED_STORAGE
32
  if (tsSsEnabled) {
×
33
    return tsdbAsyncSsMigrate(pVnode->pTsdb, pReq);
×
34
  }
35
#endif
36
  return TSDB_CODE_OPS_NOT_SUPPORT;
×
37
}
38

39
int32_t vnodeQuerySsMigrateProgress(SVnode *pVnode, SRpcMsg *pMsg) {
×
40
  int32_t code = 0;
×
41

42
  SQuerySsMigrateProgressReq req = {0};
×
43

44
  int32_t                  rspSize = 0;
×
45
  SRpcMsg                  rspMsg = {0};
×
46
  void                    *pRsp = NULL;
×
47
  SQuerySsMigrateProgressRsp rsp = {0};
×
48

49
  // deserialize request
50
  char* buf = (char*)pMsg->pCont + sizeof(SMsgHead);
×
51
  code = tDeserializeSQuerySsMigrateProgressReq(buf, pMsg->contLen - sizeof(SMsgHead), &req);
×
52
  if (code) {
×
53
    code = TSDB_CODE_INVALID_MSG;
×
54
    goto _exit;
×
55
  }
56

57
  vDebug("vgId:%d, ssMigrateId:%d, processing query ss migrate progress request", req.vgId, req.ssMigrateId);
×
58
  code = tsdbQuerySsMigrateProgress(pVnode->pTsdb, req.ssMigrateId, &rspSize, &pRsp);
×
59

60
_exit:
×
61
  rspMsg.info = pMsg->info;
×
62
  rspMsg.pCont = pRsp;
×
63
  rspMsg.contLen = rspSize;
×
64
  rspMsg.code = code;
×
65
  rspMsg.msgType = TDMT_VND_QUERY_SSMIGRATE_PROGRESS_RSP;
×
66

67
  tmsgSendRsp(&rspMsg);
×
68
  return 0;
×
69
}
70

71
int32_t vnodeFollowerSsMigrate(SVnode *pVnode, SVnodeSsMigrateState *pState) {
×
72
  return tsdbUpdateSsMigrateState(pVnode->pTsdb, pState);
×
73
}
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