Merge pull request #6651 from junli1026/jun/waltest

Add init/cleaup to waltest to make it work
This commit is contained in:
Shengliang Guan 2021-07-01 15:09:05 +08:00 committed by GitHub
commit 134375863e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 4 deletions

View File

@ -19,6 +19,7 @@
#include "tglobal.h" #include "tglobal.h"
#include "tlog.h" #include "tlog.h"
#include "twal.h" #include "twal.h"
#include "tfile.h"
int64_t ver = 0; int64_t ver = 0;
void *pWal = NULL; void *pWal = NULL;
@ -36,7 +37,7 @@ int writeToQueue(void *pVnode, void *data, int type, void *pMsg) {
} }
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
char path[128] = "/home/jhtao/test/wal"; char path[128] = "/tmp/wal";
int level = 2; int level = 2;
int total = 5; int total = 5;
int rows = 10000; int rows = 10000;
@ -75,6 +76,8 @@ int main(int argc, char *argv[]) {
} }
taosInitLog("wal.log", 100000, 10); taosInitLog("wal.log", 100000, 10);
tfInit();
walInit();
SWalCfg walCfg = {0}; SWalCfg walCfg = {0};
walCfg.walLevel = level; walCfg.walLevel = level;
@ -122,13 +125,13 @@ int main(int argc, char *argv[]) {
printf("index:%" PRId64 " wal:%s\n", index, name); printf("index:%" PRId64 " wal:%s\n", index, name);
if (code == 0) break; if (code == 0) break;
index++;
} }
getchar(); getchar();
walClose(pWal); walClose(pWal);
walCleanUp();
tfCleanup();
return 0; return 0;
} }