From 80183ad8f3d81214544040acdafbec29f0137934 Mon Sep 17 00:00:00 2001 From: kailixu Date: Thu, 20 Feb 2025 11:11:27 +0800 Subject: [PATCH 1/3] enh: grant support TDgpt --- include/common/tgrant.h | 1 + include/util/taoserror.h | 1 + source/util/src/terror.c | 1 + source/util/test/errorCodeTable.ini | 1 + tests/system-test/0-others/information_schema.py | 1 + 5 files changed, 5 insertions(+) diff --git a/include/common/tgrant.h b/include/common/tgrant.h index 1660cc6a1b..17a383f7c6 100644 --- a/include/common/tgrant.h +++ b/include/common/tgrant.h @@ -61,6 +61,7 @@ typedef enum { TSDB_GRANT_ACTIVE_ACTIVE, TSDB_GRANT_DUAL_REPLICA_HA, TSDB_GRANT_DB_ENCRYPTION, + TSDB_GRANT_TD_GPT, } EGrantType; int32_t checkAndGetCryptKey(const char *encryptCode, const char *machineId, char **key); diff --git a/include/util/taoserror.h b/include/util/taoserror.h index 397118411c..c93e1ffde4 100644 --- a/include/util/taoserror.h +++ b/include/util/taoserror.h @@ -693,6 +693,7 @@ int32_t taosGetErrSize(); #define TSDB_CODE_GRANT_OBJECT_STROAGE_EXPIRED TAOS_DEF_ERROR_CODE(0, 0x082B) #define TSDB_CODE_GRANT_DUAL_REPLICA_HA_EXPIRED TAOS_DEF_ERROR_CODE(0, 0x082C) #define TSDB_CODE_GRANT_DB_ENCRYPTION_EXPIRED TAOS_DEF_ERROR_CODE(0, 0x082D) +#define TSDB_CODE_GRANT_TD_GPT_EXPIRED TAOS_DEF_ERROR_CODE(0, 0x082E) // sync // #define TSDB_CODE_SYN_INVALID_CONFIG TAOS_DEF_ERROR_CODE(0, 0x0900) // 2.x diff --git a/source/util/src/terror.c b/source/util/src/terror.c index f34b00bec5..7e32a198e4 100644 --- a/source/util/src/terror.c +++ b/source/util/src/terror.c @@ -564,6 +564,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_GRANT_MULTI_STORAGE_EXPIRED, "License expired for m TAOS_DEFINE_ERROR(TSDB_CODE_GRANT_OBJECT_STROAGE_EXPIRED, "License expired for object storage function") TAOS_DEFINE_ERROR(TSDB_CODE_GRANT_DUAL_REPLICA_HA_EXPIRED,"License expired for dual-replica HA function") TAOS_DEFINE_ERROR(TSDB_CODE_GRANT_DB_ENCRYPTION_EXPIRED, "License expired for database encryption function") +TAOS_DEFINE_ERROR(TSDB_CODE_GRANT_TD_GPT_EXPIRED, "License expired for TDgpt function") // sync TAOS_DEFINE_ERROR(TSDB_CODE_SYN_TIMEOUT, "Sync timeout") diff --git a/source/util/test/errorCodeTable.ini b/source/util/test/errorCodeTable.ini index f67c8ab834..717499ca75 100644 --- a/source/util/test/errorCodeTable.ini +++ b/source/util/test/errorCodeTable.ini @@ -400,6 +400,7 @@ TSDB_CODE_GRANT_MULTI_STORAGE_EXPIRED = 0x8000082A TSDB_CODE_GRANT_OBJECT_STROAGE_EXPIRED = 0x8000082B TSDB_CODE_GRANT_DUAL_REPLICA_HA_EXPIRED = 0x8000082C TSDB_CODE_GRANT_DB_ENCRYPTION_EXPIRED = 0x8000082D +TSDB_CODE_GRANT_TD_GPT_EXPIRED = 0x8000082E TSDB_CODE_SYN_TIMEOUT = 0x80000903 TSDB_CODE_SYN_MISMATCHED_SIGNATURE = 0x80000907 TSDB_CODE_SYN_NOT_LEADER = 0x8000090C diff --git a/tests/system-test/0-others/information_schema.py b/tests/system-test/0-others/information_schema.py index 96cd596a20..63f0a236c3 100644 --- a/tests/system-test/0-others/information_schema.py +++ b/tests/system-test/0-others/information_schema.py @@ -283,6 +283,7 @@ class TDTestCase: 'active_active':'Active-Active', 'dual_replica':'Dual-Replica HA', 'db_encryption':'Database Encryption', + 'tdgpt':'TDgpt', 'opc_da':'OPC_DA', 'opc_ua':'OPC_UA', 'pi':'Pi', From 29129b6b3a18c275b4d5159c51b7a04019b2be95 Mon Sep 17 00:00:00 2001 From: kailixu Date: Thu, 20 Feb 2025 12:59:09 +0800 Subject: [PATCH 2/3] chore: ignore error check for 0x8000082E --- tests/army/whole/checkErrorCode.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/army/whole/checkErrorCode.py b/tests/army/whole/checkErrorCode.py index 1a14269f54..d66ae56e46 100644 --- a/tests/army/whole/checkErrorCode.py +++ b/tests/army/whole/checkErrorCode.py @@ -50,7 +50,7 @@ ignoreCodes = [ '0x80000734', '0x80000735', '0x80000736', '0x80000737', '0x80000738', '0x8000080E', '0x8000080F', '0x80000810', '0x80000811', '0x80000812', '0x80000813', '0x80000814', '0x80000815', '0x80000816', '0x80000817', '0x80000818', '0x80000819', '0x80000820', '0x80000821', '0x80000822', '0x80000823', '0x80000824', '0x80000825', '0x80000826', '0x80000827', '0x80000828', '0x80000829', '0x8000082A', '0x8000082B', '0x8000082C', - '0x8000082D', '0x80000907', '0x80000919', '0x8000091A', '0x8000091B', '0x8000091C', '0x8000091D', '0x8000091E', '0x8000091F', '0x80000A00', + '0x8000082D', '0x8000082E', '0x80000907', '0x80000919', '0x8000091A', '0x8000091B', '0x8000091C', '0x8000091D', '0x8000091E', '0x8000091F', '0x80000A00', '0x80000A01', '0x80000A03', '0x80000A06', '0x80000A07', '0x80000A08', '0x80000A09', '0x80000A0A', '0x80000A0B', '0x80000A0E', '0x80002206', '0x80002207', '0x80002406', '0x80002407', '0x80002503', '0x80002506', '0x80002507', '0x8000261B', '0x80002653', '0x80002668', '0x80002669', '0x8000266A', '0x8000266B', '0x8000266C', '0x8000266D', '0x8000266E', '0x8000266F', '0x80002670', '0x80002671', '0x80002672', '0x80002673', From aae88d7cc3db6119fca1eb489211933761a2ed9b Mon Sep 17 00:00:00 2001 From: kailixu Date: Fri, 21 Feb 2025 04:10:52 +0800 Subject: [PATCH 3/3] chore: adjust test case for grant TDgpt --- tests/system-test/0-others/grant.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/system-test/0-others/grant.py b/tests/system-test/0-others/grant.py index 25af6eb842..038992b65a 100644 --- a/tests/system-test/0-others/grant.py +++ b/tests/system-test/0-others/grant.py @@ -237,7 +237,7 @@ class TDTestCase: tdLog.info(f"expireTime: {expireTime}, serviceTime: {serviceTime}") tdSql.checkEqual(True, abs(expireTime - serviceTime - 864000) < 15) tdSql.query(f'show grants full;') - nGrantItems = 31 + nGrantItems = 32 tdSql.checkEqual(len(tdSql.queryResult), nGrantItems) tdSql.checkEqual(tdSql.queryResult[0][2], serviceTimeStr) for i in range(1, nGrantItems):