未验证 提交 bdfc2b7f 编写于 作者: S slguan 提交者: GitHub

Merge pull request #1805 from taosdata/feature/cluster

change wal path
......@@ -143,7 +143,9 @@ static void *sdbGetTableFromId(int32_t tableId) {
static int32_t sdbInitWal() {
SWalCfg walCfg = {.commitLog = 2, .wals = 2, .keep = 1};
tsSdbObj.wal = walOpen(tsMnodeDir, &walCfg);
char temp[TSDB_FILENAME_LEN];
sprintf(temp, "%s/wal", tsMnodeDir);
tsSdbObj.wal = walOpen(temp, &walCfg);
if (tsSdbObj.wal == NULL) {
sdbError("failed to open sdb wal in %s", tsMnodeDir);
return -1;
......@@ -196,8 +198,7 @@ static uint32_t sdbGetFileInfo(void *ahandle, char *name, uint32_t *index, int32
}
static int sdbGetWalInfo(void *ahandle, char *name, uint32_t *index) {
strcpy(name, "wal0");
return 0;
return walGetWalFile(tsSdbObj.wal, name, index);
}
static void sdbNotifyRole(void *ahandle, int8_t role) {
......@@ -281,7 +282,7 @@ void sdbUpdateSync() {
syncInfo.vgId = 1;
syncInfo.version = sdbGetVersion();
syncInfo.syncCfg = syncCfg;
sprintf(syncInfo.path, "%s/", tsMnodeDir);
sprintf(syncInfo.path, "%s", tsMnodeDir);
syncInfo.ahandle = NULL;
syncInfo.getWalInfo = sdbGetWalInfo;
syncInfo.getFileInfo = sdbGetFileInfo;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册