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

L
Liu Jicong 已提交
16
#include "executor.h"
S
Shengliang Guan 已提交
17
#include "sndInt.h"
L
Liu Jicong 已提交
18
#include "tstream.h"
L
Liu Jicong 已提交
19
#include "tuuid.h"
L
Liu Jicong 已提交
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34

void sndEnqueueStreamDispatch(SSnode *pSnode, SRpcMsg *pMsg) {
  char   *msgStr = pMsg->pCont;
  char   *msgBody = POINTER_SHIFT(msgStr, sizeof(SMsgHead));
  int32_t msgLen = pMsg->contLen - sizeof(SMsgHead);
  int32_t code = 0;

  SStreamDispatchReq req;
  SDecoder           decoder;
  tDecoderInit(&decoder, msgBody, msgLen);
  if (tDecodeStreamDispatchReq(&decoder, &req) < 0) {
    code = TSDB_CODE_MSG_DECODE_ERROR;
    tDecoderClear(&decoder);
    goto FAIL;
  }
35

L
Liu Jicong 已提交
36 37 38 39
  tDecoderClear(&decoder);

  int32_t taskId = req.taskId;

L
Liu Jicong 已提交
40
  SStreamTask *pTask = streamMetaAcquireTask(pSnode->pMeta, taskId);
L
Liu Jicong 已提交
41 42 43 44 45
  if (pTask) {
    SRpcMsg rsp = {
        .info = pMsg->info,
        .code = 0,
    };
46
    streamProcessDispatchMsg(pTask, &req, &rsp, false);
L
Liu Jicong 已提交
47
    streamMetaReleaseTask(pSnode->pMeta, pTask);
L
Liu Jicong 已提交
48 49 50 51 52 53 54
    rpcFreeCont(pMsg->pCont);
    taosFreeQitem(pMsg);
    return;
  }

FAIL:
  if (pMsg->info.handle == NULL) return;
55
  SRpcMsg rsp = { .code = code, .info = pMsg->info};
L
Liu Jicong 已提交
56 57 58 59 60 61
  tmsgSendRsp(&rsp);
  rpcFreeCont(pMsg->pCont);
  taosFreeQitem(pMsg);
}

int32_t sndExpandTask(SSnode *pSnode, SStreamTask *pTask, int64_t ver) {
62
  ASSERT(pTask->info.taskLevel == TASK_LEVEL__AGG && taosArrayGetSize(pTask->pUpstreamEpInfoList) != 0);
L
Liu Jicong 已提交
63

L
Liu Jicong 已提交
64
  pTask->refCnt = 1;
65
  pTask->id.idStr = createStreamTaskIdStr(pTask->id.streamId, pTask->id.taskId);
dengyihao's avatar
dengyihao 已提交
66

67 68
  pTask->status.schedStatus = TASK_SCHED_STATUS__INACTIVE;
  pTask->inputQueue = streamQueueOpen(512 << 10);
69
  pTask->outputInfo.queue = streamQueueOpen(512 << 10);
L
Liu Jicong 已提交
70

71
  if (pTask->inputQueue == NULL || pTask->outputInfo.queue == NULL) {
L
Liu Jicong 已提交
72 73 74
    return -1;
  }

H
Haojun Liao 已提交
75
  pTask->tsInfo.init = taosGetTimestampMs();
L
Liu Jicong 已提交
76
  pTask->inputStatus = TASK_INPUT_STATUS__NORMAL;
77
  pTask->outputInfo.status = TASK_OUTPUT_STATUS__NORMAL;
L
Liu Jicong 已提交
78
  pTask->pMsgCb = &pSnode->msgCb;
79
  pTask->chkInfo.version = ver;
80
  pTask->pMeta = pSnode->pMeta;
L
Liu Jicong 已提交
81 82 83 84 85 86

  pTask->pState = streamStateOpen(pSnode->path, pTask, false, -1, -1);
  if (pTask->pState == NULL) {
    return -1;
  }

87
  int32_t numOfChildEp = taosArrayGetSize(pTask->pUpstreamEpInfoList);
L
liuyao 已提交
88
  SReadHandle handle = { .vnode = NULL, .numOfVgroups = numOfChildEp, .pStateBackend = pTask->pState, .fillHistory = pTask->info.fillHistory };
H
Haojun Liao 已提交
89
  initStreamStateAPI(&handle.api);
D
dapan1121 已提交
90

91
  pTask->exec.pExecutor = qCreateStreamExecTaskInfo(pTask->exec.qmsg, &handle, 0);
92
  ASSERT(pTask->exec.pExecutor);
L
Liu Jicong 已提交
93

H
Haojun Liao 已提交
94
  taosThreadMutexInit(&pTask->lock, NULL);
95
  streamSetupScheduleTrigger(pTask);
96 97 98 99

  qDebug("snode:%d expand stream task on snode, s-task:%s, checkpoint ver:%" PRId64 " child id:%d, level:%d", SNODE_HANDLE,
         pTask->id.idStr, pTask->chkInfo.version, pTask->info.selfChildId, pTask->info.taskLevel);

L
Liu Jicong 已提交
100 101
  return 0;
}
H
refact  
Hongze Cheng 已提交
102

S
Shengliang Guan 已提交
103
SSnode *sndOpen(const char *path, const SSnodeOpt *pOption) {
wafwerar's avatar
wafwerar 已提交
104
  SSnode *pSnode = taosMemoryCalloc(1, sizeof(SSnode));
L
Liu Jicong 已提交
105
  if (pSnode == NULL) {
L
Liu Jicong 已提交
106
    terrno = TSDB_CODE_OUT_OF_MEMORY;
L
Liu Jicong 已提交
107 108
    return NULL;
  }
109
  pSnode->path = taosStrdup(path);
L
Liu Jicong 已提交
110 111 112 113
  if (pSnode->path == NULL) {
    terrno = TSDB_CODE_OUT_OF_MEMORY;
    goto FAIL;
  }
S
Shengliang Guan 已提交
114
  pSnode->msgCb = pOption->msgCb;
L
Liu Jicong 已提交
115 116

  pSnode->pMeta = streamMetaOpen(path, pSnode, (FTaskExpand *)sndExpandTask, SNODE_HANDLE);
L
Liu Jicong 已提交
117
  if (pSnode->pMeta == NULL) {
L
Liu Jicong 已提交
118 119
    terrno = TSDB_CODE_OUT_OF_MEMORY;
    goto FAIL;
L
Liu Jicong 已提交
120
  }
L
Liu Jicong 已提交
121

S
Shengliang Guan 已提交
122
  return pSnode;
L
Liu Jicong 已提交
123 124 125 126 127

FAIL:
  taosMemoryFree(pSnode->path);
  taosMemoryFree(pSnode);
  return NULL;
H
refact  
Hongze Cheng 已提交
128 129
}

L
Liu Jicong 已提交
130
void sndClose(SSnode *pSnode) {
131
  streamMetaCommit(pSnode->pMeta);
L
Liu Jicong 已提交
132 133
  streamMetaClose(pSnode->pMeta);
  taosMemoryFree(pSnode->path);
wafwerar's avatar
wafwerar 已提交
134
  taosMemoryFree(pSnode);
L
Liu Jicong 已提交
135
}
S
Shengliang Guan 已提交
136 137 138

int32_t sndGetLoad(SSnode *pSnode, SSnodeLoad *pLoad) { return 0; }

L
Liu Jicong 已提交
139 140
int32_t sndProcessTaskDeployReq(SSnode *pSnode, char *msg, int32_t msgLen) {
  int32_t code;
L
Liu Jicong 已提交
141

L
Liu Jicong 已提交
142
  // 1.deserialize msg and build task
L
Liu Jicong 已提交
143 144 145 146
  SStreamTask *pTask = taosMemoryCalloc(1, sizeof(SStreamTask));
  if (pTask == NULL) {
    return -1;
  }
147

L
Liu Jicong 已提交
148 149
  SDecoder decoder;
  tDecoderInit(&decoder, (uint8_t *)msg, msgLen);
150
  code = tDecodeStreamTask(&decoder, pTask);
L
Liu Jicong 已提交
151 152 153 154
  if (code < 0) {
    tDecoderClear(&decoder);
    taosMemoryFree(pTask);
    return -1;
L
Liu Jicong 已提交
155
  }
156

L
Liu Jicong 已提交
157 158
  tDecoderClear(&decoder);

159
  ASSERT(pTask->info.taskLevel == TASK_LEVEL__AGG);
L
Liu Jicong 已提交
160

L
Liu Jicong 已提交
161
  // 2.save task
162
  taosWLockLatch(&pSnode->pMeta->lock);
163 164 165

  bool added = false;
  code = streamMetaRegisterTask(pSnode->pMeta, -1, pTask, &added);
L
Liu Jicong 已提交
166
  if (code < 0) {
167
    taosWUnLockLatch(&pSnode->pMeta->lock);
L
Liu Jicong 已提交
168 169
    return -1;
  }
L
Liu Jicong 已提交
170

171
  int32_t numOfTasks = streamMetaGetNumOfTasks(pSnode->pMeta);
172
  taosWUnLockLatch(&pSnode->pMeta->lock);
173
  qDebug("snode:%d s-task:%s is deployed on snode and add into meta, status:%s, numOfTasks:%d", SNODE_HANDLE, pTask->id.idStr,
174
         streamGetTaskStatusStr(pTask->status.taskStatus), numOfTasks);
L
Liu Jicong 已提交
175

176
  streamTaskCheckDownstreamTasks(pTask);
L
Liu Jicong 已提交
177
  return 0;
L
Liu Jicong 已提交
178
}
L
Liu Jicong 已提交
179

L
Liu Jicong 已提交
180 181
int32_t sndProcessTaskDropReq(SSnode *pSnode, char *msg, int32_t msgLen) {
  SVDropStreamTaskReq *pReq = (SVDropStreamTaskReq *)msg;
182 183
  qDebug("snode:%d receive msg to drop stream task:0x%x", pSnode->pMeta->vgId, pReq->taskId);

184 185 186 187 188 189 190 191
  SStreamTask* pTask = streamMetaAcquireTask(pSnode->pMeta, pReq->taskId);
  if (pTask == NULL) {
    qError("vgId:%d failed to acquire s-task:0x%x when dropping it", pSnode->pMeta->vgId, pReq->taskId);
    return 0;
  }

  streamMetaUnregisterTask(pSnode->pMeta, pReq->taskId);
  streamMetaReleaseTask(pSnode->pMeta, pTask);
L
Liu Jicong 已提交
192
  return 0;
L
Liu Jicong 已提交
193 194
}

L
Liu Jicong 已提交
195
int32_t sndProcessTaskRunReq(SSnode *pSnode, SRpcMsg *pMsg) {
L
Liu Jicong 已提交
196 197
  SStreamTaskRunReq *pReq = pMsg->pCont;
  int32_t            taskId = pReq->taskId;
L
Liu Jicong 已提交
198
  SStreamTask       *pTask = streamMetaAcquireTask(pSnode->pMeta, taskId);
L
Liu Jicong 已提交
199 200
  if (pTask) {
    streamProcessRunReq(pTask);
L
Liu Jicong 已提交
201
    streamMetaReleaseTask(pSnode->pMeta, pTask);
L
Liu Jicong 已提交
202 203 204 205
    return 0;
  } else {
    return -1;
  }
L
Liu Jicong 已提交
206 207
}

L
Liu Jicong 已提交
208 209 210 211
int32_t sndProcessTaskDispatchReq(SSnode *pSnode, SRpcMsg *pMsg, bool exec) {
  char              *msgStr = pMsg->pCont;
  char              *msgBody = POINTER_SHIFT(msgStr, sizeof(SMsgHead));
  int32_t            msgLen = pMsg->contLen - sizeof(SMsgHead);
L
Liu Jicong 已提交
212 213
  SStreamDispatchReq req;
  SDecoder           decoder;
L
Liu Jicong 已提交
214
  tDecoderInit(&decoder, (uint8_t *)msgBody, msgLen);
L
Liu Jicong 已提交
215
  tDecodeStreamDispatchReq(&decoder, &req);
L
Liu Jicong 已提交
216 217
  int32_t taskId = req.taskId;

L
Liu Jicong 已提交
218
  SStreamTask *pTask = streamMetaAcquireTask(pSnode->pMeta, taskId);
L
Liu Jicong 已提交
219
  if (pTask) {
220 221
    SRpcMsg rsp = { .info = pMsg->info, .code = 0 };
    streamProcessDispatchMsg(pTask, &req, &rsp, exec);
L
Liu Jicong 已提交
222
    streamMetaReleaseTask(pSnode->pMeta, pTask);
L
Liu Jicong 已提交
223 224 225
    return 0;
  } else {
    return -1;
L
Liu Jicong 已提交
226 227 228
  }
}

L
Liu Jicong 已提交
229
int32_t sndProcessTaskRetrieveReq(SSnode *pSnode, SRpcMsg *pMsg) {
L
Liu Jicong 已提交
230 231 232 233 234 235 236
  char              *msgStr = pMsg->pCont;
  char              *msgBody = POINTER_SHIFT(msgStr, sizeof(SMsgHead));
  int32_t            msgLen = pMsg->contLen - sizeof(SMsgHead);
  SStreamRetrieveReq req;
  SDecoder           decoder;
  tDecoderInit(&decoder, msgBody, msgLen);
  tDecodeStreamRetrieveReq(&decoder, &req);
L
Liu Jicong 已提交
237
  tDecoderClear(&decoder);
L
Liu Jicong 已提交
238
  int32_t      taskId = req.dstTaskId;
L
Liu Jicong 已提交
239
  SStreamTask *pTask = streamMetaAcquireTask(pSnode->pMeta, taskId);
H
Haojun Liao 已提交
240

L
Liu Jicong 已提交
241
  if (pTask) {
H
Haojun Liao 已提交
242
    SRpcMsg rsp = { .info = pMsg->info, .code = 0};
L
Liu Jicong 已提交
243
    streamProcessRetrieveReq(pTask, &req, &rsp);
L
Liu Jicong 已提交
244
    streamMetaReleaseTask(pSnode->pMeta, pTask);
L
Liu Jicong 已提交
245
    tDeleteStreamRetrieveReq(&req);
L
Liu Jicong 已提交
246
    return 0;
L
Liu Jicong 已提交
247 248 249 250 251 252 253
  } else {
    return -1;
  }
}

int32_t sndProcessTaskDispatchRsp(SSnode *pSnode, SRpcMsg *pMsg) {
  SStreamDispatchRsp *pRsp = POINTER_SHIFT(pMsg->pCont, sizeof(SMsgHead));
L
Liu Jicong 已提交
254
  int32_t             taskId = ntohl(pRsp->upstreamTaskId);
L
Liu Jicong 已提交
255
  SStreamTask        *pTask = streamMetaAcquireTask(pSnode->pMeta, taskId);
L
Liu Jicong 已提交
256
  if (pTask) {
257
    streamProcessDispatchRsp(pTask, pRsp, pMsg->code);
L
Liu Jicong 已提交
258
    streamMetaReleaseTask(pSnode->pMeta, pTask);
L
Liu Jicong 已提交
259 260 261
    return 0;
  } else {
    return -1;
L
Liu Jicong 已提交
262 263 264 265
  }
  return 0;
}

L
Liu Jicong 已提交
266
int32_t sndProcessTaskRetrieveRsp(SSnode *pSnode, SRpcMsg *pMsg) {
L
Liu Jicong 已提交
267 268 269 270
  //
  return 0;
}

L
Liu Jicong 已提交
271
int32_t sndProcessWriteMsg(SSnode *pSnode, SRpcMsg *pMsg, SRpcMsg *pRsp) {
L
Liu Jicong 已提交
272
  switch (pMsg->msgType) {
273 274 275
    case TDMT_STREAM_TASK_DEPLOY: {
      void   *pReq = POINTER_SHIFT(pMsg->pCont, sizeof(SMsgHead));
      int32_t len = pMsg->contLen - sizeof(SMsgHead);
L
Liu Jicong 已提交
276
      return sndProcessTaskDeployReq(pSnode, pReq, len);
277 278
    }

L
Liu Jicong 已提交
279
    case TDMT_STREAM_TASK_DROP:
280
      return sndProcessTaskDropReq(pSnode, pMsg->pCont, pMsg->contLen);
L
Liu Jicong 已提交
281
    default:
S
shm  
Shengliang Guan 已提交
282
      ASSERT(0);
L
Liu Jicong 已提交
283
  }
L
Liu Jicong 已提交
284
  return 0;
L
Liu Jicong 已提交
285 286
}

287
int32_t sndProcessStreamTaskScanHistoryFinishReq(SSnode *pSnode, SRpcMsg *pMsg) {
L
Liu Jicong 已提交
288 289 290 291
  char   *msg = POINTER_SHIFT(pMsg->pCont, sizeof(SMsgHead));
  int32_t msgLen = pMsg->contLen - sizeof(SMsgHead);

  // deserialize
292
  SStreamScanHistoryFinishReq req;
L
Liu Jicong 已提交
293 294 295

  SDecoder decoder;
  tDecoderInit(&decoder, msg, msgLen);
296
  tDecodeStreamScanHistoryFinishReq(&decoder, &req);
L
Liu Jicong 已提交
297 298 299
  tDecoderClear(&decoder);

  // find task
300
  SStreamTask *pTask = streamMetaAcquireTask(pSnode->pMeta, req.downstreamTaskId);
L
Liu Jicong 已提交
301 302 303 304
  if (pTask == NULL) {
    return -1;
  }
  // do process request
305
  if (streamProcessScanHistoryFinishReq(pTask, &req, &pMsg->info) < 0) {
L
Liu Jicong 已提交
306
    streamMetaReleaseTask(pSnode->pMeta, pTask);
L
Liu Jicong 已提交
307 308 309
    return -1;
  }

L
Liu Jicong 已提交
310
  streamMetaReleaseTask(pSnode->pMeta, pTask);
L
Liu Jicong 已提交
311 312 313 314 315 316 317 318
  return 0;
}

int32_t sndProcessTaskRecoverFinishRsp(SSnode *pSnode, SRpcMsg *pMsg) {
  //
  return 0;
}

319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348
int32_t sndProcessStreamTaskCheckReq(SSnode *pSnode, SRpcMsg *pMsg) {
  char   *msgStr = pMsg->pCont;
  char   *msgBody = POINTER_SHIFT(msgStr, sizeof(SMsgHead));
  int32_t msgLen = pMsg->contLen - sizeof(SMsgHead);

  SStreamTaskCheckReq req;
  SDecoder            decoder;

  tDecoderInit(&decoder, (uint8_t *)msgBody, msgLen);
  tDecodeStreamTaskCheckReq(&decoder, &req);
  tDecoderClear(&decoder);

  int32_t taskId = req.downstreamTaskId;

  SStreamTaskCheckRsp rsp = {
      .reqId = req.reqId,
      .streamId = req.streamId,
      .childId = req.childId,
      .downstreamNodeId = req.downstreamNodeId,
      .downstreamTaskId = req.downstreamTaskId,
      .upstreamNodeId = req.upstreamNodeId,
      .upstreamTaskId = req.upstreamTaskId,
  };

  SStreamTask *pTask = streamMetaAcquireTask(pSnode->pMeta, taskId);

  if (pTask != NULL) {
    rsp.status = streamTaskCheckStatus(pTask);
    streamMetaReleaseTask(pSnode->pMeta, pTask);

349 350 351
    const char* pStatus = streamGetTaskStatusStr(pTask->status.taskStatus);
    qDebug("s-task:%s status:%s, recv task check req(reqId:0x%" PRIx64 ") task:0x%x (vgId:%d), ready:%d",
            pTask->id.idStr, pStatus, rsp.reqId, rsp.upstreamTaskId, rsp.upstreamNodeId, rsp.status);
352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414
  } else {
    rsp.status = 0;
    qDebug("tq recv task check(taskId:0x%x not built yet) req(reqId:0x%" PRIx64
            ") from task:0x%x (vgId:%d), rsp status %d",
            taskId, rsp.reqId, rsp.upstreamTaskId, rsp.upstreamNodeId, rsp.status);
  }

  SEncoder encoder;
  int32_t  code;
  int32_t  len;

  tEncodeSize(tEncodeStreamTaskCheckRsp, &rsp, len, code);
  if (code < 0) {
    qError("vgId:%d failed to encode task check rsp, task:0x%x", pSnode->pMeta->vgId, taskId);
    return -1;
  }

  void *buf = rpcMallocCont(sizeof(SMsgHead) + len);
  ((SMsgHead *)buf)->vgId = htonl(req.upstreamNodeId);

  void *abuf = POINTER_SHIFT(buf, sizeof(SMsgHead));
  tEncoderInit(&encoder, (uint8_t *)abuf, len);
  tEncodeStreamTaskCheckRsp(&encoder, &rsp);
  tEncoderClear(&encoder);

  SRpcMsg rspMsg = {.code = 0, .pCont = buf, .contLen = sizeof(SMsgHead) + len, .info = pMsg->info};

  tmsgSendRsp(&rspMsg);
  return 0;
}

int32_t sndProcessStreamTaskCheckRsp(SSnode* pSnode, SRpcMsg* pMsg) {
  char* pReq = POINTER_SHIFT(pMsg->pCont, sizeof(SMsgHead));
  int32_t len = pMsg->contLen - sizeof(SMsgHead);

  int32_t             code;
  SStreamTaskCheckRsp rsp;

  SDecoder decoder;
  tDecoderInit(&decoder, (uint8_t*)pReq, len);
  code = tDecodeStreamTaskCheckRsp(&decoder, &rsp);

  if (code < 0) {
    tDecoderClear(&decoder);
    return -1;
  }

  tDecoderClear(&decoder);
  qDebug("tq task:0x%x (vgId:%d) recv check rsp(reqId:0x%" PRIx64 ") from 0x%x (vgId:%d) status %d",
          rsp.upstreamTaskId, rsp.upstreamNodeId, rsp.reqId, rsp.downstreamTaskId, rsp.downstreamNodeId, rsp.status);

  SStreamTask* pTask = streamMetaAcquireTask(pSnode->pMeta, rsp.upstreamTaskId);
  if (pTask == NULL) {
    qError("tq failed to locate the stream task:0x%x (vgId:%d), it may have been destroyed", rsp.upstreamTaskId,
            pSnode->pMeta->vgId);
    return -1;
  }

  code = streamProcessCheckRsp(pTask, &rsp);
  streamMetaReleaseTask(pSnode->pMeta, pTask);
  return code;
}

L
Liu Jicong 已提交
415
int32_t sndProcessStreamMsg(SSnode *pSnode, SRpcMsg *pMsg) {
L
Liu Jicong 已提交
416 417 418 419
  switch (pMsg->msgType) {
    case TDMT_STREAM_TASK_RUN:
      return sndProcessTaskRunReq(pSnode, pMsg);
    case TDMT_STREAM_TASK_DISPATCH:
L
Liu Jicong 已提交
420
      return sndProcessTaskDispatchReq(pSnode, pMsg, true);
L
Liu Jicong 已提交
421 422
    case TDMT_STREAM_TASK_DISPATCH_RSP:
      return sndProcessTaskDispatchRsp(pSnode, pMsg);
L
Liu Jicong 已提交
423 424
    case TDMT_STREAM_RETRIEVE:
      return sndProcessTaskRetrieveReq(pSnode, pMsg);
L
Liu Jicong 已提交
425
    case TDMT_STREAM_RETRIEVE_RSP:
5
54liuyao 已提交
426
      return sndProcessTaskRetrieveRsp(pSnode, pMsg);
427
    case TDMT_STREAM_SCAN_HISTORY_FINISH:
428
      return sndProcessStreamTaskScanHistoryFinishReq(pSnode, pMsg);
429
    case TDMT_STREAM_SCAN_HISTORY_FINISH_RSP:
L
Liu Jicong 已提交
430
      return sndProcessTaskRecoverFinishRsp(pSnode, pMsg);
431 432 433 434
    case TDMT_STREAM_TASK_CHECK:
      return sndProcessStreamTaskCheckReq(pSnode, pMsg);
    case TDMT_STREAM_TASK_CHECK_RSP:
      return sndProcessStreamTaskCheckRsp(pSnode, pMsg);
L
Liu Jicong 已提交
435 436 437 438
    default:
      ASSERT(0);
  }
  return 0;
L
Liu Jicong 已提交
439
}