diff --git a/src/inc/tnote.h b/src/inc/tnote.h index 1b53be22a29aa0cdc93bf7f7502208dbfc6cb88b..4f86736be4b1075d3a6a897ce1d996b136c11b70 100644 --- a/src/inc/tnote.h +++ b/src/inc/tnote.h @@ -20,7 +20,6 @@ extern "C" { #endif -#include "unistd.h" #include "os.h" #include "tutil.h" #include "tglobalcfg.h" diff --git a/src/kit/shell/src/shellEngine.c b/src/kit/shell/src/shellEngine.c index e2897da698b3891ddcf06e8ba17813008bef10d8..2eb98935566a74f712c3dc3db3880ecf84d066fd 100644 --- a/src/kit/shell/src/shellEngine.c +++ b/src/kit/shell/src/shellEngine.c @@ -21,6 +21,7 @@ #include "shellCommand.h" #include "ttime.h" #include "tutil.h" +#include /**************** Global variables ****************/ #ifdef WINDOWS diff --git a/src/os/windows/inc/os.h b/src/os/windows/inc/os.h index a1a4bdfa5c47e97010c05451a97ea363de928d60..9c0add2c319829e10d192de8a94dc43038c3155d 100644 --- a/src/os/windows/inc/os.h +++ b/src/os/windows/inc/os.h @@ -16,20 +16,30 @@ #ifndef TDENGINE_PLATFORM_WINDOWS_H #define TDENGINE_PLATFORM_WINDOWS_H +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include #include +#include +#include #include -#include -#include -#include -#include +#include +#include +#include #include "winsock2.h" #include -#include -#include -#include -#include -#include #ifdef __cplusplus extern "C" { @@ -366,6 +376,8 @@ int fsendfile(FILE* out_file, FILE* in_file, int64_t* offset, int32_t count); char *strndup(const char *s, size_t n); +void taosSetCoreDump(); + #ifdef __cplusplus } #endif diff --git a/src/os/windows/src/twindows.c b/src/os/windows/src/twindows.c index 9089f90d6ad8b0ae2c3bfeee9f1043c29926f144..98be6b60ba16e52b2177971d95930f7f717785aa 100644 --- a/src/os/windows/src/twindows.c +++ b/src/os/windows/src/twindows.c @@ -394,4 +394,6 @@ char *strndup(const char *s, size_t n) { memcpy(r, s, len); r[len] = 0; return r; -} \ No newline at end of file +} + +void taosSetCoreDump() {} \ No newline at end of file diff --git a/src/sdb/src/sdbEngine.c b/src/sdb/src/sdbEngine.c index e0a61f91c56d2b4138325190f9ffe3515729a49f..1cc487c285c7bdd3168c7558f143b651469885b6 100644 --- a/src/sdb/src/sdbEngine.c +++ b/src/sdb/src/sdbEngine.c @@ -346,10 +346,16 @@ int64_t sdbInsertRow(void *handle, void *row, int rowSize) { int real_size = 0; /* char action = SDB_TYPE_INSERT; */ - if (pTable == NULL) return -1; + if (pTable == NULL) { + sdbError("sdb tables is null"); + return -1; + } if ((pTable->keyType != SDB_KEYTYPE_AUTO) || *((int64_t *)row)) - if (sdbGetRow(handle, row)) return -1; + if (sdbGetRow(handle, row)) { + sdbError("table:%s, failed to insert record, sdbVersion:%d", pTable->name, sdbVersion); + return -1; + } total_size = sizeof(SRowHead) + pTable->maxRowSize + sizeof(TSCKSUM); SRowHead *rowHead = (SRowHead *)malloc(total_size); @@ -408,24 +414,26 @@ int64_t sdbInsertRow(void *handle, void *row, int rowSize) { pTable->numOfRows++; switch (pTable->keyType) { case SDB_KEYTYPE_STRING: - sdbTrace( - "table:%s, a record is inserted:%s, sdbVersion:%ld id:%ld rowSize:%d numOfRows:%d fileSize:%ld", - pTable->name, (char *)row, sdbVersion, rowHead->id, rowHead->rowSize, pTable->numOfRows, pTable->size); + sdbTrace("table:%s, a record is inserted:%s, sdbVersion:%ld id:%ld rowSize:%d numOfRows:%d fileSize:%ld", + pTable->name, (char *)row, sdbVersion, rowHead->id, rowHead->rowSize, pTable->numOfRows, pTable->size); + break; + case SDB_KEYTYPE_UINT32: //dnodes or mnodes + sdbTrace("table:%s, a record is inserted:%s, sdbVersion:%ld id:%ld rowSize:%d numOfRows:%d fileSize:%ld", + pTable->name, taosIpStr(*(int32_t *)row), sdbVersion, rowHead->id, rowHead->rowSize, pTable->numOfRows, pTable->size); break; - case SDB_KEYTYPE_UINT32: case SDB_KEYTYPE_AUTO: - sdbTrace( - "table:%s, a record is inserted:%d, sdbVersion:%ld id:%ld rowSize:%d numOfRows:%d fileSize:%ld", - pTable->name, *(int32_t *)row, sdbVersion, rowHead->id, rowHead->rowSize, pTable->numOfRows, pTable->size); + sdbTrace("table:%s, a record is inserted:%d, sdbVersion:%ld id:%ld rowSize:%d numOfRows:%d fileSize:%ld", + pTable->name, *(int32_t *)row, sdbVersion, rowHead->id, rowHead->rowSize, pTable->numOfRows, pTable->size); break; default: - sdbTrace( - "table:%s, a record is inserted, sdbVersion:%ld id:%ld rowSize:%d numOfRows:%d fileSize:%ld", - pTable->name, sdbVersion, rowHead->id, rowHead->rowSize, pTable->numOfRows, pTable->size); + sdbTrace("table:%s, a record is inserted, sdbVersion:%ld id:%ld rowSize:%d numOfRows:%d fileSize:%ld", + pTable->name, sdbVersion, rowHead->id, rowHead->rowSize, pTable->numOfRows, pTable->size); break; } id = rowMeta.id; + } else { + sdbError("table:%s, failed to insert record", pTable->name); } tfree(rowHead); @@ -509,15 +517,16 @@ int sdbDeleteRow(void *handle, void *row) { sdbAddIntoUpdateList(pTable, SDB_TYPE_DELETE, pMetaRow); switch (pTable->keyType) { case SDB_KEYTYPE_STRING: - sdbTrace( - "table:%s, a record is deleted:%s, sdbVersion:%ld id:%ld numOfRows:%d", - pTable->name, (char *)row, sdbVersion, pTable->id, pTable->numOfRows); + sdbTrace("table:%s, a record is deleted:%s, sdbVersion:%ld id:%ld numOfRows:%d", + pTable->name, (char *)row, sdbVersion, pTable->id, pTable->numOfRows); + break; + case SDB_KEYTYPE_UINT32: //dnodes or mnodes + sdbTrace("table:%s, a record is deleted:%s, sdbVersion:%ld id:%ld numOfRows:%d", + pTable->name, taosIpStr(*(int32_t *)row), sdbVersion, pTable->id, pTable->numOfRows); break; - case SDB_KEYTYPE_UINT32: case SDB_KEYTYPE_AUTO: - sdbTrace( - "table:%s, a record is deleted:%d, sdbVersion:%ld id:%ld numOfRows:%d", - pTable->name, *(int32_t *)row, sdbVersion, pTable->id, pTable->numOfRows); + sdbTrace("table:%s, a record is deleted:%d, sdbVersion:%ld id:%ld numOfRows:%d", + pTable->name, *(int32_t *)row, sdbVersion, pTable->id, pTable->numOfRows); break; default: sdbTrace("table:%s, a record is deleted, sdbVersion:%ld id:%ld numOfRows:%d", @@ -610,15 +619,16 @@ int sdbUpdateRow(void *handle, void *row, int updateSize, char isUpdated) { switch (pTable->keyType) { case SDB_KEYTYPE_STRING: - sdbTrace( - "table:%s, a record is updated:%s, sdbVersion:%ld id:%ld numOfRows:%d", - pTable->name, (char *)row, sdbVersion, pTable->id, pTable->numOfRows); + sdbTrace("table:%s, a record is updated:%s, sdbVersion:%ld id:%ld numOfRows:%d", + pTable->name, (char *)row, sdbVersion, pTable->id, pTable->numOfRows); + break; + case SDB_KEYTYPE_UINT32: //dnodes or mnodes + sdbTrace("table:%s, a record is updated:%d, sdbVersion:%ld id:%ld numOfRows:%d", + pTable->name, taosIpStr(*(int32_t *)row), sdbVersion, pTable->id, pTable->numOfRows); break; - case SDB_KEYTYPE_UINT32: case SDB_KEYTYPE_AUTO: - sdbTrace( - "table:%s, a record is updated:%d, sdbVersion:%ld id:%ld numOfRows:%d", - pTable->name, *(int32_t *)row, sdbVersion, pTable->id, pTable->numOfRows); + sdbTrace("table:%s, a record is updated:%d, sdbVersion:%ld id:%ld numOfRows:%d", + pTable->name, *(int32_t *)row, sdbVersion, pTable->id, pTable->numOfRows); break; default: sdbTrace("table:%s, a record is updated, sdbVersion:%ld id:%ld numOfRows:%d", pTable->name, sdbVersion, diff --git a/src/system/detail/src/vnodeFile.c b/src/system/detail/src/vnodeFile.c index ae92ce44a305303ce548b473256d16c00305f9d0..ecdb70de74cf0aa46eaebb528a3e24a76a81ff4a 100644 --- a/src/system/detail/src/vnodeFile.c +++ b/src/system/detail/src/vnodeFile.c @@ -114,6 +114,7 @@ int vnodeCreateHeadDataFile(int vnode, int fileId, char *headName, char *dataNam char *path = vnodeGetDataDir(vnode, fileId); if (path == NULL) { + dError("vid:%d, fileId:%d, failed to get dataDir", vnode, fileId); return -1; } diff --git a/src/system/detail/src/vnodeShell.c b/src/system/detail/src/vnodeShell.c index 91e6c9527b2bf0ea8f33eecd64121b9a5472ced0..b963b9d1c00d656e7262e9486f0bba7b62d9b304 100644 --- a/src/system/detail/src/vnodeShell.c +++ b/src/system/detail/src/vnodeShell.c @@ -88,28 +88,32 @@ void *vnodeProcessMsgFromShell(char *msg, void *ahandle, void *thandle) { } } - // if ( vnodeList[vnode].status != TSDB_STATUS_MASTER && pMsg->msgType != TSDB_MSG_TYPE_RETRIEVE ) { + dTrace("vid:%d sid:%d, msg:%s is received pConn:%p", vnode, sid, taosMsg[pMsg->msgType], thandle); -#ifdef CLUSTER - if (vnodeList[vnode].vnodeStatus != TSDB_VN_STATUS_MASTER) { - taosSendSimpleRsp(thandle, pMsg->msgType + 1, TSDB_CODE_NOT_READY); - dTrace("vid:%d sid:%d, shell msg is ignored since in state:%d", vnode, sid, vnodeList[vnode].vnodeStatus); - } else { -#endif - dTrace("vid:%d sid:%d, msg:%s is received pConn:%p", vnode, sid, taosMsg[pMsg->msgType], thandle); - - if (pMsg->msgType == TSDB_MSG_TYPE_QUERY) { + if (pMsg->msgType == TSDB_MSG_TYPE_QUERY) { + if (vnodeList[vnode].vnodeStatus == TSDB_VN_STATUS_MASTER || vnodeList[vnode].vnodeStatus == TSDB_VN_STATUS_SLAVE) { vnodeProcessQueryRequest((char *)pMsg->content, pMsg->msgLen - sizeof(SIntMsg), pObj); - } else if (pMsg->msgType == TSDB_MSG_TYPE_RETRIEVE) { - vnodeProcessRetrieveRequest((char *)pMsg->content, pMsg->msgLen - sizeof(SIntMsg), pObj); - } else if (pMsg->msgType == TSDB_MSG_TYPE_SUBMIT) { - vnodeProcessShellSubmitRequest((char *)pMsg->content, pMsg->msgLen - sizeof(SIntMsg), pObj); } else { - dError("%s is not processed", taosMsg[pMsg->msgType]); + taosSendSimpleRsp(thandle, pMsg->msgType + 1, TSDB_CODE_NOT_READY); + dTrace("vid:%d sid:%d, shell query msg is ignored since in status:%s", vnode, sid, taosGetVnodeStatusStr(vnodeList[vnode].vnodeStatus)); + } + } else if (pMsg->msgType == TSDB_MSG_TYPE_RETRIEVE) { + if (vnodeList[vnode].vnodeStatus == TSDB_VN_STATUS_MASTER || vnodeList[vnode].vnodeStatus == TSDB_VN_STATUS_SLAVE) { + vnodeProcessRetrieveRequest((char *) pMsg->content, pMsg->msgLen - sizeof(SIntMsg), pObj); + } else { + taosSendSimpleRsp(thandle, pMsg->msgType + 1, TSDB_CODE_NOT_READY); + dTrace("vid:%d sid:%d, shell retrieve msg is ignored since in status:%s", vnode, sid, taosGetVnodeStatusStr(vnodeList[vnode].vnodeStatus)); } -#ifdef CLUSTER + } else if (pMsg->msgType == TSDB_MSG_TYPE_SUBMIT) { + if (vnodeList[vnode].vnodeStatus == TSDB_VN_STATUS_MASTER) { + vnodeProcessShellSubmitRequest((char *) pMsg->content, pMsg->msgLen - sizeof(SIntMsg), pObj); + } else { + taosSendSimpleRsp(thandle, pMsg->msgType + 1, TSDB_CODE_NOT_READY); + dTrace("vid:%d sid:%d, shell submit msg is ignored since in status:%s", vnode, sid, taosGetVnodeStatusStr(vnodeList[vnode].vnodeStatus)); + } + } else { + dError("%s is not processed", taosMsg[pMsg->msgType]); } -#endif return pObj; } diff --git a/src/util/CMakeLists.txt b/src/util/CMakeLists.txt index e73428353e76bfda2b11f86efeadd44b97d73138..5e84f3feadbf4f8cee66c334ac62465ed081936e 100644 --- a/src/util/CMakeLists.txt +++ b/src/util/CMakeLists.txt @@ -37,7 +37,6 @@ ELSEIF (TD_WINDOWS_64) LIST(APPEND SRC ./src/ihash.c) LIST(APPEND SRC ./src/lz4.c) LIST(APPEND SRC ./src/shash.c) - LIST(APPEND SRC ./src/sql.c) LIST(APPEND SRC ./src/tbase64.c) LIST(APPEND SRC ./src/tcache.c) LIST(APPEND SRC ./src/tcompression.c) @@ -59,8 +58,6 @@ ELSEIF (TD_WINDOWS_64) LIST(APPEND SRC ./src/tskiplist.c) LIST(APPEND SRC ./src/tsocket.c) LIST(APPEND SRC ./src/tstatus.c) - LIST(APPEND SRC ./src/tstoken.c) - LIST(APPEND SRC ./src/tstoken.c) LIST(APPEND SRC ./src/tstrbuild.c) LIST(APPEND SRC ./src/ttime.c) LIST(APPEND SRC ./src/ttimer.c) diff --git a/src/util/src/version.c b/src/util/src/version.c index 96e7ad4eadd0557795ef44edaae07c3c568308f0..35cd40a942b3f6f74f3d1dd565130201a8e7b0f6 100644 --- a/src/util/src/version.c +++ b/src/util/src/version.c @@ -1,4 +1,4 @@ char version[64] = "1.6.4.0"; char compatible_version[64] = "1.6.1.0"; -char gitinfo[128] = "d04354a8ac2f7dd9ba521d755e5d484a203783d9"; -char buildinfo[512] = "Built by root at 2019-11-11 10:23"; +char gitinfo[128] = "b6e308866e315483915f4c42a2717547ed0b9d36"; +char buildinfo[512] = "Built by ubuntu at 2019-11-26 21:56";