提交 db38dce2 编写于 作者: X xywang

Merge branch 'develop' into fix/TD-10691

...@@ -18,6 +18,7 @@ ENDIF () ...@@ -18,6 +18,7 @@ ENDIF ()
SET(TD_ACCOUNT FALSE) SET(TD_ACCOUNT FALSE)
SET(TD_ADMIN FALSE) SET(TD_ADMIN FALSE)
SET(TD_GRANT FALSE) SET(TD_GRANT FALSE)
SET(TD_USB_DONGLE FALSE)
SET(TD_MQTT FALSE) SET(TD_MQTT FALSE)
SET(TD_TSDB_PLUGINS FALSE) SET(TD_TSDB_PLUGINS FALSE)
SET(TD_STORAGE FALSE) SET(TD_STORAGE FALSE)
......
...@@ -13,6 +13,10 @@ IF (TD_GRANT) ...@@ -13,6 +13,10 @@ IF (TD_GRANT)
ADD_DEFINITIONS(-D_GRANT) ADD_DEFINITIONS(-D_GRANT)
ENDIF () ENDIF ()
IF (TD_USB_DONGLE)
ADD_DEFINITIONS(-D_USB_DONGLE)
ENDIF ()
IF (TD_MQTT) IF (TD_MQTT)
ADD_DEFINITIONS(-D_MQTT) ADD_DEFINITIONS(-D_MQTT)
ENDIF () ENDIF ()
......
IF (TD_LINUX) IF (TD_LINUX)
SET(TD_MAKE_INSTALL_SH "${TD_COMMUNITY_DIR}/packaging/tools/make_install.sh") SET(TD_MAKE_INSTALL_SH "${TD_COMMUNITY_DIR}/packaging/tools/make_install.sh")
INSTALL(CODE "MESSAGE(\"make install script: ${TD_MAKE_INSTALL_SH}\")") INSTALL(CODE "MESSAGE(\"make install script: ${TD_MAKE_INSTALL_SH}\")")
INSTALL(CODE "execute_process(COMMAND chmod 777 ${TD_MAKE_INSTALL_SH})") INSTALL(CODE "execute_process(COMMAND bash ${TD_MAKE_INSTALL_SH} ${TD_COMMUNITY_DIR} ${PROJECT_BINARY_DIR} Linux ${TD_VER_NUMBER})")
INSTALL(CODE "execute_process(COMMAND ${TD_MAKE_INSTALL_SH} ${TD_COMMUNITY_DIR} ${PROJECT_BINARY_DIR} Linux ${TD_VER_NUMBER})")
ELSEIF (TD_WINDOWS) ELSEIF (TD_WINDOWS)
IF (TD_POWER) IF (TD_POWER)
SET(CMAKE_INSTALL_PREFIX C:/PowerDB) SET(CMAKE_INSTALL_PREFIX C:/PowerDB)
...@@ -41,6 +40,5 @@ ELSEIF (TD_WINDOWS) ...@@ -41,6 +40,5 @@ ELSEIF (TD_WINDOWS)
ELSEIF (TD_DARWIN) ELSEIF (TD_DARWIN)
SET(TD_MAKE_INSTALL_SH "${TD_COMMUNITY_DIR}/packaging/tools/make_install.sh") SET(TD_MAKE_INSTALL_SH "${TD_COMMUNITY_DIR}/packaging/tools/make_install.sh")
INSTALL(CODE "MESSAGE(\"make install script: ${TD_MAKE_INSTALL_SH}\")") INSTALL(CODE "MESSAGE(\"make install script: ${TD_MAKE_INSTALL_SH}\")")
INSTALL(CODE "execute_process(COMMAND chmod 777 ${TD_MAKE_INSTALL_SH})") INSTALL(CODE "execute_process(COMMAND bash ${TD_MAKE_INSTALL_SH} ${TD_COMMUNITY_DIR} ${PROJECT_BINARY_DIR} Darwin ${TD_VER_NUMBER})")
INSTALL(CODE "execute_process(COMMAND ${TD_MAKE_INSTALL_SH} ${TD_COMMUNITY_DIR} ${PROJECT_BINARY_DIR} Darwin ${TD_VER_NUMBER})")
ENDIF () ENDIF ()
Subproject commit edad746514b2a53a8cf6061c93b98b52a5388692 Subproject commit 9ae793ad2d567eb11d10627b65698f612542e988
...@@ -39,6 +39,10 @@ IF (TD_GRANT) ...@@ -39,6 +39,10 @@ IF (TD_GRANT)
TARGET_LINK_LIBRARIES(taosd grant) TARGET_LINK_LIBRARIES(taosd grant)
ENDIF () ENDIF ()
IF (TD_USB_DONGLE)
TARGET_LINK_LIBRARIES(taosd usb_dongle)
ENDIF ()
IF (TD_MQTT) IF (TD_MQTT)
TARGET_LINK_LIBRARIES(taosd mqtt) TARGET_LINK_LIBRARIES(taosd mqtt)
ENDIF () ENDIF ()
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include "twal.h" #include "twal.h"
#include "tfs.h" #include "tfs.h"
#include "tsync.h" #include "tsync.h"
#include "tgrant.h"
#include "dnodeStep.h" #include "dnodeStep.h"
#include "dnodePeer.h" #include "dnodePeer.h"
#include "dnodeModule.h" #include "dnodeModule.h"
...@@ -88,6 +89,7 @@ static SStep tsDnodeSteps[] = { ...@@ -88,6 +89,7 @@ static SStep tsDnodeSteps[] = {
{"dnode-statustmr", dnodeInitStatusTimer,dnodeCleanupStatusTimer}, {"dnode-statustmr", dnodeInitStatusTimer,dnodeCleanupStatusTimer},
{"dnode-telemetry", dnodeInitTelemetry, dnodeCleanupTelemetry}, {"dnode-telemetry", dnodeInitTelemetry, dnodeCleanupTelemetry},
{"dnode-script", scriptEnvPoolInit, scriptEnvPoolCleanup}, {"dnode-script", scriptEnvPoolInit, scriptEnvPoolCleanup},
{"dnode-grant", grantInit, grantCleanUp},
}; };
static SStep tsDnodeCompactSteps[] = { static SStep tsDnodeCompactSteps[] = {
......
...@@ -927,9 +927,12 @@ static int32_t mnodeProcessCreateDbMsg(SMnodeMsg *pMsg) { ...@@ -927,9 +927,12 @@ static int32_t mnodeProcessCreateDbMsg(SMnodeMsg *pMsg) {
pCreate->maxRowsPerFileBlock = htonl(pCreate->maxRowsPerFileBlock); pCreate->maxRowsPerFileBlock = htonl(pCreate->maxRowsPerFileBlock);
int32_t code; int32_t code;
#ifdef GRANT_CHECK_WRITE
if (grantCheck(TSDB_GRANT_TIME) != TSDB_CODE_SUCCESS) { if (grantCheck(TSDB_GRANT_TIME) != TSDB_CODE_SUCCESS) {
code = TSDB_CODE_GRANT_EXPIRED; code = TSDB_CODE_GRANT_EXPIRED;
} else if (!pMsg->pUser->writeAuth) { } // else
#endif
if (!pMsg->pUser->writeAuth) {
code = TSDB_CODE_MND_NO_RIGHTS; code = TSDB_CODE_MND_NO_RIGHTS;
} else { } else {
code = mnodeCreateDb(pMsg->pUser->pAcct, pCreate, pMsg); code = mnodeCreateDb(pMsg->pUser->pAcct, pCreate, pMsg);
......
...@@ -191,9 +191,11 @@ static int32_t mnodeUpdateFunc(SFuncObj *pFunc, void *pMsg) { ...@@ -191,9 +191,11 @@ static int32_t mnodeUpdateFunc(SFuncObj *pFunc, void *pMsg) {
} }
*/ */
int32_t mnodeCreateFunc(SAcctObj *pAcct, char *name, int32_t codeLen, char *codeScript, char *path, uint8_t outputType, int16_t outputLen, int32_t funcType, int32_t bufSize, SMnodeMsg *pMsg) { int32_t mnodeCreateFunc(SAcctObj *pAcct, char *name, int32_t codeLen, char *codeScript, char *path, uint8_t outputType, int16_t outputLen, int32_t funcType, int32_t bufSize, SMnodeMsg *pMsg) {
#ifdef GRANT_CHECK_WRITE
if (grantCheck(TSDB_GRANT_TIME) != TSDB_CODE_SUCCESS) { if (grantCheck(TSDB_GRANT_TIME) != TSDB_CODE_SUCCESS) {
return TSDB_CODE_GRANT_EXPIRED; return TSDB_CODE_GRANT_EXPIRED;
} }
#endif
if (!pMsg->pUser->writeAuth) { if (!pMsg->pUser->writeAuth) {
return TSDB_CODE_MND_NO_RIGHTS; return TSDB_CODE_MND_NO_RIGHTS;
......
...@@ -55,7 +55,7 @@ static SStep tsMnodeSteps[] = { ...@@ -55,7 +55,7 @@ static SStep tsMnodeSteps[] = {
{"mnodes", mnodeInitMnodes, mnodeCleanupMnodes}, {"mnodes", mnodeInitMnodes, mnodeCleanupMnodes},
{"sdb", sdbInit, sdbCleanUp}, {"sdb", sdbInit, sdbCleanUp},
{"balance", bnInit, bnCleanUp}, {"balance", bnInit, bnCleanUp},
{"grant", grantInit, grantCleanUp}, // {"grant", grantInit, grantCleanUp},
{"show", mnodeInitShow, mnodeCleanUpShow} {"show", mnodeInitShow, mnodeCleanUpShow}
}; };
......
...@@ -65,14 +65,16 @@ int32_t mnodeProcessWrite(SMnodeMsg *pMsg) { ...@@ -65,14 +65,16 @@ int32_t mnodeProcessWrite(SMnodeMsg *pMsg) {
return TSDB_CODE_MND_MSG_NOT_PROCESSED; return TSDB_CODE_MND_MSG_NOT_PROCESSED;
} }
#ifdef GRANT_CHECK_WRITE
int32_t code = grantCheck(TSDB_GRANT_TIME); int32_t code = grantCheck(TSDB_GRANT_TIME);
if (code != TSDB_CODE_SUCCESS) { if (code != TSDB_CODE_SUCCESS) {
mError("msg:%p, app:%p type:%s not processed, reason:%s", pMsg, pMsg->rpcMsg.ahandle, taosMsg[pMsg->rpcMsg.msgType], mError("msg:%p, app:%p type:%s not processed, reason:%s", pMsg, pMsg->rpcMsg.ahandle, taosMsg[pMsg->rpcMsg.msgType],
tstrerror(code)); tstrerror(code));
return code; return code;
} }
#endif
code = mnodeInitMsg(pMsg); int32_t code = mnodeInitMsg(pMsg);
if (code != TSDB_CODE_SUCCESS) { if (code != TSDB_CODE_SUCCESS) {
mError("msg:%p, app:%p type:%s not processed, reason:%s", pMsg, pMsg->rpcMsg.ahandle, taosMsg[pMsg->rpcMsg.msgType], mError("msg:%p, app:%p type:%s not processed, reason:%s", pMsg, pMsg->rpcMsg.ahandle, taosMsg[pMsg->rpcMsg.msgType],
tstrerror(code)); tstrerror(code));
......
...@@ -380,7 +380,7 @@ int64_t convertTimePrecision(int64_t time, int32_t fromPrecision, int32_t toPrec ...@@ -380,7 +380,7 @@ int64_t convertTimePrecision(int64_t time, int32_t fromPrecision, int32_t toPrec
assert(toPrecision == TSDB_TIME_PRECISION_MILLI || assert(toPrecision == TSDB_TIME_PRECISION_MILLI ||
toPrecision == TSDB_TIME_PRECISION_MICRO || toPrecision == TSDB_TIME_PRECISION_MICRO ||
toPrecision == TSDB_TIME_PRECISION_NANO); toPrecision == TSDB_TIME_PRECISION_NANO);
double tempResult = time; double tempResult = (double)time;
switch(fromPrecision) { switch(fromPrecision) {
case TSDB_TIME_PRECISION_MILLI: { case TSDB_TIME_PRECISION_MILLI: {
switch (toPrecision) { switch (toPrecision) {
......
Subproject commit f56aa0f485d7bb6aebbcefc2007eeecdccb767c8 Subproject commit ba539ce69dc4fe53536e9b0517fe75917dce5c46
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "tglobal.h" #include "tglobal.h"
#include "query.h" #include "query.h"
#include "vnodeStatus.h" #include "vnodeStatus.h"
#include "tgrant.h"
int32_t vNumOfExistedQHandle; // current initialized and existed query handle in current dnode int32_t vNumOfExistedQHandle; // current initialized and existed query handle in current dnode
...@@ -55,6 +56,11 @@ int32_t vnodeProcessRead(void *vparam, SVReadMsg *pRead) { ...@@ -55,6 +56,11 @@ int32_t vnodeProcessRead(void *vparam, SVReadMsg *pRead) {
} }
static int32_t vnodeCheckRead(SVnodeObj *pVnode) { static int32_t vnodeCheckRead(SVnodeObj *pVnode) {
if (grantCheck(TSDB_GRANT_TIME) != TSDB_CODE_SUCCESS) {
vDebug("vgId:%d, grant expired, refCount:%d pVnode:%p", pVnode->vgId, pVnode->refCount, pVnode);
return TSDB_CODE_GRANT_EXPIRED;
}
if (!vnodeInReadyStatus(pVnode)) { if (!vnodeInReadyStatus(pVnode)) {
vDebug("vgId:%d, vnode status is %s, refCount:%d pVnode:%p", pVnode->vgId, vnodeStatus[pVnode->status], vDebug("vgId:%d, vnode status is %s, refCount:%d pVnode:%p", pVnode->vgId, vnodeStatus[pVnode->status],
pVnode->refCount, pVnode); pVnode->refCount, pVnode);
......
...@@ -54,27 +54,36 @@ class TDTestCase: ...@@ -54,27 +54,36 @@ class TDTestCase:
binPath = buildPath + "/build/bin/" binPath = buildPath + "/build/bin/"
if(threadID == 0): if(threadID == 0):
os.system("%staosdemo -y -t %d -n %d -b INT,INT,INT,INT -m t" % print("%staosdemo -y -t %d -n %d -b INT,INT,INT,INT" %
(binPath, self.numberOfTables, self.numberOfRecords))
os.system("%staosdemo -y -t %d -n %d -b INT,INT,INT,INT" %
(binPath, self.numberOfTables, self.numberOfRecords)) (binPath, self.numberOfTables, self.numberOfRecords))
if(threadID == 1): if(threadID == 1):
time.sleep(2) time.sleep(2)
print("use test") print("use test")
while True: max_try = 100
count = 0
while (count < max_try):
try: try:
tdSql.execute("use test") tdSql.execute("use test")
break break
except Exception as e: except Exception as e:
tdLog.info("use database test failed") tdLog.info("use database test failed")
time.sleep(1) time.sleep(2)
count += 1
print("try %d times" % count)
continue continue
# check if all the tables have heen created # check if all the tables have heen created
while True: count = 0
while (count < max_try):
try: try:
tdSql.query("show tables") tdSql.query("show tables")
except Exception as e: except Exception as e:
tdLog.info("show tables test failed") tdLog.info("show tables test failed")
time.sleep(1) time.sleep(2)
count += 1
print("try %d times" % count)
continue continue
rows = tdSql.queryRows rows = tdSql.queryRows
...@@ -83,13 +92,17 @@ class TDTestCase: ...@@ -83,13 +92,17 @@ class TDTestCase:
break break
time.sleep(1) time.sleep(1)
# check if there are any records in the last created table # check if there are any records in the last created table
while True: count = 0
while (count < max_try):
print("query started") print("query started")
print("try %d times" % count)
try: try:
tdSql.query("select * from test.t7") tdSql.query("select * from test.d7")
except Exception as e: except Exception as e:
tdLog.info("select * test failed") tdLog.info("select * test failed")
time.sleep(2) time.sleep(2)
count += 1
print("try %d times" % count)
continue continue
rows = tdSql.queryRows rows = tdSql.queryRows
...@@ -100,8 +113,8 @@ class TDTestCase: ...@@ -100,8 +113,8 @@ class TDTestCase:
print("alter table test.meters add column c10 int") print("alter table test.meters add column c10 int")
tdSql.execute("alter table test.meters add column c10 int") tdSql.execute("alter table test.meters add column c10 int")
print("insert into test.t7 values (now, 1, 2, 3, 4, 0)") print("insert into test.d7 values (now, 1, 2, 3, 4, 0)")
tdSql.execute("insert into test.t7 values (now, 1, 2, 3, 4, 0)") tdSql.execute("insert into test.d7 values (now, 1, 2, 3, 4, 0)")
def run(self): def run(self):
tdSql.prepare() tdSql.prepare()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册