tsdbMerge.c 12.0 KB
Newer Older
H
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/>.
 */

H
Hongze Cheng 已提交
16
#include "tsdbMerge.h"
H
Hongze Cheng 已提交
17

H
Hongze Cheng 已提交
18
typedef struct {
H
Hongze Cheng 已提交
19 20
  STsdb         *tsdb;
  TFileSetArray *fsetArr;
H
Hongze Cheng 已提交
21

H
Hongze Cheng 已提交
22 23 24 25 26 27 28
  int32_t sttTrigger;
  int32_t maxRow;
  int32_t minRow;
  int32_t szPage;
  int8_t  cmprAlg;
  int64_t compactVersion;
  int64_t cid;
H
Hongze Cheng 已提交
29

H
Hongze Cheng 已提交
30
  // context
H
Hongze Cheng 已提交
31
  struct {
H
Hongze Cheng 已提交
32
    bool       opened;
H
Hongze Cheng 已提交
33
    int64_t    now;
H
Hongze Cheng 已提交
34
    STFileSet *fset;
H
Hongze Cheng 已提交
35 36
    bool       toData;
    int32_t    level;
H
Hongze Cheng 已提交
37
    SSttLvl   *lvl;
H
Hongze Cheng 已提交
38
    TABLEID    tbid[1];
H
Hongze Cheng 已提交
39
  } ctx[1];
H
Hongze Cheng 已提交
40

H
Hongze Cheng 已提交
41 42
  TFileOpArray fopArr[1];

H
Hongze Cheng 已提交
43
  // reader
H
Hongze Cheng 已提交
44
  TSttFileReaderArray sttReaderArr[1];
H
Hongze Cheng 已提交
45
  // iter
H
Hongze Cheng 已提交
46 47 48 49
  TTsdbIterArray dataIterArr[1];
  SIterMerger   *dataIterMerger;
  TTsdbIterArray tombIterArr[1];
  SIterMerger   *tombIterMerger;
H
Hongze Cheng 已提交
50
  // writer
H
Hongze Cheng 已提交
51
  SFSetWriter *writer;
H
Hongze Cheng 已提交
52 53
} SMerger;

H
Hongze Cheng 已提交
54
static int32_t tsdbMergerOpen(SMerger *merger) {
H
Hongze Cheng 已提交
55
  merger->ctx->now = taosGetTimestampSec();
H
Hongze Cheng 已提交
56 57 58 59 60
  merger->maxRow = merger->tsdb->pVnode->config.tsdbCfg.maxRows;
  merger->minRow = merger->tsdb->pVnode->config.tsdbCfg.minRows;
  merger->szPage = merger->tsdb->pVnode->config.tsdbPageSize;
  merger->cmprAlg = merger->tsdb->pVnode->config.tsdbCfg.compression;
  merger->compactVersion = INT64_MAX;
H
Hongze Cheng 已提交
61
  merger->cid = tsdbFSAllocEid(merger->tsdb->pFS);
H
Hongze Cheng 已提交
62
  merger->ctx->opened = true;
H
Hongze Cheng 已提交
63
  return 0;
H
Hongze Cheng 已提交
64 65
}

H
Hongze Cheng 已提交
66
static int32_t tsdbMergerClose(SMerger *merger) {
H
Hongze Cheng 已提交
67 68 69
  int32_t code = 0;
  int32_t lino = 0;
  SVnode *pVnode = merger->tsdb->pVnode;
H
Hongze Cheng 已提交
70 71

  // edit file system
H
Hongze Cheng 已提交
72
  code = tsdbFSEditBegin(merger->tsdb->pFS, merger->fopArr, TSDB_FEDIT_MERGE);
H
Hongze Cheng 已提交
73 74
  TSDB_CHECK_CODE(code, lino, _exit);

H
Hongze Cheng 已提交
75
  taosThreadRwlockWrlock(&merger->tsdb->rwLock);
H
Hongze Cheng 已提交
76
  code = tsdbFSEditCommit(merger->tsdb->pFS);
H
Hongze Cheng 已提交
77 78 79 80 81
  if (code) {
    taosThreadRwlockUnlock(&merger->tsdb->rwLock);
    TSDB_CHECK_CODE(code, lino, _exit);
  }
  taosThreadRwlockUnlock(&merger->tsdb->rwLock);
H
Hongze Cheng 已提交
82

H
Hongze Cheng 已提交
83
  ASSERT(merger->writer == NULL);
H
Hongze Cheng 已提交
84
  ASSERT(merger->dataIterMerger == NULL);
H
Hongze Cheng 已提交
85
  ASSERT(merger->tombIterMerger == NULL);
H
Hongze Cheng 已提交
86
  ASSERT(TARRAY2_SIZE(merger->dataIterArr) == 0);
H
Hongze Cheng 已提交
87
  ASSERT(TARRAY2_SIZE(merger->tombIterArr) == 0);
H
Hongze Cheng 已提交
88 89
  ASSERT(TARRAY2_SIZE(merger->sttReaderArr) == 0);

H
Hongze Cheng 已提交
90
  // clear the merge
H
Hongze Cheng 已提交
91
  TARRAY2_DESTROY(merger->tombIterArr, NULL);
H
Hongze Cheng 已提交
92 93 94
  TARRAY2_DESTROY(merger->dataIterArr, NULL);
  TARRAY2_DESTROY(merger->sttReaderArr, NULL);
  TARRAY2_DESTROY(merger->fopArr, NULL);
H
Hongze Cheng 已提交
95 96 97

_exit:
  if (code) {
H
Hongze Cheng 已提交
98
    TSDB_ERROR_LOG(TD_VID(pVnode), lino, code);
H
Hongze Cheng 已提交
99
  }
H
Hongze Cheng 已提交
100
  return code;
H
Hongze Cheng 已提交
101
}
H
Hongze Cheng 已提交
102

H
Hongze Cheng 已提交
103 104 105
static int32_t tsdbMergeFileSetBeginOpenReader(SMerger *merger) {
  int32_t code = 0;
  int32_t lino = 0;
H
Hongze Cheng 已提交
106

H
Hongze Cheng 已提交
107 108
  merger->ctx->toData = true;
  merger->ctx->level = 0;
H
Hongze Cheng 已提交
109 110 111 112 113 114 115 116

  for (int32_t i = 0;; ++i) {
    if (i >= TARRAY2_SIZE(merger->ctx->fset->lvlArr)) {
      merger->ctx->lvl = NULL;
      break;
    }

    merger->ctx->lvl = TARRAY2_GET(merger->ctx->fset->lvlArr, i);
117 118
    if (merger->ctx->lvl->level != merger->ctx->level ||
        TARRAY2_SIZE(merger->ctx->lvl->fobjArr) + 1 < merger->sttTrigger) {
H
Hongze Cheng 已提交
119 120
      merger->ctx->toData = false;
      merger->ctx->lvl = NULL;
H
Hongze Cheng 已提交
121
      break;
H
Hongze Cheng 已提交
122
    }
H
Hongze Cheng 已提交
123

124
    merger->ctx->level++;
H
Hongze Cheng 已提交
125

126 127 128 129 130 131
    STFileObj *fobj;
    int32_t    numFile = 0;
    TARRAY2_FOREACH(merger->ctx->lvl->fobjArr, fobj) {
      if (numFile == merger->sttTrigger) {
        break;
      }
H
Hongze Cheng 已提交
132

H
Hongze Cheng 已提交
133 134 135
      STFileOp op = {
          .optype = TSDB_FOP_REMOVE,
          .fid = merger->ctx->fset->fid,
136
          .of = fobj->f[0],
H
Hongze Cheng 已提交
137 138 139 140
      };
      code = TARRAY2_APPEND(merger->fopArr, op);
      TSDB_CHECK_CODE(code, lino, _exit);

H
Hongze Cheng 已提交
141
      SSttFileReader      *reader;
142
      SSttFileReaderConfig config = {
H
Hongze Cheng 已提交
143
          .tsdb = merger->tsdb,
H
Hongze Cheng 已提交
144
          .szPage = merger->szPage,
145 146 147 148
          .file[0] = fobj->f[0],
      };

      code = tsdbSttFileReaderOpen(fobj->fname, &config, &reader);
H
Hongze Cheng 已提交
149
      TSDB_CHECK_CODE(code, lino, _exit);
H
Hongze Cheng 已提交
150

H
Hongze Cheng 已提交
151
      code = TARRAY2_APPEND(merger->sttReaderArr, reader);
H
Hongze Cheng 已提交
152
      TSDB_CHECK_CODE(code, lino, _exit);
H
Hongze Cheng 已提交
153 154
    }
  }
H
Hongze Cheng 已提交
155

H
Hongze Cheng 已提交
156 157
_exit:
  if (code) {
H
Hongze Cheng 已提交
158
    TSDB_ERROR_LOG(TD_VID(merger->tsdb->pVnode), lino, code);
H
Hongze Cheng 已提交
159 160 161 162 163 164 165 166 167 168 169
  }
  return code;
}

static int32_t tsdbMergeFileSetBeginOpenIter(SMerger *merger) {
  int32_t code = 0;
  int32_t lino = 0;
  int32_t vid = TD_VID(merger->tsdb->pVnode);

  SSttFileReader *sttReader;
  TARRAY2_FOREACH(merger->sttReaderArr, sttReader) {
170 171
    STsdbIter      *iter;
    STsdbIterConfig config = {0};
H
Hongze Cheng 已提交
172

173 174 175 176 177
    // data iter
    config.type = TSDB_ITER_TYPE_STT;
    config.sttReader = sttReader;

    code = tsdbIterOpen(&config, &iter);
H
Hongze Cheng 已提交
178 179
    TSDB_CHECK_CODE(code, lino, _exit);

180 181
    code = TARRAY2_APPEND(merger->dataIterArr, iter);
    TSDB_CHECK_CODE(code, lino, _exit);
H
Hongze Cheng 已提交
182

183 184 185
    // tomb iter
    config.type = TSDB_ITER_TYPE_STT_TOMB;
    config.sttReader = sttReader;
H
Hongze Cheng 已提交
186

187 188
    code = tsdbIterOpen(&config, &iter);
    TSDB_CHECK_CODE(code, lino, _exit);
H
Hongze Cheng 已提交
189

190 191
    code = TARRAY2_APPEND(merger->tombIterArr, iter);
    TSDB_CHECK_CODE(code, lino, _exit);
H
Hongze Cheng 已提交
192
  }
H
Hongze Cheng 已提交
193

H
Hongze Cheng 已提交
194 195 196 197
  code = tsdbIterMergerOpen(merger->dataIterArr, &merger->dataIterMerger, false);
  TSDB_CHECK_CODE(code, lino, _exit);

  code = tsdbIterMergerOpen(merger->tombIterArr, &merger->tombIterMerger, true);
H
Hongze Cheng 已提交
198 199 200 201 202 203 204 205 206 207 208 209 210 211
  TSDB_CHECK_CODE(code, lino, _exit);

_exit:
  if (code) {
    TSDB_ERROR_LOG(vid, lino, code);
  }
  return code;
}

static int32_t tsdbMergeFileSetBeginOpenWriter(SMerger *merger) {
  int32_t code = 0;
  int32_t lino = 0;
  int32_t vid = TD_VID(merger->tsdb->pVnode);

212 213 214 215
  SDiskID did;
  int32_t level = tsdbFidLevel(merger->ctx->fset->fid, &merger->tsdb->keepCfg, merger->ctx->now);
  if (tfsAllocDisk(merger->tsdb->pVnode->pTfs, level, &did) < 0) {
    code = TSDB_CODE_FS_NO_VALID_DISK;
H
Hongze Cheng 已提交
216
    TSDB_CHECK_CODE(code, lino, _exit);
217
  }
H
Hongze Cheng 已提交
218 219 220 221 222 223 224 225 226 227 228 229 230
  SFSetWriterConfig config = {
      .tsdb = merger->tsdb,
      .toSttOnly = true,
      .compactVersion = merger->compactVersion,
      .minRow = merger->minRow,
      .maxRow = merger->maxRow,
      .szPage = merger->szPage,
      .cmprAlg = merger->cmprAlg,
      .fid = merger->ctx->fset->fid,
      .cid = merger->cid,
      .did = did,
      .level = merger->ctx->level,
  };
H
Hongze Cheng 已提交
231

H
Hongze Cheng 已提交
232
  if (merger->ctx->toData) {
H
Hongze Cheng 已提交
233
    config.toSttOnly = false;
H
Hongze Cheng 已提交
234

H
Hongze Cheng 已提交
235 236 237 238
    for (int32_t ftype = 0; ftype < TSDB_FTYPE_MAX; ++ftype) {
      if (merger->ctx->fset->farr[ftype]) {
        config.files[ftype].exist = true;
        config.files[ftype].file = merger->ctx->fset->farr[ftype]->f[0];
H
Hongze Cheng 已提交
239
      } else {
H
Hongze Cheng 已提交
240
        config.files[ftype].exist = false;
H
Hongze Cheng 已提交
241 242
      }
    }
H
Hongze Cheng 已提交
243
  }
H
Hongze Cheng 已提交
244

H
Hongze Cheng 已提交
245 246 247
  code = tsdbFSetWriterOpen(&config, &merger->writer);
  TSDB_CHECK_CODE(code, lino, _exit);

H
Hongze Cheng 已提交
248 249
_exit:
  if (code) {
H
Hongze Cheng 已提交
250
    TSDB_ERROR_LOG(vid, lino, code);
H
Hongze Cheng 已提交
251 252 253
  }
  return code;
}
H
Hongze Cheng 已提交
254 255

static int32_t tsdbMergeFileSetBegin(SMerger *merger) {
H
Hongze Cheng 已提交
256 257 258
  int32_t code = 0;
  int32_t lino = 0;

H
Hongze Cheng 已提交
259
  ASSERT(TARRAY2_SIZE(merger->sttReaderArr) == 0);
H
Hongze Cheng 已提交
260 261
  ASSERT(TARRAY2_SIZE(merger->dataIterArr) == 0);
  ASSERT(merger->dataIterMerger == NULL);
H
Hongze Cheng 已提交
262
  ASSERT(merger->writer == NULL);
H
Hongze Cheng 已提交
263

H
Hongze Cheng 已提交
264 265 266
  merger->ctx->tbid->suid = 0;
  merger->ctx->tbid->uid = 0;

H
Hongze Cheng 已提交
267 268
  // open reader
  code = tsdbMergeFileSetBeginOpenReader(merger);
H
Hongze Cheng 已提交
269 270
  TSDB_CHECK_CODE(code, lino, _exit);

H
Hongze Cheng 已提交
271 272 273 274 275 276 277 278 279 280
  // open iterator
  code = tsdbMergeFileSetBeginOpenIter(merger);
  TSDB_CHECK_CODE(code, lino, _exit);

  // open writer
  code = tsdbMergeFileSetBeginOpenWriter(merger);
  TSDB_CHECK_CODE(code, lino, _exit);

_exit:
  if (code) {
H
Hongze Cheng 已提交
281
    TSDB_ERROR_LOG(TD_VID(merger->tsdb->pVnode), lino, code);
H
Hongze Cheng 已提交
282
  }
H
Hongze Cheng 已提交
283 284 285 286
  return code;
}

static int32_t tsdbMergeFileSetEndCloseWriter(SMerger *merger) {
H
Hongze Cheng 已提交
287
  return tsdbFSetWriterClose(&merger->writer, 0, merger->fopArr);
H
Hongze Cheng 已提交
288
}
H
Hongze Cheng 已提交
289 290

static int32_t tsdbMergeFileSetEndCloseIter(SMerger *merger) {
H
Hongze Cheng 已提交
291 292 293 294
  tsdbIterMergerClose(&merger->tombIterMerger);
  TARRAY2_CLEAR(merger->tombIterArr, tsdbIterClose);
  tsdbIterMergerClose(&merger->dataIterMerger);
  TARRAY2_CLEAR(merger->dataIterArr, tsdbIterClose);
H
Hongze Cheng 已提交
295 296 297 298
  return 0;
}

static int32_t tsdbMergeFileSetEndCloseReader(SMerger *merger) {
H
Hongze Cheng 已提交
299
  TARRAY2_CLEAR(merger->sttReaderArr, tsdbSttFileReaderClose);
H
Hongze Cheng 已提交
300 301 302 303
  return 0;
}

static int32_t tsdbMergeFileSetEnd(SMerger *merger) {
H
Hongze Cheng 已提交
304 305 306
  int32_t code = 0;
  int32_t lino = 0;

H
Hongze Cheng 已提交
307 308 309 310 311 312 313 314 315 316 317
  code = tsdbMergeFileSetEndCloseWriter(merger);
  TSDB_CHECK_CODE(code, lino, _exit);

  code = tsdbMergeFileSetEndCloseIter(merger);
  TSDB_CHECK_CODE(code, lino, _exit);

  code = tsdbMergeFileSetEndCloseReader(merger);
  TSDB_CHECK_CODE(code, lino, _exit);

_exit:
  if (code) {
H
Hongze Cheng 已提交
318
    TSDB_ERROR_LOG(TD_VID(merger->tsdb->pVnode), lino, code);
H
Hongze Cheng 已提交
319
  }
H
Hongze Cheng 已提交
320 321
  return code;
}
H
Hongze Cheng 已提交
322

H
Hongze Cheng 已提交
323 324 325
static int32_t tsdbMergeFileSet(SMerger *merger, STFileSet *fset) {
  int32_t code = 0;
  int32_t lino = 0;
H
Hongze Cheng 已提交
326

H
Hongze Cheng 已提交
327
  merger->ctx->fset = fset;
H
Hongze Cheng 已提交
328 329 330
  code = tsdbMergeFileSetBegin(merger);
  TSDB_CHECK_CODE(code, lino, _exit);

H
Hongze Cheng 已提交
331 332 333 334 335 336 337
  // data
  SMetaInfo info;
  SRowInfo *row;
  merger->ctx->tbid->suid = 0;
  merger->ctx->tbid->uid = 0;
  while ((row = tsdbIterMergerGetData(merger->dataIterMerger)) != NULL) {
    if (row->uid != merger->ctx->tbid->uid) {
H
fix bug  
Hongze Cheng 已提交
338 339 340
      merger->ctx->tbid->uid = row->uid;
      merger->ctx->tbid->suid = row->suid;

H
Hongze Cheng 已提交
341
      if (metaGetInfo(merger->tsdb->pVnode->pMeta, row->uid, &info, NULL) != 0) {
H
fix bug  
Hongze Cheng 已提交
342
        code = tsdbIterMergerSkipTableData(merger->dataIterMerger, merger->ctx->tbid);
H
Hongze Cheng 已提交
343 344 345 346 347 348
        TSDB_CHECK_CODE(code, lino, _exit);
        continue;
      }
    }

    code = tsdbFSetWriteRow(merger->writer, row);
H
Hongze Cheng 已提交
349
    TSDB_CHECK_CODE(code, lino, _exit);
H
Hongze Cheng 已提交
350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373

    code = tsdbIterMergerNext(merger->dataIterMerger);
    TSDB_CHECK_CODE(code, lino, _exit);
  }

  // tomb
  STombRecord *record;
  merger->ctx->tbid->suid = 0;
  merger->ctx->tbid->uid = 0;
  while ((record = tsdbIterMergerGetTombRecord(merger->tombIterMerger)) != NULL) {
    if (record->uid != merger->ctx->tbid->uid) {
      merger->ctx->tbid->uid = record->uid;
      merger->ctx->tbid->suid = record->suid;

      if (metaGetInfo(merger->tsdb->pVnode->pMeta, record->uid, &info, NULL) != 0) {
        code = tsdbIterMergerSkipTableData(merger->tombIterMerger, merger->ctx->tbid);
        TSDB_CHECK_CODE(code, lino, _exit);
        continue;
      }
    }
    code = tsdbFSetWriteTombRecord(merger->writer, record);
    TSDB_CHECK_CODE(code, lino, _exit);

    code = tsdbIterMergerNext(merger->tombIterMerger);
H
Hongze Cheng 已提交
374 375
    TSDB_CHECK_CODE(code, lino, _exit);
  }
H
Hongze Cheng 已提交
376 377 378 379

  code = tsdbMergeFileSetEnd(merger);
  TSDB_CHECK_CODE(code, lino, _exit);

H
Hongze Cheng 已提交
380 381
_exit:
  if (code) {
H
Hongze Cheng 已提交
382
    tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(merger->tsdb->pVnode), __func__, lino, tstrerror(code));
H
Hongze Cheng 已提交
383
  } else {
H
Hongze Cheng 已提交
384
    tsdbDebug("vgId:%d %s done, fid:%d", TD_VID(merger->tsdb->pVnode), __func__, fset->fid);
H
Hongze Cheng 已提交
385
  }
H
Hongze Cheng 已提交
386
  return 0;
H
Hongze Cheng 已提交
387 388
}

H
Hongze Cheng 已提交
389
static int32_t tsdbDoMerge(SMerger *merger) {
H
Hongze Cheng 已提交
390
  int32_t code = 0;
H
Hongze Cheng 已提交
391
  int32_t lino = 0;
H
Hongze Cheng 已提交
392

H
Hongze Cheng 已提交
393 394
  STFileSet *fset;
  TARRAY2_FOREACH(merger->fsetArr, fset) {
395 396 397
    if (TARRAY2_SIZE(fset->lvlArr) == 0) continue;

    SSttLvl *lvl = TARRAY2_FIRST(fset->lvlArr);
H
Hongze Cheng 已提交
398

399
    if (lvl->level != 0 || TARRAY2_SIZE(lvl->fobjArr) < merger->sttTrigger) continue;
H
Hongze Cheng 已提交
400

H
Hongze Cheng 已提交
401 402 403 404 405
    if (!merger->ctx->opened) {
      code = tsdbMergerOpen(merger);
      TSDB_CHECK_CODE(code, lino, _exit);
    }

H
Hongze Cheng 已提交
406 407
    code = tsdbMergeFileSet(merger, fset);
    TSDB_CHECK_CODE(code, lino, _exit);
H
Hongze Cheng 已提交
408 409
  }

H
Hongze Cheng 已提交
410 411
  if (merger->ctx->opened) {
    code = tsdbMergerClose(merger);
H
Hongze Cheng 已提交
412 413
    TSDB_CHECK_CODE(code, lino, _exit);
  }
H
Hongze Cheng 已提交
414

H
Hongze Cheng 已提交
415 416
_exit:
  if (code) {
H
Hongze Cheng 已提交
417
    TSDB_ERROR_LOG(TD_VID(merger->tsdb->pVnode), lino, code);
H
Hongze Cheng 已提交
418
  } else {
H
Hongze Cheng 已提交
419
    tsdbDebug("vgId:%d %s done", TD_VID(merger->tsdb->pVnode), __func__);
H
Hongze Cheng 已提交
420 421 422 423
  }
  return code;
}

H
Hongze Cheng 已提交
424
int32_t tsdbMerge(void *arg) {
H
Hongze Cheng 已提交
425 426
  int32_t code = 0;
  int32_t lino = 0;
H
Hongze Cheng 已提交
427
  STsdb  *tsdb = (STsdb *)arg;
H
Hongze Cheng 已提交
428 429 430 431 432 433

  SMerger merger[1] = {{
      .tsdb = tsdb,
      .sttTrigger = tsdb->pVnode->config.sttTrigger,
  }};

H
Hongze Cheng 已提交
434 435
  ASSERT(merger->sttTrigger > 1);

H
Hongze Cheng 已提交
436
  code = tsdbFSCreateCopySnapshot(tsdb->pFS, &merger->fsetArr);
H
Hongze Cheng 已提交
437 438 439 440 441
  TSDB_CHECK_CODE(code, lino, _exit);

  code = tsdbDoMerge(merger);
  TSDB_CHECK_CODE(code, lino, _exit);

H
Hongze Cheng 已提交
442
  tsdbFSDestroyCopySnapshot(&merger->fsetArr);
H
Hongze Cheng 已提交
443

H
Hongze Cheng 已提交
444 445
_exit:
  if (code) {
H
Hongze Cheng 已提交
446
    TSDB_ERROR_LOG(TD_VID(tsdb->pVnode), lino, code);
H
Hongze Cheng 已提交
447
  } else if (merger->ctx->opened) {
H
Hongze Cheng 已提交
448
    tsdbDebug("vgId:%d %s done", TD_VID(tsdb->pVnode), __func__);
H
Hongze Cheng 已提交
449
  }
H
Hongze Cheng 已提交
450
  return code;
H
Hongze Cheng 已提交
451
}