diff --git a/src/gausskernel/ddes/adapter/ss_dms_callback.cpp b/src/gausskernel/ddes/adapter/ss_dms_callback.cpp index 2a7a04b92663ed49a3d3fe76fcbf429791b059f8..66dbc94fbc18aec1d30dabe97216142747bc6abc 100644 --- a/src/gausskernel/ddes/adapter/ss_dms_callback.cpp +++ b/src/gausskernel/ddes/adapter/ss_dms_callback.cpp @@ -497,6 +497,11 @@ static void ReleaseResource() FlushErrorState(); } +static unsigned int CBIncAndGetSrsn(uint32 sessid) +{ + return ++t_thrd.dms_cxt.srsn; +} + static unsigned int CBPageHashCode(const char pageid[DMS_PAGEID_SIZE]) { BufferTag *tag = (BufferTag *)pageid; @@ -2066,6 +2071,7 @@ void DmsInitCallback(dms_callback_t *callback) callback->reform_set_dms_role = CBReformSetDmsRole; callback->opengauss_ondemand_redo_buffer = CBOndemandRedoPageForStandby; + callback->inc_and_get_srsn = CBIncAndGetSrsn; callback->get_page_hash_val = CBPageHashCode; callback->read_local_page4transfer = CBEnterLocalPage; callback->leave_local_page = CBLeaveLocalPage; diff --git a/src/gausskernel/ddes/adapter/ss_init.cpp b/src/gausskernel/ddes/adapter/ss_init.cpp index 4c84acae2e1dd0861be0c0f014a406637b42feb7..f4ca57d786e48dd04f4f2b5a25415684bc36dc67 100644 --- a/src/gausskernel/ddes/adapter/ss_init.cpp +++ b/src/gausskernel/ddes/adapter/ss_init.cpp @@ -12,11 +12,11 @@ * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. * See the Mulan PSL v2 for more details. * --------------------------------------------------------------------------------------- - * + * * ss_init.cpp * initialize for DMS shared storage. - * - * + * + * * IDENTIFICATION * src/gausskernel/ddes/adapter/ss_init.cpp * @@ -302,7 +302,7 @@ static void setScrlConfig(dms_profile_t *profile) // server bind (void)setBindCoreConfig(dms_attr->scrlock_server_bind_core_config, &profile->scrlock_server_bind_core_start, &profile->scrlock_server_bind_core_end); - + // worker bind if (setBindCoreConfig(dms_attr->scrlock_worker_bind_core_config, &profile->scrlock_worker_bind_core_start, &profile->scrlock_worker_bind_core_end)) { @@ -375,7 +375,6 @@ static void setDMSProfile(dms_profile_t* profile) SetOckLogPath(dms_attr, profile->ock_log_path); profile->inst_map = 0; profile->enable_reform = (unsigned char)dms_attr->enable_reform; - profile->load_balance_mode = 1; /* primary-standby */ profile->parallel_thread_num = dms_attr->parallel_thread_num; profile->max_wait_time = DMS_MSG_MAX_WAIT_TIME; diff --git a/src/gausskernel/ddes/ddes_commit_id b/src/gausskernel/ddes/ddes_commit_id index 8dafe7b09a7ccbb719d320c4345164515cd4ea27..6f5522f0ecf30ea3ff1f7d184a7bb7518e53f3fb 100644 --- a/src/gausskernel/ddes/ddes_commit_id +++ b/src/gausskernel/ddes/ddes_commit_id @@ -1,3 +1,3 @@ -dms_commit_id=d7095d9b169a766461b00aa4bc0e19b4fc8ea657 -dss_commit_id=0a759717486f91cc91b19ca6b0cf0d2e48f08fcb -cbb_commit_id=a8ac49e215cfe26098416b44721fe76eaca2bc1d \ No newline at end of file +dms_commit_id=1f1cacdc3285a8b43b1e73f0f439f79dda7630d0 +dss_commit_id=a4d52e326a5291ca1ef8d2d22993a561f13f45a8 +cbb_commit_id=a7f55f6371988695578304bfbd3450f6f31c6630 \ No newline at end of file diff --git a/src/include/ddes/dms/dms_api.h b/src/include/ddes/dms/dms_api.h index 03bd86b2df2dd512d038ef0eb498afd6300b7dd5..17d4437537f21f0dd7180012336606e9ad6378d1 100644 --- a/src/include/ddes/dms/dms_api.h +++ b/src/include/ddes/dms/dms_api.h @@ -221,6 +221,7 @@ typedef struct st_dms_context { unsigned char is_try; unsigned char type; unsigned short len; + unsigned long long ctx_ruid; /* this ruid indicates one message ack is pending recv */ union { char resid[DMS_RESID_SIZE]; dms_drid_t lock_id; @@ -607,6 +608,7 @@ typedef int(*dms_tx_area_load)(void *db_handle, unsigned char inst_id); typedef int(*dms_tx_rollback_finish)(void *db_handle, unsigned char inst_id); typedef unsigned char(*dms_recovery_in_progress)(void *db_handle); typedef unsigned int(*dms_get_page_hash_val)(const char pageid[DMS_PAGEID_SIZE]); +typedef unsigned int(*dms_inc_and_get_srsn)(unsigned int sess_id); typedef unsigned long long(*dms_get_page_lsn)(const dms_buf_ctrl_t *buf_ctrl); typedef int(*dms_set_buf_load_status)(dms_buf_ctrl_t *buf_ctrl, dms_buf_load_status_t dms_buf_load_status); typedef int(*dms_remove_buf_load_status)(dms_buf_ctrl_t *buf_ctrl, dms_buf_load_status_t dms_buf_load_status); @@ -691,7 +693,6 @@ typedef void (*dms_check_if_build_complete)(void *db_handle, unsigned int *build typedef void (*dms_check_if_restore_recover)(void *db_handle, unsigned int *rst_recover); typedef int (*dms_db_is_primary)(void *db_handle); typedef void (*dms_set_switchover_result)(void *db_handle, int result); -typedef void (*dms_set_db_role)(void *db_handle, unsigned char is_primary); typedef int (*dms_mount_to_recovery)(void *db_handle, unsigned int *has_offline); typedef int(*dms_get_open_status)(void *db_handle); typedef void (*dms_reform_set_dms_role)(void *db_handle, unsigned int reformer_id); @@ -779,6 +780,7 @@ typedef struct st_dms_callback { dms_reform_start_notify reform_start_notify; dms_reform_set_dms_role reform_set_dms_role; + dms_inc_and_get_srsn inc_and_get_srsn; dms_get_page_hash_val get_page_hash_val; dms_get_page_lsn get_page_lsn; dms_set_buf_load_status set_buf_load_status; @@ -862,7 +864,6 @@ typedef struct st_dms_callback { dms_switchover_promote_opengauss switchover_promote_opengauss; dms_failover_promote_opengauss failover_promote_opengauss; dms_set_switchover_result set_switchover_result; - dms_set_db_role set_db_role; dms_mount_to_recovery mount_to_recovery; dms_reform_done_notify reform_done_notify; @@ -887,6 +888,7 @@ typedef struct st_dms_callback { } dms_callback_t; typedef struct st_dms_instance_net_addr { + unsigned int inst_id; char ip[DMS_MAX_IP_LEN]; unsigned short port; unsigned char reserved[2]; @@ -912,9 +914,8 @@ typedef struct st_dms_profile { // Indicates whether to connected to other instances during DMS initialization. unsigned int conn_created_during_init : 1; unsigned int resource_catalog_centralized : 1; // 1: centralized, 0: distributed - unsigned int load_balance_mode : 1; // 1: primary&standby unsigned int time_stat_enabled : 1; - unsigned int reserved : 28; + unsigned int reserved : 29; unsigned int elapsed_switch; unsigned char rdma_rpc_use_busypoll; // busy poll need to occupy the cpu core unsigned char rdma_rpc_is_bind_core; @@ -925,7 +926,7 @@ typedef struct st_dms_profile { // ock scrlock configs unsigned char enable_scrlock; unsigned int primary_inst_id; - unsigned char enable_ssl; + unsigned char enable_ssl; unsigned int scrlock_log_level; unsigned char enable_scrlock_worker_bind_core; unsigned int scrlock_worker_cnt; @@ -967,7 +968,7 @@ typedef enum st_dms_protocol_version { #define DMS_LOCAL_MINOR_VER_WEIGHT 1000 #define DMS_LOCAL_MAJOR_VERSION 0 #define DMS_LOCAL_MINOR_VERSION 0 -#define DMS_LOCAL_VERSION 92 +#define DMS_LOCAL_VERSION 94 #ifdef __cplusplus } diff --git a/src/include/knl/knl_thread.h b/src/include/knl/knl_thread.h index e35361a50fd3f55a83fc63687e8e095b0d98b799..bba36f6dd234667b1d9a057a68a8f76c1e8f0454 100755 --- a/src/include/knl/knl_thread.h +++ b/src/include/knl/knl_thread.h @@ -3393,6 +3393,7 @@ typedef struct knl_t_dms_context { bool flush_copy_get_page_failed; //used in flush copy HTAB* SSTxnStatusHash; LRUQueue* SSTxnStatusLRU; + uint32 srsn; /* session rsn used for DMS page request ordering */ } knl_t_dms_context; typedef struct knl_t_ondemand_xlog_copy_context {