0716dmstrace

This commit is contained in:
bowenliu
2024-07-25 11:45:47 +08:00
parent 046166180d
commit e96cd23a29
9 changed files with 70 additions and 31 deletions

View File

@ -763,6 +763,8 @@ ss_dss_xlog_vg_name|string|0,0|NULL|NULL|
ss_dss_conn_path|string|0,0|NULL|NULL|
ss_enable_dms|bool|0,0|NULL|NULL|
ss_enable_catalog_centralized|bool|0,0|NULL|NULL|
ss_enable_dynamic_trace|bool|0,0|NULL|NULL|
ss_enable_reform_trace|bool|0,0|NULL|NULL|
ss_enable_ssl|bool|0,0|NULL|NULL|
ss_enable_aio|bool|0,0|NULL|NULL|
ss_enable_ondemand_realtime_build|bool|0,0|NULL|NULL|

View File

@ -1148,6 +1148,30 @@ static void InitStorageConfigureNamesBool()
NULL,
NULL,
NULL},
{{"ss_enable_dynamic_trace",
PGC_POSTMASTER,
NODE_SINGLENODE,
SHARED_STORAGE_OPTIONS,
gettext_noop("Whether dms dynamic trace is enabled"),
NULL,
GUC_SUPERUSER_ONLY},
&g_instance.attr.attr_storage.dms_attr.enable_dyn_trace,
true,
NULL,
NULL,
NULL},
{{"ss_enable_reform_trace",
PGC_POSTMASTER,
NODE_SINGLENODE,
SHARED_STORAGE_OPTIONS,
gettext_noop("Whether dms reform dynamic trace is enabled"),
NULL,
GUC_SUPERUSER_ONLY},
&g_instance.attr.attr_storage.dms_attr.enable_reform_trace,
true,
NULL,
NULL,
NULL},
{{"ss_enable_ssl",
PGC_POSTMASTER,
NODE_SINGLENODE,

View File

@ -835,6 +835,8 @@ job_queue_processes = 10 # Number of concurrent jobs, optional: [0..1000]
#ss_enable_ssl = on
#ss_enable_aio = on
#ss_enable_catalog_centralized = on
#ss_enable_dynamic_trace = on
#ss_enable_reform_trace = on
#ss_instance_id = 0
#ss_dss_data_vg_name = ''
#ss_dss_xlog_vg_name = ''

View File

@ -95,7 +95,7 @@ void TransformLockTagToDmsLatch(dms_drlatch_t* dlatch, const LOCKTAG locktag)
dlatch->drid.type = locktag.locktag_type;
dlatch->drid.oid = locktag.locktag_field1;
dlatch->drid.index = locktag.locktag_field2;
dlatch->drid.parent_part = locktag.locktag_field3;
dlatch->drid.parent = locktag.locktag_field3;
dlatch->drid.part = locktag.locktag_field4;
dlatch->drid.uid = locktag.locktag_field5;
}

View File

@ -395,6 +395,8 @@ static void set_dms_fi()
static void setDMSProfile(dms_profile_t* profile)
{
knl_instance_attr_dms* dms_attr = &g_instance.attr.attr_storage.dms_attr;
profile->enable_dyn_trace = dms_attr->enable_dyn_trace;
profile->enable_reform_trace = dms_attr->enable_reform_trace;
profile->resource_catalog_centralized = (unsigned int)dms_attr->enable_catalog_centralized;
profile->inst_id = (uint32)dms_attr->instance_id;
profile->page_size = BLCKSZ;

View File

@ -1,3 +1,3 @@
dms_commit_id=106e4c8860d9c307f612829c9f44a19d0402962d
dms_commit_id=4e5c455f771c9be5e78260371eed2f28474cf253
dss_commit_id=b714d964156722f4353840c0f5bb66c92158e3c6
cbb_commit_id=7de11250903f6d5ade6deab3dc04fff6b29d0190
cbb_commit_id=ac8ed05be35754e77032b4c9ec9b1eba53f1d5a6

View File

@ -34,15 +34,19 @@ extern "C" {
#define DMS_LOCAL_MINOR_VER_WEIGHT 1000
#define DMS_LOCAL_MAJOR_VERSION 0
#define DMS_LOCAL_MINOR_VERSION 0
#define DMS_LOCAL_VERSION 160
#define DMS_LOCAL_VERSION 162
#define DMS_SUCCESS 0
#define DMS_ERROR (-1)
#ifdef OPENGAUSS
#define DMS_PAGEID_SIZE 24 // openGauss bufferTag size
#else
#define DMS_PAGEID_SIZE 16
#define DMS_PAGEID_SIZE 8
#endif
#define DMS_ALOCK_NAME_SIZE 128
#define DMS_ALOCKID_SIZE sizeof(alockid_t)
#define DMS_DRID_SIZE sizeof(dms_drid_t)
#define DMS_RESID_SIZE DMS_ALOCKID_SIZE
#define DMS_XID_SIZE 12
#define DMS_INSTANCES_SIZE 4
@ -153,34 +157,27 @@ typedef struct st_dms_drid {
struct {
unsigned long long key1;
unsigned long long key2;
unsigned int key3;
unsigned long long key3;
};
struct {
unsigned short type; // lock type
union {
unsigned short uid; // user id, for table lock resource
unsigned short len;
};
union {
struct {
unsigned int oid; // lock id
unsigned int index; // index id
unsigned int parent_part; // parent partition id
unsigned int part; // partition id
};
struct {
unsigned long long oid_64;
unsigned long long unused;
};
struct {
unsigned char resid[DMS_DRID_CTX_SIZE];
};
};
unsigned short type;
unsigned short uid;
unsigned int index;
unsigned long long oid;
unsigned int parent;
unsigned int part;
};
};
} dms_drid_t;
#pragma pack()
typedef struct st_alockid {
char name[DMS_ALOCK_NAME_SIZE];
unsigned char len;
unsigned char type;
unsigned char unused[2];
} alockid_t;
typedef enum en_drc_res_type {
DRC_RES_INVALID_TYPE,
DRC_RES_PAGE_TYPE,
@ -190,6 +187,7 @@ typedef enum en_drc_res_type {
DRC_RES_LOCAL_TXN_TYPE,
DRC_RES_LOCK_ITEM_TYPE,
DRC_RES_GLOBAL_XA_TYPE,
DRC_RES_ALOCK_TYPE,
DRC_RES_TYPE_MAX_COUNT,
} drc_res_type_e;
@ -263,9 +261,6 @@ typedef struct st_dms_cr_assist_t {
dms_cr_status_t status; /* OUT parameter */
} dms_cr_assist_t;
#define DMS_RESID_SIZE 132
#define DMS_DRID_SIZE sizeof(dms_drid_t)
typedef struct st_dms_drlock {
dms_drid_t drid;
} dms_drlock_t;
@ -620,6 +615,8 @@ typedef enum en_dms_wait_event {
DMS_EVT_DCS_REQ_XA_IN_USE,
DMS_EVT_DCS_REQ_END_XA,
DMS_EVT_REQ_CKPT,
DMS_EVT_PROC_GENERIC_REQ,
DMS_EVT_PROC_REFORM_REQ,
// add new enum at tail, or make adaptations to openGauss
DMS_EVT_COUNT,
@ -1000,6 +997,7 @@ typedef int (*dms_az_failover_promote_resetlog)(void *db_handle);
typedef int (*dms_az_failover_promote_phase2)(void *db_handle);
typedef int (*dms_check_shutdown_consistency)(void *db_handle, instance_list_t *old_remove);
typedef int (*dms_check_db_readwrite)(void *db_handle);
typedef unsigned int (*dms_check_is_maintain)();
typedef struct st_dms_callback {
// used in reform
@ -1187,6 +1185,7 @@ typedef struct st_dms_callback {
dms_get_alock_wait_info get_alock_wait_info;
dms_check_shutdown_consistency check_shutdown_consistency;
dms_check_db_readwrite check_db_readwrite;
dms_check_is_maintain check_is_maintain;
} dms_callback_t;
typedef struct st_dms_instance_net_addr {
@ -1251,6 +1250,8 @@ typedef struct st_dms_profile {
unsigned char enable_mes_task_threadpool;
unsigned int mes_task_worker_max_cnt;
unsigned int max_alive_time_for_abnormal_status;
unsigned char enable_dyn_trace;
unsigned char enable_reform_trace;
} dms_profile_t;
typedef struct st_logger_param {
@ -1347,8 +1348,6 @@ typedef struct st_dms_tlock_info {
unsigned char unused[3];
} dms_tlock_info_t;
typedef dms_tlock_info_t dms_alock_info_t;
typedef struct thread_info {
char thread_name[DMS_MAX_NAME_LEN];
void *thread_info;
@ -1359,6 +1358,12 @@ typedef struct thread_set {
int thread_count;
} thread_set_t;
typedef struct st_dms_alock_info {
alockid_t alockid;
unsigned char lock_mode;
unsigned char unused[3];
} dms_alock_info_t;
typedef struct st_driver_ping_info {
unsigned long long rw_bitmap;
dms_role_t dms_role;

View File

@ -129,6 +129,8 @@ typedef struct knl_instance_attr_dms {
bool enable_bcast_snapshot;
char* work_thread_pool_attr;
int32 work_thread_pool_max_cnt;
bool enable_dyn_trace;
bool enable_reform_trace;
} knl_instance_attr_dms;
typedef struct knl_instance_attr_storage {

View File

@ -650,6 +650,8 @@ select name,vartype,unit,min_val,max_val from pg_settings where name <> 'qunit_c
ss_enable_aio | bool | | |
ss_enable_bcast_snapshot | bool | | |
ss_enable_catalog_centralized | bool | | |
ss_enable_dynamic_trace | bool | | |
ss_enable_reform_trace | bool | | |
ss_enable_dms | bool | | |
ss_enable_dss | bool | | |
ss_enable_ondemand_realtime_build | bool | | |