Merge remote-tracking branch 'origin/develop' into feature/crash_gen
This commit is contained in:
commit
f392995694
|
@ -174,7 +174,7 @@ typedef struct {
|
|||
#define keyCol(pCols) (&((pCols)->cols[0])) // Key column
|
||||
#define dataColsKeyAt(pCols, idx) ((TSKEY *)(keyCol(pCols)->pData))[(idx)]
|
||||
#define dataColsKeyFirst(pCols) dataColsKeyAt(pCols, 0)
|
||||
#define dataColsKeyLast(pCols) dataColsKeyAt(pCols, (pCols)->numOfPoints - 1)
|
||||
#define dataColsKeyLast(pCols) ((pCols->numOfPoints == 0) ? 0 : dataColsKeyAt(pCols, (pCols)->numOfPoints - 1))
|
||||
|
||||
SDataCols *tdNewDataCols(int maxRowSize, int maxCols, int maxRows);
|
||||
void tdResetDataCols(SDataCols *pCols);
|
||||
|
|
|
@ -71,13 +71,13 @@ void dnodeMgmt(SRpcMsg *pMsg) {
|
|||
rpcFreeCont(pMsg->pCont);
|
||||
}
|
||||
|
||||
static int32_t dnodeGetVnodeList(int32_t vnodeList[]) {
|
||||
static int32_t dnodeGetVnodeList(int32_t vnodeList[], int32_t *numOfVnodes) {
|
||||
DIR *dir = opendir(tsVnodeDir);
|
||||
if (dir == NULL) {
|
||||
return TSDB_CODE_NO_WRITE_ACCESS;
|
||||
}
|
||||
|
||||
int32_t numOfVnodes = 0;
|
||||
*numOfVnodes = 0;
|
||||
struct dirent *de = NULL;
|
||||
while ((de = readdir(dir)) != NULL) {
|
||||
if (strcmp(de->d_name, ".") == 0 || strcmp(de->d_name, "..") == 0) continue;
|
||||
|
@ -86,21 +86,28 @@ static int32_t dnodeGetVnodeList(int32_t vnodeList[]) {
|
|||
int32_t vnode = atoi(de->d_name + 5);
|
||||
if (vnode == 0) continue;
|
||||
|
||||
vnodeList[numOfVnodes] = vnode;
|
||||
numOfVnodes++;
|
||||
vnodeList[*numOfVnodes] = vnode;
|
||||
(*numOfVnodes)++;
|
||||
}
|
||||
}
|
||||
closedir(dir);
|
||||
|
||||
return numOfVnodes;
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
static int32_t dnodeOpenVnodes() {
|
||||
char vnodeDir[TSDB_FILENAME_LEN * 3];
|
||||
int32_t failed = 0;
|
||||
|
||||
int32_t *vnodeList = (int32_t *)malloc(sizeof(int32_t) * TSDB_MAX_VNODES);
|
||||
int32_t numOfVnodes = dnodeGetVnodeList(vnodeList);
|
||||
int32_t numOfVnodes;
|
||||
int32_t status;
|
||||
|
||||
status = dnodeGetVnodeList(vnodeList, &numOfVnodes);
|
||||
|
||||
if (status != TSDB_CODE_SUCCESS) {
|
||||
dPrint("Get dnode list failed");
|
||||
return status;
|
||||
}
|
||||
|
||||
for (int32_t i = 0; i < numOfVnodes; ++i) {
|
||||
snprintf(vnodeDir, TSDB_FILENAME_LEN * 3, "%s/vnode%d", tsVnodeDir, vnodeList[i]);
|
||||
|
@ -115,7 +122,15 @@ static int32_t dnodeOpenVnodes() {
|
|||
|
||||
static void dnodeCloseVnodes() {
|
||||
int32_t *vnodeList = (int32_t *)malloc(sizeof(int32_t) * TSDB_MAX_VNODES);
|
||||
int32_t numOfVnodes = dnodeGetVnodeList(vnodeList);
|
||||
int32_t numOfVnodes;
|
||||
int32_t status;
|
||||
|
||||
status = dnodeGetVnodeList(vnodeList, &numOfVnodes);
|
||||
|
||||
if (status != TSDB_CODE_SUCCESS) {
|
||||
dPrint("Get dnode list failed");
|
||||
return;
|
||||
}
|
||||
|
||||
for (int32_t i = 0; i < numOfVnodes; ++i) {
|
||||
vnodeClose(vnodeList[i]);
|
||||
|
@ -143,7 +158,7 @@ static int32_t dnodeProcessCreateVnodeMsg(SRpcMsg *rpcMsg) {
|
|||
for (int32_t j = 0; j < pCreate->cfg.replications; ++j) {
|
||||
pCreate->nodes[j].nodeId = htonl(pCreate->nodes[j].nodeId);
|
||||
}
|
||||
|
||||
|
||||
void *pVnode = vnodeAccquireVnode(pCreate->cfg.vgId);
|
||||
if (pVnode != NULL) {
|
||||
int32_t code = vnodeAlter(pVnode, pCreate);
|
||||
|
|
|
@ -44,13 +44,13 @@ static void dnodeUnSetModuleStatus(int32_t module) {
|
|||
}
|
||||
|
||||
static void dnodeAllocModules() {
|
||||
tsModule[TSDB_MOD_MGMT].name = false;
|
||||
tsModule[TSDB_MOD_MGMT].enable = false;
|
||||
tsModule[TSDB_MOD_MGMT].name = "mgmt";
|
||||
tsModule[TSDB_MOD_MGMT].initFp = mgmtInitSystem;
|
||||
tsModule[TSDB_MOD_MGMT].cleanUpFp = mgmtCleanUpSystem;
|
||||
tsModule[TSDB_MOD_MGMT].startFp = mgmtStartSystem;
|
||||
tsModule[TSDB_MOD_MGMT].stopFp = mgmtStopSystem;
|
||||
|
||||
|
||||
tsModule[TSDB_MOD_HTTP].enable = (tsEnableHttpModule == 1);
|
||||
tsModule[TSDB_MOD_HTTP].name = "http";
|
||||
tsModule[TSDB_MOD_HTTP].initFp = httpInitSystem;
|
||||
|
@ -60,7 +60,7 @@ static void dnodeAllocModules() {
|
|||
if (tsEnableHttpModule) {
|
||||
dnodeSetModuleStatus(TSDB_MOD_HTTP);
|
||||
}
|
||||
|
||||
|
||||
tsModule[TSDB_MOD_MONITOR].enable = (tsEnableMonitorModule == 1);
|
||||
tsModule[TSDB_MOD_MONITOR].name = "monitor";
|
||||
tsModule[TSDB_MOD_MONITOR].initFp = monitorInitSystem;
|
||||
|
|
|
@ -20,11 +20,29 @@
|
|||
#include "tsdb.h"
|
||||
#include "tskiplist.h"
|
||||
#include "tutil.h"
|
||||
#include "tlog.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern int tsdbDebugFlag;
|
||||
|
||||
#define tsdbError(...) \
|
||||
if (tsdbDebugFlag & DEBUG_ERROR) { \
|
||||
taosPrintLog("ERROR TSDB ", tsdbDebugFlag, __VA_ARGS__); \
|
||||
}
|
||||
#define tsdbWarn(...) \
|
||||
if (tsdbDebugFlag & DEBUG_WARN) { \
|
||||
taosPrintLog("WARN TSDB ", tsdbDebugFlag, __VA_ARGS__); \
|
||||
}
|
||||
#define tsdbTrace(...) \
|
||||
if (tsdbDebugFlag & DEBUG_TRACE) { \
|
||||
taosPrintLog("TSDB ", tsdbDebugFlag, __VA_ARGS__); \
|
||||
}
|
||||
#define tsdbPrint(...) \
|
||||
{ taosPrintLog("TSDB ", 255, __VA_ARGS__); }
|
||||
|
||||
// ------------------------------ TSDB META FILE INTERFACES ------------------------------
|
||||
#define TSDB_META_FILE_NAME "META"
|
||||
#define TSDB_META_HASH_FRACTION 1.1
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
#include "tscompression.h"
|
||||
#include "tchecksum.h"
|
||||
|
||||
int tsdbDebugFlag = 135;
|
||||
|
||||
#define TSDB_DEFAULT_PRECISION TSDB_PRECISION_MILLI // default precision
|
||||
#define IS_VALID_PRECISION(precision) (((precision) >= TSDB_PRECISION_MILLI) && ((precision) <= TSDB_PRECISION_NANO))
|
||||
#define TSDB_DEFAULT_COMPRESSION TWO_STAGE_COMP
|
||||
|
|
|
@ -20,7 +20,7 @@ run general/table/tinyint.sim
|
|||
run general/table/db.table.sim
|
||||
|
||||
run general/user/basic1.sim
|
||||
run general/user/pass_alter.sim
|
||||
#run general/user/pass_alter.sim
|
||||
run general/user/pass_len.sim
|
||||
run general/user/user_create.sim
|
||||
run general/user/user_len.sim
|
||||
|
|
Loading…
Reference in New Issue