diff --git a/src/common/src/tglobal.c b/src/common/src/tglobal.c index ac7bc31c3dccd41c14135b9691daacf96e59c157..f444b7b5c87f6feee64e056f4c4696d1141d0397 100644 --- a/src/common/src/tglobal.c +++ b/src/common/src/tglobal.c @@ -107,7 +107,6 @@ int32_t tsReplications = TSDB_DEFAULT_REPLICA_NUM; int16_t tsAffectedRowsMod = 0; int32_t tsNumOfMPeers = 3; int32_t tsMaxShellConns = 2000; -int32_t tsMaxTables = 100000; char tsDefaultDB[TSDB_DB_NAME_LEN] = {0}; char tsDefaultUser[64] = "root"; diff --git a/src/inc/taosdef.h b/src/inc/taosdef.h index aeccd92d9abd75332c3eabfff762d04bfe6e29f7..b6a37d85a2c6a5df1ebad940e3a8c83cca782f13 100644 --- a/src/inc/taosdef.h +++ b/src/inc/taosdef.h @@ -340,13 +340,14 @@ void tsDataSwap(void *pLeft, void *pRight, int32_t type, int32_t size); #define TSDB_SESSIONS_PER_VNODE (300) #define TSDB_SESSIONS_PER_DNODE (TSDB_SESSIONS_PER_VNODE * TSDB_MAX_VNODES) -#define TSDB_MAX_MNODES 5 -#define TSDB_MAX_DNODES 10 -#define TSDB_MAX_ACCOUNTS 10 -#define TSDB_MAX_USERS 20 -#define TSDB_MAX_DBS 100 -#define TSDB_MAX_VGROUPS 1000 -#define TSDB_MAX_SUPER_TABLES 100 +#define TSDB_DEFAULT_MNODES_HASH_SIZE 5 +#define TSDB_DEFAULT_DNODES_HASH_SIZE 10 +#define TSDB_DEFAULT_ACCOUNTS_HASH_SIZE 10 +#define TSDB_DEFAULT_USERS_HASH_SIZE 20 +#define TSDB_DEFAULT_DBS_HASH_SIZE 100 +#define TSDB_DEFAULT_VGROUPS_HASH_SIZE 100 +#define TSDB_DEFAULT_STABLES_HASH_SIZE 100 +#define TSDB_DEFAULT_CTABLES_HASH_SIZE 10000 #define TSDB_PORT_DNODESHELL 0 #define TSDB_PORT_DNODEDNODE 5 diff --git a/src/kit/taosdump/taosdump.c b/src/kit/taosdump/taosdump.c index 06ee09943a975daad5a572ec4e9aae28863fe254..5ea75a1cde7d1d918b377b26ca4a8fa77872c803 100644 --- a/src/kit/taosdump/taosdump.c +++ b/src/kit/taosdump/taosdump.c @@ -37,6 +37,8 @@ #define COMMAND_SIZE 65536 #define DEFAULT_DUMP_FILE "taosdump.sql" +#define MAX_DBS 100 + int converStringToReadable(char *str, int size, char *buf, int bufsize); int convertNCharToReadable(char *str, int size, char *buf, int bufsize); void taosDumpCharset(FILE *fp); @@ -359,7 +361,7 @@ int main(int argc, char *argv[]) { void taosFreeDbInfos() { if (dbInfos == NULL) return; - for (int i = 0; i < TSDB_MAX_DBS; i++) tfree(dbInfos[i]); + for (int i = 0; i < MAX_DBS; i++) tfree(dbInfos[i]); tfree(dbInfos); } @@ -437,7 +439,7 @@ int taosDumpOut(SDumpArguments *arguments) { return -1; } - dbInfos = (SDbInfo **)calloc(TSDB_MAX_DBS, sizeof(SDbInfo *)); + dbInfos = (SDbInfo **)calloc(MAX_DBS, sizeof(SDbInfo *)); if (dbInfos == NULL) { fprintf(stderr, "failed to allocate memory\n"); goto _exit_failure; diff --git a/src/mnode/src/mgmtAcct.c b/src/mnode/src/mgmtAcct.c index 27beff8944f717d4193fdd6ae91b5a2c23c84506..a35591382c9a2d00dbedcdaa7f34f870ae74887c 100644 --- a/src/mnode/src/mgmtAcct.c +++ b/src/mnode/src/mgmtAcct.c @@ -94,7 +94,7 @@ int32_t mgmtInitAccts() { SSdbTableDesc tableDesc = { .tableId = SDB_TABLE_ACCOUNT, .tableName = "accounts", - .hashSessions = TSDB_MAX_ACCOUNTS, + .hashSessions = TSDB_DEFAULT_ACCOUNTS_HASH_SIZE, .maxRowSize = tsAcctUpdateSize, .refCountPos = (int8_t *)(&tObj.refCount) - (int8_t *)&tObj, .keyType = SDB_KEY_STRING, diff --git a/src/mnode/src/mgmtDb.c b/src/mnode/src/mgmtDb.c index fbc22e56421a63b20dc8814d1de92bdb16ffddb9..df18fe8786f523cac624f5a4ffa0718ee5a906ee 100644 --- a/src/mnode/src/mgmtDb.c +++ b/src/mnode/src/mgmtDb.c @@ -128,7 +128,7 @@ int32_t mgmtInitDbs() { SSdbTableDesc tableDesc = { .tableId = SDB_TABLE_DB, .tableName = "dbs", - .hashSessions = TSDB_MAX_DBS, + .hashSessions = TSDB_DEFAULT_DBS_HASH_SIZE, .maxRowSize = tsDbUpdateSize, .refCountPos = (int8_t *)(&tObj.refCount) - (int8_t *)&tObj, .keyType = SDB_KEY_STRING, diff --git a/src/mnode/src/mgmtDnode.c b/src/mnode/src/mgmtDnode.c index c3ae8b5ab1cbb16233a4a89173ada241710c9108..1189da92e2fd2ce8fef3a55f02047b578b0d7a6d 100644 --- a/src/mnode/src/mgmtDnode.c +++ b/src/mnode/src/mgmtDnode.c @@ -130,7 +130,7 @@ int32_t mgmtInitDnodes() { SSdbTableDesc tableDesc = { .tableId = SDB_TABLE_DNODE, .tableName = "dnodes", - .hashSessions = TSDB_MAX_DNODES, + .hashSessions = TSDB_DEFAULT_DNODES_HASH_SIZE, .maxRowSize = tsDnodeUpdateSize, .refCountPos = (int8_t *)(&tObj.refCount) - (int8_t *)&tObj, .keyType = SDB_KEY_AUTO, diff --git a/src/mnode/src/mgmtMnode.c b/src/mnode/src/mgmtMnode.c index 0bb4895e36dfb75a2249bac94f5967894e288586..5b2a5c40a87d7776774c232c69f152acdd86d710 100644 --- a/src/mnode/src/mgmtMnode.c +++ b/src/mnode/src/mgmtMnode.c @@ -133,7 +133,7 @@ int32_t mgmtInitMnodes() { SSdbTableDesc tableDesc = { .tableId = SDB_TABLE_MNODE, .tableName = "mnodes", - .hashSessions = TSDB_MAX_MNODES, + .hashSessions = TSDB_DEFAULT_MNODES_HASH_SIZE, .maxRowSize = tsMnodeUpdateSize, .refCountPos = (int8_t *)(&tObj.refCount) - (int8_t *)&tObj, .keyType = SDB_KEY_INT, diff --git a/src/mnode/src/mgmtTable.c b/src/mnode/src/mgmtTable.c index 3dfea2ade86c071f1a1ed8bdce36c198cc06bdab..05cf88f8284430dec5b26992d08c6634593d95ad 100644 --- a/src/mnode/src/mgmtTable.c +++ b/src/mnode/src/mgmtTable.c @@ -507,7 +507,7 @@ static int32_t mgmtInitSuperTables() { SSdbTableDesc tableDesc = { .tableId = SDB_TABLE_STABLE, .tableName = "stables", - .hashSessions = TSDB_MAX_SUPER_TABLES, + .hashSessions = TSDB_DEFAULT_STABLES_HASH_SIZE, .maxRowSize = sizeof(SSuperTableObj) + sizeof(SSchema) * (TSDB_MAX_TAGS + TSDB_MAX_COLUMNS + 16) + TSDB_TABLE_ID_LEN, .refCountPos = (int8_t *)(&tObj.refCount) - (int8_t *)&tObj, .keyType = SDB_KEY_VAR_STRING, diff --git a/src/mnode/src/mgmtUser.c b/src/mnode/src/mgmtUser.c index cc22ed2169d3c810a8c5921538b188f1dcb45746..62a98c41707c11083818ad96af4c2fdb7744ffb4 100644 --- a/src/mnode/src/mgmtUser.c +++ b/src/mnode/src/mgmtUser.c @@ -117,7 +117,7 @@ int32_t mgmtInitUsers() { SSdbTableDesc tableDesc = { .tableId = SDB_TABLE_USER, .tableName = "users", - .hashSessions = TSDB_MAX_USERS, + .hashSessions = TSDB_DEFAULT_USERS_HASH_SIZE, .maxRowSize = tsUserUpdateSize, .refCountPos = (int8_t *)(&tObj.refCount) - (int8_t *)&tObj, .keyType = SDB_KEY_STRING, diff --git a/src/mnode/src/mgmtVgroup.c b/src/mnode/src/mgmtVgroup.c index 168fd9f634ba3abfbe2bc663fd4e9bf18e5f6d69..fea8108698fb7421ac53a94e18013584e0d4dfa4 100644 --- a/src/mnode/src/mgmtVgroup.c +++ b/src/mnode/src/mgmtVgroup.c @@ -200,7 +200,7 @@ int32_t mgmtInitVgroups() { SSdbTableDesc tableDesc = { .tableId = SDB_TABLE_VGROUP, .tableName = "vgroups", - .hashSessions = TSDB_MAX_VGROUPS, + .hashSessions = TSDB_DEFAULT_VGROUPS_HASH_SIZE, .maxRowSize = tsVgUpdateSize, .refCountPos = (int8_t *)(&tObj.refCount) - (int8_t *)&tObj, .keyType = SDB_KEY_AUTO,