未验证 提交 916a9f68 编写于 作者: S Shengliang Guan 提交者: GitHub

Merge pull request #4490 from taosdata/feature/wal

Feature/wal
...@@ -45,6 +45,10 @@ void printHelp() { ...@@ -45,6 +45,10 @@ void printHelp() {
printf("%s%s%s\n", indent, indent, "Database to use when connecting to the server."); printf("%s%s%s\n", indent, indent, "Database to use when connecting to the server.");
printf("%s%s\n", indent, "-t"); printf("%s%s\n", indent, "-t");
printf("%s%s%s\n", indent, indent, "Time zone of the shell, default is local."); printf("%s%s%s\n", indent, indent, "Time zone of the shell, default is local.");
printf("%s%s\n", indent, "-n");
printf("%s%s%s\n", indent, indent, "Net role when network connectivity test, default is startup, options: client|server|rpc|startup.");
printf("%s%s\n", indent, "-l");
printf("%s%s%s\n", indent, indent, "Packet length used for net test, default is 1000 bytes.");
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
} }
...@@ -137,6 +141,24 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) { ...@@ -137,6 +141,24 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
} }
// For time zone
else if (strcmp(argv[i], "-n") == 0) {
if (i < argc - 1) {
arguments->netTestRole = argv[++i];
} else {
fprintf(stderr, "option -n requires an argument\n");
exit(EXIT_FAILURE);
}
}
// For time zone
else if (strcmp(argv[i], "-l") == 0) {
if (i < argc - 1) {
arguments->pktLen = atoi(argv[++i]);
} else {
fprintf(stderr, "option -l requires an argument\n");
exit(EXIT_FAILURE);
}
}
// For temperory command TODO // For temperory command TODO
else if (strcmp(argv[i], "--help") == 0) { else if (strcmp(argv[i], "--help") == 0) {
printHelp(); printHelp();
......
...@@ -43,12 +43,13 @@ static void *taosNetBindUdpPort(void *sarg) { ...@@ -43,12 +43,13 @@ static void *taosNetBindUdpPort(void *sarg) {
char buffer[BUFFER_SIZE]; char buffer[BUFFER_SIZE];
int32_t iDataNum; int32_t iDataNum;
socklen_t sin_size; socklen_t sin_size;
int32_t bufSize = 1024000;
struct sockaddr_in server_addr; struct sockaddr_in server_addr;
struct sockaddr_in clientAddr; struct sockaddr_in clientAddr;
if ((serverSocket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) { if ((serverSocket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) {
uError("failed to create udp socket since %s", strerror(errno)); uError("failed to create UDP socket since %s", strerror(errno));
return NULL; return NULL;
} }
...@@ -58,11 +59,23 @@ static void *taosNetBindUdpPort(void *sarg) { ...@@ -58,11 +59,23 @@ static void *taosNetBindUdpPort(void *sarg) {
server_addr.sin_addr.s_addr = htonl(INADDR_ANY); server_addr.sin_addr.s_addr = htonl(INADDR_ANY);
if (bind(serverSocket, (struct sockaddr *)&server_addr, sizeof(server_addr)) < 0) { if (bind(serverSocket, (struct sockaddr *)&server_addr, sizeof(server_addr)) < 0) {
uError("failed to bind udp port:%d since %s", port, strerror(errno)); uError("failed to bind UDP port:%d since %s", port, strerror(errno));
return NULL; return NULL;
} }
uInfo("udp server at port:%d is listening", port); if (taosSetSockOpt(serverSocket, SOL_SOCKET, SO_SNDBUF, (void *)&bufSize, sizeof(bufSize)) != 0) {
uError("failed to set the send buffer size for UDP socket\n");
taosCloseSocket(serverSocket);
return NULL;
}
if (taosSetSockOpt(serverSocket, SOL_SOCKET, SO_RCVBUF, (void *)&bufSize, sizeof(bufSize)) != 0) {
uError("failed to set the receive buffer size for UDP socket\n");
taosCloseSocket(serverSocket);
return NULL;
}
uInfo("UDP server at port:%d is listening", port);
while (1) { while (1) {
memset(buffer, 0, BUFFER_SIZE); memset(buffer, 0, BUFFER_SIZE);
...@@ -74,10 +87,13 @@ static void *taosNetBindUdpPort(void *sarg) { ...@@ -74,10 +87,13 @@ static void *taosNetBindUdpPort(void *sarg) {
continue; continue;
} }
uInfo("UDP: recv:%d bytes from %s at %d", iDataNum, taosInetNtoa(clientAddr.sin_addr), port);
if (iDataNum > 0) { if (iDataNum > 0) {
uInfo("UDP: recv:%d bytes from %s:%d", iDataNum, taosInetNtoa(clientAddr.sin_addr), port); iDataNum = taosSendto(serverSocket, buffer, iDataNum, 0, (struct sockaddr *)&clientAddr, (int32_t)sin_size);
sendto(serverSocket, buffer, iDataNum, 0, (struct sockaddr *)&clientAddr, (int32_t)sin_size);
} }
uInfo("UDP: send:%d bytes to %s at %d", iDataNum, taosInetNtoa(clientAddr.sin_addr), port);
} }
taosCloseSocket(serverSocket); taosCloseSocket(serverSocket);
...@@ -94,10 +110,9 @@ static void *taosNetBindTcpPort(void *sarg) { ...@@ -94,10 +110,9 @@ static void *taosNetBindTcpPort(void *sarg) {
int32_t addr_len = sizeof(clientAddr); int32_t addr_len = sizeof(clientAddr);
SOCKET client; SOCKET client;
char buffer[BUFFER_SIZE]; char buffer[BUFFER_SIZE];
int32_t iDataNum = 0;
if ((serverSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) { if ((serverSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) {
uError("failed to create tcp socket since %s", strerror(errno)); uError("failed to create TCP socket since %s", strerror(errno));
return NULL; return NULL;
} }
...@@ -106,55 +121,56 @@ static void *taosNetBindTcpPort(void *sarg) { ...@@ -106,55 +121,56 @@ static void *taosNetBindTcpPort(void *sarg) {
server_addr.sin_port = htons(port); server_addr.sin_port = htons(port);
server_addr.sin_addr.s_addr = htonl(INADDR_ANY); server_addr.sin_addr.s_addr = htonl(INADDR_ANY);
int32_t reuse = 1;
if (taosSetSockOpt(serverSocket, SOL_SOCKET, SO_REUSEADDR, (void *)&reuse, sizeof(reuse)) < 0) {
uError("setsockopt SO_REUSEADDR failed: %d (%s)", errno, strerror(errno));
taosCloseSocket(serverSocket);
return NULL;
}
if (bind(serverSocket, (struct sockaddr *)&server_addr, sizeof(server_addr)) < 0) { if (bind(serverSocket, (struct sockaddr *)&server_addr, sizeof(server_addr)) < 0) {
uError("failed to bind tcp port:%d since %s", port, strerror(errno)); uError("failed to bind TCP port:%d since %s", port, strerror(errno));
return NULL; return NULL;
} }
if (listen(serverSocket, 5) < 0) {
uError("failed to listen tcp port:%d since %s", port, strerror(errno)); if (taosKeepTcpAlive(serverSocket) < 0) {
uError("failed to set tcp server keep-alive option since %s", strerror(errno));
taosCloseSocket(serverSocket);
return NULL;
}
if (listen(serverSocket, 10) < 0) {
uError("failed to listen TCP port:%d since %s", port, strerror(errno));
return NULL; return NULL;
} }
uInfo("tcp server at port:%d is listening", port); uInfo("TCP server at port:%d is listening", port);
while (1) { while (1) {
client = accept(serverSocket, (struct sockaddr *)&clientAddr, (socklen_t *)&addr_len); client = accept(serverSocket, (struct sockaddr *)&clientAddr, (socklen_t *)&addr_len);
if (client < 0) { if (client < 0) {
uDebug("failed to accept from tcp port:%d since %s", port, strerror(errno)); uDebug("TCP: failed to accept at port:%d since %s", port, strerror(errno));
continue; continue;
} }
iDataNum = 0; int32_t ret = taosReadMsg(client, buffer, pinfo->pktLen);
memset(buffer, 0, BUFFER_SIZE); if (ret < 0 || ret != pinfo->pktLen) {
int32_t nleft, nread; uError("TCP: failed to read %d bytes at port:%d since %s", pinfo->pktLen, port, strerror(errno));
char * ptr = buffer; taosCloseSocket(serverSocket);
nleft = pinfo->pktLen; return NULL;
}
while (nleft > 0) { uInfo("TCP: read:%d bytes from %s at %d", pinfo->pktLen, taosInetNtoa(clientAddr.sin_addr), port);
nread = recv(client, ptr, BUFFER_SIZE, 0);
if (nread == 0) { ret = taosWriteMsg(client, buffer, pinfo->pktLen);
break; if (ret < 0) {
} else if (nread < 0) { uError("TCP: failed to write %d bytes at %d since %s", pinfo->pktLen, port, strerror(errno));
if (errno == EINTR) {
continue;
} else {
uError("failed to perform recv func at %d since %s", port, strerror(errno));
taosCloseSocket(serverSocket); taosCloseSocket(serverSocket);
return NULL; return NULL;
} }
} else {
nleft -= nread;
ptr += nread;
iDataNum += nread;
}
}
if (iDataNum > 0) { uInfo("TCP: write:%d bytes to %s at %d", pinfo->pktLen, taosInetNtoa(clientAddr.sin_addr), port);
uInfo("TCP: recv:%d bytes from %s:%d", iDataNum, taosInetNtoa(clientAddr.sin_addr), port);
send(client, buffer, iDataNum, 0);
}
} }
taosCloseSocket(serverSocket); taosCloseSocket(serverSocket);
...@@ -163,73 +179,45 @@ static void *taosNetBindTcpPort(void *sarg) { ...@@ -163,73 +179,45 @@ static void *taosNetBindTcpPort(void *sarg) {
static int32_t taosNetCheckTcpPort(STestInfo *info) { static int32_t taosNetCheckTcpPort(STestInfo *info) {
SOCKET clientSocket; SOCKET clientSocket;
char sendbuf[BUFFER_SIZE]; char buffer[BUFFER_SIZE] = {0};
char recvbuf[BUFFER_SIZE];
int32_t iDataNum = 0;
struct sockaddr_in serverAddr;
if ((clientSocket = socket(AF_INET, SOCK_STREAM, 0)) < 0) { if ((clientSocket = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
uError("failed to create tcp client socket since %s", strerror(errno)); uError("failed to create TCP client socket since %s", strerror(errno));
return -1; return -1;
} }
// set send and recv overtime int32_t reuse = 1;
struct timeval timeout; if (taosSetSockOpt(clientSocket, SOL_SOCKET, SO_REUSEADDR, (void *)&reuse, sizeof(reuse)) < 0) {
timeout.tv_sec = 2; // s uError("setsockopt SO_REUSEADDR failed: %d (%s)", errno, strerror(errno));
timeout.tv_usec = 0; // us taosCloseSocket(clientSocket);
if (setsockopt(clientSocket, SOL_SOCKET, SO_SNDTIMEO, (char *)&timeout, sizeof(struct timeval)) == -1) { return -1;
uError("failed to setsockopt send timer since %s", strerror(errno));
}
if (setsockopt(clientSocket, SOL_SOCKET, SO_RCVTIMEO, (char *)&timeout, sizeof(struct timeval)) == -1) {
uError("failed to setsockopt recv timer since %s", strerror(errno));
} }
struct sockaddr_in serverAddr;
memset((char *)&serverAddr, 0, sizeof(serverAddr));
serverAddr.sin_family = AF_INET; serverAddr.sin_family = AF_INET;
serverAddr.sin_port = htons(info->port); serverAddr.sin_port = (uint16_t)htons((uint16_t)info->port);
serverAddr.sin_addr.s_addr = info->hostIp; serverAddr.sin_addr.s_addr = info->hostIp;
if (connect(clientSocket, (struct sockaddr *)&serverAddr, sizeof(serverAddr)) < 0) { if (connect(clientSocket, (struct sockaddr *)&serverAddr, sizeof(serverAddr)) < 0) {
uError("failed to connect port:%d since %s", info->port, strerror(errno)); uError("TCP: failed to connect port %s:%d since %s", taosIpStr(info->hostIp), info->port, strerror(errno));
return -1; return -1;
} }
memset(sendbuf, 0, BUFFER_SIZE); taosKeepTcpAlive(clientSocket);
memset(recvbuf, 0, BUFFER_SIZE);
struct in_addr ipStr;
memcpy(&ipStr, &info->hostIp, 4);
sprintf(sendbuf, "client send tcp pkg to %s:%d, content: 1122334455", taosInetNtoa(ipStr), info->port);
sprintf(sendbuf + info->pktLen - 16, "1122334455667788");
send(clientSocket, sendbuf, info->pktLen, 0); sprintf(buffer, "client send TCP pkg to %s:%d, content: 1122334455", taosIpStr(info->hostIp), info->port);
sprintf(buffer + info->pktLen - 16, "1122334455667788");
memset(recvbuf, 0, BUFFER_SIZE); int32_t ret = taosWriteMsg(clientSocket, buffer, info->pktLen);
int32_t nleft, nread; if (ret < 0) {
char * ptr = recvbuf; uError("TCP: failed to write msg to %s:%d since %s", taosIpStr(info->hostIp), info->port, strerror(errno));
nleft = info->pktLen;
while (nleft > 0) {
nread = recv(clientSocket, ptr, BUFFER_SIZE, 0);;
if (nread == 0) {
break;
} else if (nread < 0) {
if (errno == EINTR) {
continue;
} else {
uError("faild to recv pkg from TCP port:%d since %s", info->port, strerror(errno));
taosCloseSocket(clientSocket);
return -1; return -1;
} }
} else {
nleft -= nread;
ptr += nread;
iDataNum += nread;
}
}
if (iDataNum < info->pktLen) { ret = taosReadMsg(clientSocket, buffer, info->pktLen);
uError("TCP: received ack:%d bytes, less than send:%d bytes from port:%d", iDataNum, info->pktLen, info->port); if (ret < 0) {
uError("TCP: failed to read msg from %s:%d since %s", taosIpStr(info->hostIp), info->port, strerror(errno));
return -1; return -1;
} }
...@@ -239,9 +227,9 @@ static int32_t taosNetCheckTcpPort(STestInfo *info) { ...@@ -239,9 +227,9 @@ static int32_t taosNetCheckTcpPort(STestInfo *info) {
static int32_t taosNetCheckUdpPort(STestInfo *info) { static int32_t taosNetCheckUdpPort(STestInfo *info) {
SOCKET clientSocket; SOCKET clientSocket;
char sendbuf[BUFFER_SIZE]; char buffer[BUFFER_SIZE] = {0};
char recvbuf[BUFFER_SIZE];
int32_t iDataNum = 0; int32_t iDataNum = 0;
int32_t bufSize = 1024000;
struct sockaddr_in serverAddr; struct sockaddr_in serverAddr;
...@@ -250,41 +238,39 @@ static int32_t taosNetCheckUdpPort(STestInfo *info) { ...@@ -250,41 +238,39 @@ static int32_t taosNetCheckUdpPort(STestInfo *info) {
return -1; return -1;
} }
// set overtime if (taosSetSockOpt(clientSocket, SOL_SOCKET, SO_SNDBUF, (void *)&bufSize, sizeof(bufSize)) != 0) {
struct timeval timeout; uError("failed to set the send buffer size for UDP socket\n");
timeout.tv_sec = 2; // s return -1;
timeout.tv_usec = 0; // us
if (setsockopt(clientSocket, SOL_SOCKET, SO_SNDTIMEO, (char *)&timeout, sizeof(struct timeval)) == -1) {
uError("failed to setsockopt send timer since %s", strerror(errno));
} }
if (setsockopt(clientSocket, SOL_SOCKET, SO_RCVTIMEO, (char *)&timeout, sizeof(struct timeval)) == -1) {
uError("failed to setsockopt recv timer since %s", strerror(errno)); if (taosSetSockOpt(clientSocket, SOL_SOCKET, SO_RCVBUF, (void *)&bufSize, sizeof(bufSize)) != 0) {
uError("failed to set the receive buffer size for UDP socket\n");
return -1;
} }
serverAddr.sin_family = AF_INET; serverAddr.sin_family = AF_INET;
serverAddr.sin_port = htons(info->port); serverAddr.sin_port = htons(info->port);
serverAddr.sin_addr.s_addr = info->hostIp; serverAddr.sin_addr.s_addr = info->hostIp;
memset(sendbuf, 0, BUFFER_SIZE);
memset(recvbuf, 0, BUFFER_SIZE);
struct in_addr ipStr; struct in_addr ipStr;
memcpy(&ipStr, &info->hostIp, 4); memcpy(&ipStr, &info->hostIp, 4);
sprintf(sendbuf, "client send udp pkg to %s:%d, content: 1122334455", taosInetNtoa(ipStr), info->port); sprintf(buffer, "client send udp pkg to %s:%d, content: 1122334455", taosInetNtoa(ipStr), info->port);
sprintf(sendbuf + info->pktLen - 16, "1122334455667788"); sprintf(buffer + info->pktLen - 16, "1122334455667788");
socklen_t sin_size = sizeof(*(struct sockaddr *)&serverAddr); socklen_t sin_size = sizeof(*(struct sockaddr *)&serverAddr);
int32_t code = sendto(clientSocket, sendbuf, info->pktLen, 0, (struct sockaddr *)&serverAddr, (int32_t)sin_size); iDataNum = taosSendto(clientSocket, buffer, info->pktLen, 0, (struct sockaddr *)&serverAddr, (int32_t)sin_size);
if (code < 0) { if (iDataNum < 0 || iDataNum != info->pktLen) {
uError("failed to perform sendto func since %s", strerror(errno)); uError("UDP: failed to perform sendto func since %s", strerror(errno));
return -1; return -1;
} }
iDataNum = recvfrom(clientSocket, recvbuf, BUFFER_SIZE, 0, (struct sockaddr *)&serverAddr, &sin_size); memset(buffer, 0, BUFFER_SIZE);
sin_size = sizeof(*(struct sockaddr *)&serverAddr);
iDataNum = recvfrom(clientSocket, buffer, BUFFER_SIZE, 0, (struct sockaddr *)&serverAddr, &sin_size);
if (iDataNum < info->pktLen) { if (iDataNum < 0 || iDataNum != info->pktLen) {
uError("UDP: received ack:%d bytes, less than send:%d bytes from port:%d", iDataNum, info->pktLen, info->port); uError("UDP: received ack:%d bytes(expect:%d) from port:%d since %s", iDataNum, info->pktLen, info->port, strerror(errno));
return -1; return -1;
} }
...@@ -304,19 +290,18 @@ static void taosNetCheckPort(uint32_t hostIp, int32_t startPort, int32_t endPort ...@@ -304,19 +290,18 @@ static void taosNetCheckPort(uint32_t hostIp, int32_t startPort, int32_t endPort
info.port = port; info.port = port;
ret = taosNetCheckTcpPort(&info); ret = taosNetCheckTcpPort(&info);
if (ret != 0) { if (ret != 0) {
uError("failed to test tcp port:%d", port); uError("failed to test TCP port:%d", port);
} else { } else {
uInfo("successed to test tcp port:%d", port); uInfo("successed to test TCP port:%d", port);
} }
ret = taosNetCheckUdpPort(&info); ret = taosNetCheckUdpPort(&info);
if (ret != 0) { if (ret != 0) {
uError("failed to test udp port:%d", port); uError("failed to test UDP port:%d", port);
} else { } else {
uInfo("successed to test udp port:%d", port); uInfo("successed to test UDP port:%d", port);
} }
} }
return;
} }
void *taosNetInitRpc(char *secretEncrypt, char spi) { void *taosNetInitRpc(char *secretEncrypt, char spi) {
...@@ -440,9 +425,9 @@ static void taosNetTestRpc(char *host, int32_t startPort, int32_t pkgLen) { ...@@ -440,9 +425,9 @@ static void taosNetTestRpc(char *host, int32_t startPort, int32_t pkgLen) {
int32_t ret = taosNetCheckRpc(host, port, sendpkgLen, spi, NULL); int32_t ret = taosNetCheckRpc(host, port, sendpkgLen, spi, NULL);
if (ret < 0) { if (ret < 0) {
uError("failed to test tcp port:%d", port); uError("failed to test TCP port:%d", port);
} else { } else {
uInfo("successed to test tcp port:%d", port); uInfo("successed to test TCP port:%d", port);
} }
if (pkgLen >= tsRpcMaxUdpSize) { if (pkgLen >= tsRpcMaxUdpSize) {
...@@ -453,9 +438,9 @@ static void taosNetTestRpc(char *host, int32_t startPort, int32_t pkgLen) { ...@@ -453,9 +438,9 @@ static void taosNetTestRpc(char *host, int32_t startPort, int32_t pkgLen) {
ret = taosNetCheckRpc(host, port, pkgLen, spi, NULL); ret = taosNetCheckRpc(host, port, pkgLen, spi, NULL);
if (ret < 0) { if (ret < 0) {
uError("failed to test udp port:%d", port); uError("failed to test UDP port:%d", port);
} else { } else {
uInfo("successed to test udp port:%d", port); uInfo("successed to test UDP port:%d", port);
} }
} }
} }
...@@ -492,14 +477,15 @@ static void taosNetTestServer(char *host, int32_t startPort, int32_t pkgLen) { ...@@ -492,14 +477,15 @@ static void taosNetTestServer(char *host, int32_t startPort, int32_t pkgLen) {
tcpInfo->pktLen = pkgLen; tcpInfo->pktLen = pkgLen;
if (pthread_create(pids + i, NULL, taosNetBindTcpPort, tcpInfo) != 0) { if (pthread_create(pids + i, NULL, taosNetBindTcpPort, tcpInfo) != 0) {
uInfo("failed to create tcp test thread, %s:%d", tcpInfo->hostFqdn, tcpInfo->port); uInfo("failed to create TCP test thread, %s:%d", tcpInfo->hostFqdn, tcpInfo->port);
exit(-1); exit(-1);
} }
STestInfo *udpInfo = uinfos + i; STestInfo *udpInfo = uinfos + i;
udpInfo->port = (uint16_t)(port + i); udpInfo->port = port + i;
tcpInfo->pktLen = pkgLen;
if (pthread_create(pids + num + i, NULL, taosNetBindUdpPort, udpInfo) != 0) { if (pthread_create(pids + num + i, NULL, taosNetBindUdpPort, udpInfo) != 0) {
uInfo("failed to create udp test thread, %s:%d", tcpInfo->hostFqdn, tcpInfo->port); uInfo("failed to create UDP test thread, %s:%d", tcpInfo->hostFqdn, tcpInfo->port);
exit(-1); exit(-1);
} }
} }
......
...@@ -228,7 +228,7 @@ static int32_t taosOpenNoteWithMaxLines(char *fn, int32_t maxLines, int32_t maxN ...@@ -228,7 +228,7 @@ static int32_t taosOpenNoteWithMaxLines(char *fn, int32_t maxLines, int32_t maxN
} }
void taosNotePrintBuffer(SNoteObj *pNote, char *buffer, int32_t len) { void taosNotePrintBuffer(SNoteObj *pNote, char *buffer, int32_t len) {
if (pNote->fd < 0) return; if (pNote->fd <= 0) return;
taosWrite(pNote->fd, buffer, len); taosWrite(pNote->fd, buffer, len);
if (pNote->maxLines > 0) { if (pNote->maxLines > 0) {
......
...@@ -441,7 +441,6 @@ static int32_t vnodeProcessTsdbStatus(void *arg, int32_t status, int32_t eno) { ...@@ -441,7 +441,6 @@ static int32_t vnodeProcessTsdbStatus(void *arg, int32_t status, int32_t eno) {
if (status == TSDB_STATUS_COMMIT_START) { if (status == TSDB_STATUS_COMMIT_START) {
pVnode->isCommiting = 1; pVnode->isCommiting = 1;
pVnode->fversion = pVnode->version;
vDebug("vgId:%d, start commit, fver:%" PRIu64 " vver:%" PRIu64, pVnode->vgId, pVnode->fversion, pVnode->version); vDebug("vgId:%d, start commit, fver:%" PRIu64 " vver:%" PRIu64, pVnode->vgId, pVnode->fversion, pVnode->version);
if (!vnodeInInitStatus(pVnode)) { if (!vnodeInInitStatus(pVnode)) {
return walRenew(pVnode->wal); return walRenew(pVnode->wal);
...@@ -450,9 +449,10 @@ static int32_t vnodeProcessTsdbStatus(void *arg, int32_t status, int32_t eno) { ...@@ -450,9 +449,10 @@ static int32_t vnodeProcessTsdbStatus(void *arg, int32_t status, int32_t eno) {
} }
if (status == TSDB_STATUS_COMMIT_OVER) { if (status == TSDB_STATUS_COMMIT_OVER) {
vDebug("vgId:%d, commit over, fver:%" PRIu64 " vver:%" PRIu64, pVnode->vgId, pVnode->fversion, pVnode->version);
pVnode->isCommiting = 0; pVnode->isCommiting = 0;
pVnode->isFull = 0; pVnode->isFull = 0;
pVnode->fversion = pVnode->version;
vDebug("vgId:%d, commit over, fver:%" PRIu64 " vver:%" PRIu64, pVnode->vgId, pVnode->fversion, pVnode->version);
if (!vnodeInInitStatus(pVnode)) { if (!vnodeInInitStatus(pVnode)) {
walRemoveOneOldFile(pVnode->wal); walRemoveOneOldFile(pVnode->wal);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册