diff --git a/src/mnode/src/mgmtSdb.c b/src/mnode/src/mgmtSdb.c index 3717277992a36b0efdd478c850a9731e2668fd20..a55869222dca82bf81537bea3da11f9b32473194 100644 --- a/src/mnode/src/mgmtSdb.c +++ b/src/mnode/src/mgmtSdb.c @@ -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;