walWrite.c 11.1 KB
Newer Older
陶建辉(Jeff)'s avatar
陶建辉(Jeff) 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
/*
 * 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/>.
 */

#include "os.h"
S
Shengliang Guan 已提交
17
#include "taoserror.h"
18
#include "tchecksum.h"
S
Shengliang Guan 已提交
19
#include "walInt.h"
陶建辉(Jeff)'s avatar
陶建辉(Jeff) 已提交
20

L
Liu Jicong 已提交
21
int32_t walCommit(SWal *pWal, int64_t ver) {
L
Liu Jicong 已提交
22 23
  ASSERT(pWal->vers.commitVer >= pWal->vers.snapshotVer);
  ASSERT(pWal->vers.commitVer <= pWal->vers.lastVer);
L
Liu Jicong 已提交
24
  if (ver < pWal->vers.commitVer || ver > pWal->vers.lastVer) {
L
Liu Jicong 已提交
25
    terrno = TSDB_CODE_WAL_INVALID_VER;
L
Liu Jicong 已提交
26 27
    return -1;
  }
L
Liu Jicong 已提交
28
  pWal->vers.commitVer = ver;
L
Liu Jicong 已提交
29 30 31 32
  return 0;
}

int32_t walRollback(SWal *pWal, int64_t ver) {
L
Liu Jicong 已提交
33
  int  code;
L
Liu Jicong 已提交
34
  char fnameStr[WAL_FILE_LEN];
L
Liu Jicong 已提交
35
  if (ver > pWal->vers.lastVer || ver < pWal->vers.commitVer) {
L
Liu Jicong 已提交
36
    terrno = TSDB_CODE_WAL_INVALID_VER;
L
Liu Jicong 已提交
37 38
    return -1;
  }
wafwerar's avatar
wafwerar 已提交
39
  taosThreadMutexLock(&pWal->mutex);
L
Liu Jicong 已提交
40

L
Liu Jicong 已提交
41 42
  // find correct file
  if (ver < walGetLastFileFirstVer(pWal)) {
L
Liu Jicong 已提交
43 44 45
    // change current files
    code = walChangeWrite(pWal, ver);
    if (code < 0) {
L
Liu Jicong 已提交
46 47 48
      return -1;
    }

L
Liu Jicong 已提交
49
    // delete files
L
Liu Jicong 已提交
50
    int fileSetSize = taosArrayGetSize(pWal->fileInfoSet);
L
Liu Jicong 已提交
51
    for (int i = pWal->writeCur; i < fileSetSize; i++) {
L
Liu Jicong 已提交
52
      walBuildLogName(pWal, ((SWalFileInfo *)taosArrayGet(pWal->fileInfoSet, i))->firstVer, fnameStr);
53
      taosRemoveFile(fnameStr);
L
Liu Jicong 已提交
54
      walBuildIdxName(pWal, ((SWalFileInfo *)taosArrayGet(pWal->fileInfoSet, i))->firstVer, fnameStr);
55
      taosRemoveFile(fnameStr);
L
Liu Jicong 已提交
56
    }
L
Liu Jicong 已提交
57
    // pop from fileInfoSet
L
Liu Jicong 已提交
58 59 60 61
    taosArraySetSize(pWal->fileInfoSet, pWal->writeCur + 1);
  }

  walBuildIdxName(pWal, walGetCurFileFirstVer(pWal), fnameStr);
62
  TdFilePtr pIdxTFile = taosOpenFile(fnameStr, TD_FILE_WRITE | TD_FILE_READ);
L
Liu Jicong 已提交
63

64
  if (pIdxTFile == NULL) {
wafwerar's avatar
wafwerar 已提交
65
    taosThreadMutexUnlock(&pWal->mutex);
L
Liu Jicong 已提交
66 67
    return -1;
  }
L
Liu Jicong 已提交
68
  int64_t idxOff = walGetVerIdxOffset(pWal, ver);
69
  code = taosLSeekFile(pIdxTFile, idxOff, SEEK_SET);
L
Liu Jicong 已提交
70
  if (code < 0) {
wafwerar's avatar
wafwerar 已提交
71
    taosThreadMutexUnlock(&pWal->mutex);
L
Liu Jicong 已提交
72 73
    return -1;
  }
L
Liu Jicong 已提交
74
  // read idx file and get log file pos
L
Liu Jicong 已提交
75
  SWalIdxEntry entry;
76
  if (taosReadFile(pIdxTFile, &entry, sizeof(SWalIdxEntry)) != sizeof(SWalIdxEntry)) {
wafwerar's avatar
wafwerar 已提交
77
    taosThreadMutexUnlock(&pWal->mutex);
L
Liu Jicong 已提交
78 79 80 81 82
    return -1;
  }
  ASSERT(entry.ver == ver);

  walBuildLogName(pWal, walGetCurFileFirstVer(pWal), fnameStr);
83
  TdFilePtr pLogTFile = taosOpenFile(fnameStr, TD_FILE_WRITE | TD_FILE_READ);
84
  if (pLogTFile == NULL) {
L
Liu Jicong 已提交
85
    // TODO
wafwerar's avatar
wafwerar 已提交
86
    taosThreadMutexUnlock(&pWal->mutex);
L
Liu Jicong 已提交
87 88
    return -1;
  }
89
  code = taosLSeekFile(pLogTFile, entry.offset, SEEK_SET);
L
Liu Jicong 已提交
90 91
  if (code < 0) {
    // TODO
wafwerar's avatar
wafwerar 已提交
92
    taosThreadMutexUnlock(&pWal->mutex);
L
Liu Jicong 已提交
93 94
    return -1;
  }
L
Liu Jicong 已提交
95
  // validate offset
L
Liu Jicong 已提交
96
  SWalHead head;
97 98
  ASSERT(taosValidFile(pLogTFile));
  int size = taosReadFile(pLogTFile, &head, sizeof(SWalHead));
L
Liu Jicong 已提交
99
  if (size != sizeof(SWalHead)) {
L
Liu Jicong 已提交
100 101 102 103 104
    return -1;
  }
  code = walValidHeadCksum(&head);

  ASSERT(code == 0);
L
Liu Jicong 已提交
105
  if (code != 0) {
L
Liu Jicong 已提交
106 107
    return -1;
  }
L
Liu Jicong 已提交
108 109
  if (head.head.version != ver) {
    // TODO
L
Liu Jicong 已提交
110 111
    return -1;
  }
L
Liu Jicong 已提交
112
  // truncate old files
113
  code = taosFtruncateFile(pLogTFile, entry.offset);
L
Liu Jicong 已提交
114
  if (code < 0) {
L
Liu Jicong 已提交
115 116
    return -1;
  }
117
  code = taosFtruncateFile(pIdxTFile, idxOff);
L
Liu Jicong 已提交
118
  if (code < 0) {
L
Liu Jicong 已提交
119 120
    return -1;
  }
L
Liu Jicong 已提交
121
  pWal->vers.lastVer = ver - 1;
L
Liu Jicong 已提交
122 123
  ((SWalFileInfo *)taosArrayGetLast(pWal->fileInfoSet))->lastVer = ver - 1;
  ((SWalFileInfo *)taosArrayGetLast(pWal->fileInfoSet))->fileSize = entry.offset;
L
Liu Jicong 已提交
124

L
Liu Jicong 已提交
125
  // unlock
wafwerar's avatar
wafwerar 已提交
126
  taosThreadMutexUnlock(&pWal->mutex);
L
Liu Jicong 已提交
127 128
  return 0;
}
L
Liu Jicong 已提交
129

L
Liu Jicong 已提交
130
int32_t walBeginSnapshot(SWal *pWal, int64_t ver) {
L
Liu Jicong 已提交
131
  pWal->vers.verInSnapshotting = ver;
L
Liu Jicong 已提交
132 133
  // check file rolling
  if (pWal->cfg.retentionPeriod == 0) {
L
Liu Jicong 已提交
134 135 136 137 138 139
    walRoll(pWal);
  }

  return 0;
}

L
Liu Jicong 已提交
140
int32_t walEndSnapshot(SWal *pWal) {
L
Liu Jicong 已提交
141
  int64_t ver = pWal->vers.verInSnapshotting;
S
Shengliang Guan 已提交
142
  if (ver == -1) return 0;
L
Liu Jicong 已提交
143

L
Liu Jicong 已提交
144
  pWal->vers.snapshotVer = ver;
L
Liu Jicong 已提交
145 146
  int ts = taosGetTimestampSec();

L
Liu Jicong 已提交
147 148 149
  int          deleteCnt = 0;
  int64_t      newTotSize = pWal->totSize;
  SWalFileInfo tmp;
L
Liu Jicong 已提交
150
  tmp.firstVer = ver;
L
Liu Jicong 已提交
151
  // find files safe to delete
L
Liu Jicong 已提交
152
  SWalFileInfo *pInfo = taosArraySearch(pWal->fileInfoSet, &tmp, compareWalFileInfo, TD_LE);
L
Liu Jicong 已提交
153
  if (ver >= pInfo->lastVer) {
L
Liu Jicong 已提交
154 155
    pInfo++;
  }
L
Liu Jicong 已提交
156
  // iterate files, until the searched result
L
Liu Jicong 已提交
157
  for (SWalFileInfo *iter = pWal->fileInfoSet->pData; iter < pInfo; iter++) {
L
fix  
Liu Jicong 已提交
158 159
    if ((pWal->cfg.retentionSize != -1 && pWal->totSize > pWal->cfg.retentionSize) ||
        (pWal->cfg.retentionPeriod != -1 && iter->closeTs + pWal->cfg.retentionPeriod > ts)) {
L
Liu Jicong 已提交
160
      // delete according to file size or close time
L
Liu Jicong 已提交
161 162 163 164 165
      deleteCnt++;
      newTotSize -= iter->fileSize;
    }
  }
  char fnameStr[WAL_FILE_LEN];
L
Liu Jicong 已提交
166 167
  // remove file
  for (int i = 0; i < deleteCnt; i++) {
L
Liu Jicong 已提交
168
    pInfo = taosArrayGet(pWal->fileInfoSet, i);
L
Liu Jicong 已提交
169
    walBuildLogName(pWal, pInfo->firstVer, fnameStr);
170
    taosRemoveFile(fnameStr);
L
Liu Jicong 已提交
171
    walBuildIdxName(pWal, pInfo->firstVer, fnameStr);
172
    taosRemoveFile(fnameStr);
L
Liu Jicong 已提交
173 174
  }

L
Liu Jicong 已提交
175 176 177
  // make new array, remove files
  taosArrayPopFrontBatch(pWal->fileInfoSet, deleteCnt);
  if (taosArrayGetSize(pWal->fileInfoSet) == 0) {
L
Liu Jicong 已提交
178
    pWal->writeCur = -1;
L
Liu Jicong 已提交
179
    pWal->vers.firstVer = -1;
L
Liu Jicong 已提交
180
  } else {
L
Liu Jicong 已提交
181
    pWal->vers.firstVer = ((SWalFileInfo *)taosArrayGet(pWal->fileInfoSet, 0))->firstVer;
L
Liu Jicong 已提交
182
  }
L
Liu Jicong 已提交
183
  pWal->writeCur = taosArrayGetSize(pWal->fileInfoSet) - 1;
L
Liu Jicong 已提交
184
  pWal->totSize = newTotSize;
L
Liu Jicong 已提交
185
  pWal->vers.verInSnapshotting = -1;
L
Liu Jicong 已提交
186

L
Liu Jicong 已提交
187
  // save snapshot ver, commit ver
L
Liu Jicong 已提交
188
  int code = walSaveMeta(pWal);
L
Liu Jicong 已提交
189
  if (code < 0) {
L
Liu Jicong 已提交
190 191 192 193 194 195
    return -1;
  }

  return 0;
}

L
Liu Jicong 已提交
196
int walRoll(SWal *pWal) {
L
Liu Jicong 已提交
197
  int code = 0;
198 199
  if (pWal->pWriteIdxTFile != NULL) {
    code = taosCloseFile(&pWal->pWriteIdxTFile);
L
Liu Jicong 已提交
200
    if (code != 0) {
L
Liu Jicong 已提交
201
      terrno = TAOS_SYSTEM_ERROR(errno);
L
Liu Jicong 已提交
202 203
      return -1;
    }
L
Liu Jicong 已提交
204
  }
205 206
  if (pWal->pWriteLogTFile != NULL) {
    code = taosCloseFile(&pWal->pWriteLogTFile);
L
Liu Jicong 已提交
207
    if (code != 0) {
L
Liu Jicong 已提交
208
      terrno = TAOS_SYSTEM_ERROR(errno);
L
Liu Jicong 已提交
209 210
      return -1;
    }
L
Liu Jicong 已提交
211
  }
212
  TdFilePtr pIdxTFile, pLogTFile;
L
Liu Jicong 已提交
213
  // create new file
L
Liu Jicong 已提交
214
  int64_t newFileFirstVersion = pWal->vers.lastVer + 1;
L
Liu Jicong 已提交
215
  char    fnameStr[WAL_FILE_LEN];
L
Liu Jicong 已提交
216
  walBuildIdxName(pWal, newFileFirstVersion, fnameStr);
217
  pIdxTFile = taosOpenFile(fnameStr, TD_FILE_CREATE | TD_FILE_WRITE | TD_FILE_APPEND);
218
  if (pIdxTFile == NULL) {
L
Liu Jicong 已提交
219
    terrno = TAOS_SYSTEM_ERROR(errno);
L
Liu Jicong 已提交
220 221 222
    return -1;
  }
  walBuildLogName(pWal, newFileFirstVersion, fnameStr);
223
  pLogTFile = taosOpenFile(fnameStr, TD_FILE_CREATE | TD_FILE_WRITE | TD_FILE_APPEND);
224
  if (pLogTFile == NULL) {
L
Liu Jicong 已提交
225
    terrno = TAOS_SYSTEM_ERROR(errno);
L
Liu Jicong 已提交
226 227 228
    return -1;
  }
  code = walRollFileInfo(pWal);
L
Liu Jicong 已提交
229
  if (code != 0) {
L
Liu Jicong 已提交
230 231
    return -1;
  }
L
Liu Jicong 已提交
232

L
Liu Jicong 已提交
233
  // switch file
234 235
  pWal->pWriteIdxTFile = pIdxTFile;
  pWal->pWriteLogTFile = pLogTFile;
L
Liu Jicong 已提交
236
  pWal->writeCur = taosArrayGetSize(pWal->fileInfoSet) - 1;
L
fix  
Liu Jicong 已提交
237
  ASSERT(pWal->writeCur >= 0);
L
Liu Jicong 已提交
238 239 240 241 242

  pWal->lastRollSeq = walGetSeq();
  return 0;
}

L
Liu Jicong 已提交
243
static int walWriteIndex(SWal *pWal, int64_t ver, int64_t offset) {
L
Liu Jicong 已提交
244
  SWalIdxEntry entry = {.ver = ver, .offset = offset};
245
  int          size = taosWriteFile(pWal->pWriteIdxTFile, &entry, sizeof(SWalIdxEntry));
L
Liu Jicong 已提交
246
  if (size != sizeof(SWalIdxEntry)) {
L
Liu Jicong 已提交
247
    terrno = TAOS_SYSTEM_ERROR(errno);
L
Liu Jicong 已提交
248
    // TODO truncate
L
Liu Jicong 已提交
249
    return -1;
L
Liu Jicong 已提交
250 251 252 253
  }
  return 0;
}

L
Liu Jicong 已提交
254
int64_t walWriteWithSyncInfo(SWal *pWal, int64_t index, tmsg_t msgType, SSyncLogMeta syncMeta, const void *body,
L
Liu Jicong 已提交
255
                             int32_t bodyLen) {
L
Liu Jicong 已提交
256
  int code = 0;
陶建辉(Jeff)'s avatar
陶建辉(Jeff) 已提交
257

S
TD-1652  
Shengliang Guan 已提交
258
  // no wal
L
Liu Jicong 已提交
259
  if (pWal->cfg.level == TAOS_WAL_NOLOG) return 0;
L
Liu Jicong 已提交
260
  if (bodyLen > TSDB_MAX_WAL_SIZE) {
L
Liu Jicong 已提交
261 262 263
    terrno = TSDB_CODE_WAL_SIZE_LIMIT;
    return -1;
  }
L
Liu Jicong 已提交
264

L
Liu Jicong 已提交
265
  if (index == pWal->vers.lastVer + 1) {
L
Liu Jicong 已提交
266
    if (taosArrayGetSize(pWal->fileInfoSet) == 0) {
L
Liu Jicong 已提交
267
      pWal->vers.firstVer = index;
L
Liu Jicong 已提交
268 269 270
      if (walRoll(pWal) < 0) {
        return -1;
      }
L
Liu Jicong 已提交
271
    } else {
L
Liu Jicong 已提交
272
      int64_t passed = walGetSeq() - pWal->lastRollSeq;
L
Liu Jicong 已提交
273
      if (pWal->cfg.rollPeriod != -1 && pWal->cfg.rollPeriod != 0 && passed > pWal->cfg.rollPeriod) {
L
Liu Jicong 已提交
274 275 276
        if (walRoll(pWal) < 0) {
          return -1;
        }
L
Liu Jicong 已提交
277
      } else if (pWal->cfg.segSize != -1 && pWal->cfg.segSize != 0 && walGetLastFileSize(pWal) > pWal->cfg.segSize) {
L
Liu Jicong 已提交
278 279 280
        if (walRoll(pWal) < 0) {
          return -1;
        }
L
Liu Jicong 已提交
281
      }
L
Liu Jicong 已提交
282 283
    }
  } else {
L
Liu Jicong 已提交
284 285
    // reject skip log or rewrite log
    // must truncate explicitly first
L
fix  
Liu Jicong 已提交
286
    terrno = TSDB_CODE_WAL_INVALID_VER;
L
Liu Jicong 已提交
287 288
    return -1;
  }
289
  /*if (!tfValid(pWal->pWriteLogTFile)) return -1;*/
陶建辉(Jeff)'s avatar
陶建辉(Jeff) 已提交
290

L
Liu Jicong 已提交
291 292
  ASSERT(pWal->writeCur >= 0);

wafwerar's avatar
wafwerar 已提交
293
  taosThreadMutexLock(&pWal->mutex);
L
Liu Jicong 已提交
294

295
  if (pWal->pWriteIdxTFile == NULL || pWal->pWriteLogTFile == NULL) {
L
Liu Jicong 已提交
296
    walSetWrite(pWal);
297 298
    taosLSeekFile(pWal->pWriteLogTFile, 0, SEEK_END);
    taosLSeekFile(pWal->pWriteIdxTFile, 0, SEEK_END);
L
Liu Jicong 已提交
299 300
  }

L
Liu Jicong 已提交
301
  pWal->writeHead.head.version = index;
L
Liu Jicong 已提交
302

L
Liu Jicong 已提交
303
  int64_t offset = walGetCurFileOffset(pWal);
L
Liu Jicong 已提交
304
  pWal->writeHead.head.bodyLen = bodyLen;
L
Liu Jicong 已提交
305
  pWal->writeHead.head.msgType = msgType;
L
Liu Jicong 已提交
306

307
  // sync info for sync module
L
Liu Jicong 已提交
308
  pWal->writeHead.head.syncMeta = syncMeta;
L
Liu Jicong 已提交
309

L
Liu Jicong 已提交
310 311
  pWal->writeHead.cksumHead = walCalcHeadCksum(&pWal->writeHead);
  pWal->writeHead.cksumBody = walCalcBodyCksum(body, bodyLen);
312

313
  if (taosWriteFile(pWal->pWriteLogTFile, &pWal->writeHead, sizeof(SWalHead)) != sizeof(SWalHead)) {
314
    // TODO ftruncate
L
fix  
Liu Jicong 已提交
315
    terrno = TAOS_SYSTEM_ERROR(errno);
L
Liu Jicong 已提交
316 317
    wError("vgId:%d, file:%" PRId64 ".log, failed to write since %s", pWal->cfg.vgId, walGetLastFileFirstVer(pWal),
           strerror(errno));
L
fix  
Liu Jicong 已提交
318
    return -1;
J
Jeff Tao 已提交
319
  }
S
TD-1846  
Shengliang Guan 已提交
320

321
  if (taosWriteFile(pWal->pWriteLogTFile, (char *)body, bodyLen) != bodyLen) {
322
    // TODO ftruncate
L
fix  
Liu Jicong 已提交
323
    terrno = TAOS_SYSTEM_ERROR(errno);
L
Liu Jicong 已提交
324 325
    wError("vgId:%d, file:%" PRId64 ".log, failed to write since %s", pWal->cfg.vgId, walGetLastFileFirstVer(pWal),
           strerror(errno));
L
fix  
Liu Jicong 已提交
326
    return -1;
L
Liu Jicong 已提交
327
  }
L
Liu Jicong 已提交
328

L
Liu Jicong 已提交
329
  code = walWriteIndex(pWal, index, offset);
L
Liu Jicong 已提交
330 331
  if (code != 0) {
    // TODO
L
Liu Jicong 已提交
332
    return -1;
L
Liu Jicong 已提交
333
  }
334

L
Liu Jicong 已提交
335
  // set status
L
Liu Jicong 已提交
336
  pWal->vers.lastVer = index;
L
Liu Jicong 已提交
337
  pWal->totSize += sizeof(SWalHead) + bodyLen;
L
Liu Jicong 已提交
338 339
  walGetCurFileInfo(pWal)->lastVer = index;
  walGetCurFileInfo(pWal)->fileSize += sizeof(SWalHead) + bodyLen;
L
Liu Jicong 已提交
340

wafwerar's avatar
wafwerar 已提交
341
  taosThreadMutexUnlock(&pWal->mutex);
陶建辉(Jeff)'s avatar
陶建辉(Jeff) 已提交
342

L
fix  
Liu Jicong 已提交
343
  return 0;
陶建辉(Jeff)'s avatar
陶建辉(Jeff) 已提交
344 345
}

L
Liu Jicong 已提交
346
int64_t walWrite(SWal *pWal, int64_t index, tmsg_t msgType, const void *body, int32_t bodyLen) {
L
Liu Jicong 已提交
347
  SSyncLogMeta syncMeta = {
L
Liu Jicong 已提交
348 349 350 351
      .isWeek = -1,
      .seqNum = UINT64_MAX,
      .term = UINT64_MAX,
  };
L
Liu Jicong 已提交
352
  return walWriteWithSyncInfo(pWal, index, msgType, syncMeta, body, bodyLen);
L
Liu Jicong 已提交
353 354
}

L
Liu Jicong 已提交
355
void walFsync(SWal *pWal, bool forceFsync) {
L
Liu Jicong 已提交
356
  if (forceFsync || (pWal->cfg.level == TAOS_WAL_FSYNC && pWal->cfg.fsyncPeriod == 0)) {
L
Liu Jicong 已提交
357
    wTrace("vgId:%d, fileId:%" PRId64 ".log, do fsync", pWal->cfg.vgId, walGetCurFileFirstVer(pWal));
358
    if (taosFsyncFile(pWal->pWriteLogTFile) < 0) {
L
Liu Jicong 已提交
359 360
      wError("vgId:%d, file:%" PRId64 ".log, fsync failed since %s", pWal->cfg.vgId, walGetCurFileFirstVer(pWal),
             strerror(errno));
361 362
    }
  }
陶建辉(Jeff)'s avatar
陶建辉(Jeff) 已提交
363 364
}

L
Liu Jicong 已提交
365
/*static int walValidateOffset(SWal* pWal, int64_t ver) {*/
L
Liu Jicong 已提交
366 367 368 369 370 371 372
/*int code = 0;*/
/*SWalHead *pHead = NULL;*/
/*code = (int)walRead(pWal, &pHead, ver);*/
/*if(pHead->head.version != ver) {*/
/*return -1;*/
/*}*/
/*return 0;*/
L
Liu Jicong 已提交
373
/*}*/
L
Liu Jicong 已提交
374

L
Liu Jicong 已提交
375
/*static int64_t walGetOffset(SWal* pWal, int64_t ver) {*/
L
Liu Jicong 已提交
376 377 378 379
/*int code = walSeekVer(pWal, ver);*/
/*if(code != 0) {*/
/*return -1;*/
/*}*/
L
Liu Jicong 已提交
380

L
Liu Jicong 已提交
381 382 383 384
/*code = walValidateOffset(pWal, ver);*/
/*if(code != 0) {*/
/*return -1;*/
/*}*/
L
Liu Jicong 已提交
385

L
Liu Jicong 已提交
386
/*return 0;*/
L
Liu Jicong 已提交
387
/*}*/