【资源池化】同步DMS兼容性迭代三

This commit is contained in:
dongning12
2023-10-26 16:59:38 +08:00
parent d8bb0fc1de
commit ed7d5b628b
6 changed files with 321 additions and 71 deletions

View File

@ -1777,7 +1777,7 @@ static void AliveFailoverCleanBackends()
}
static int reform_type_str_len = 30;
static void ReformTypeToString(SSReformType reform_type, char* ret_str)
static void ReformTypeToString(dms_reform_type_t reform_type, char* ret_str)
{
switch (reform_type)
{
@ -1825,7 +1825,7 @@ static void CBReformStartNotify(void *db_handle, dms_role_t role, unsigned char
{
ss_reform_info_t *reform_info = &g_instance.dms_cxt.SSReformInfo;
reform_info->is_hashmap_constructed = false;
reform_info->reform_type = (SSReformType)reform_type;
reform_info->reform_type = (dms_reform_type_t)reform_type;
g_instance.dms_cxt.SSClusterState = NODESTATE_NORMAL;
g_instance.dms_cxt.SSRecoveryInfo.reform_ready = false;
g_instance.dms_cxt.SSRecoveryInfo.in_flushcopy = false;

View File

@ -1,3 +1,3 @@
dms_commit_id=6d6bb9bebf376b5a2570c2f89b1db7eef1361851
dms_commit_id=bf74f24da344d4cff3f48e94e8182ce0ee91cca6
dss_commit_id=73210c606146e158c9199029556638b5d50306f4
cbb_commit_id=91717a56affc3d17658e8b3dc4e3c6efa2eeea7d

View File

@ -46,6 +46,11 @@ extern "C" {
#define DMS_VERSION_MAX_LEN 256
#define DMS_OCK_LOG_PATH_LEN 256
#define DMS_LOG_PATH_LEN (256)
// The values of the following two macros must be same with (GS_MAX_XA_BASE16_GTRID_LEN GS_MAX_XA_BASE16_BQUAL_LEN)
#define DMS_MAX_XA_BASE16_GTRID_LEN (128)
#define DMS_MAX_XA_BASE16_BQUAL_LEN (128)
typedef enum en_dms_online_status {
DMS_ONLINE_STATUS_OUT = 0,
DMS_ONLINE_STATUS_JOIN = 1,
@ -133,6 +138,7 @@ typedef struct st_dms_drid {
struct {
unsigned long long key1;
unsigned long long key2;
unsigned int key3;
};
struct {
unsigned short type; // lock type
@ -154,6 +160,7 @@ typedef enum en_drc_res_type {
DRC_RES_TXN_TYPE,
DRC_RES_LOCAL_TXN_TYPE,
DRC_RES_LOCK_ITEM_TYPE,
DRC_RES_GLOBAL_XA_TYPE,
} drc_res_type_e;
typedef enum en_dms_session {
@ -163,6 +170,67 @@ typedef enum en_dms_session {
DMS_SESSION_RECOVER_HOT_STANDBY = 3, // can access DRC when pmstate = PM_HOT_STANDBY
} dms_session_e;
/*
* before construct CR page, we need to obtain the basic page,
* and rollback those unvisible transaction on the basic page's content,
* it represents where the basic page comes from.
*/
typedef enum st_dms_cr_version_t {
DMS_CR_VERSION_NONE = 0,
DMS_CR_VERSION_CURR_PAGE,
DMS_CR_VERSION_EDP_PAGE,
DMS_CR_VERSION_CR_PAGE,
} dms_cr_version_t;
/*
* CR construct state machine:
* first try to read page from local node's data buffer (DMS_CR_PHASE_TRY_READ_PAGE),
* if the current page or edp page is usable, we use it to construct CR;
* otherwise, check status from the master node (DMS_CR_PHASE_CHECK_MASTER),
* if master is remote node, the request CR to the master (DMS_CR_PHASE_REQ_MASTER),
* otherwise obtain the owner's position, the either request CR to the remote owner (DMS_CR_PHASE_REQ_OWNER),
* or trigger local node to read current page and do the CR construct (DMS_CR_PHASE_READ_PAGE);
* the master receives CR request, it will route the request to the owner,
* and the owner will do CR construct operations,
* meanwhile it will decide whether the other node needs to continue CR construct (DMS_CR_PHASE_CONSTRUCT).
* if all CR construct operations have done, the phase will be DMS_CR_PHASE_DONE.
*/
typedef enum st_dms_cr_phase_t {
DMS_CR_PHASE_TRY_READ_PAGE = 0,
DMS_CR_PHASE_CHECK_MASTER,
DMS_CR_PHASE_REQ_MASTER,
DMS_CR_PHASE_REQ_OWNER,
DMS_CR_PHASE_READ_PAGE,
DMS_CR_PHASE_CONSTRUCT,
DMS_CR_PHASE_DONE,
} dms_cr_phase_t;
typedef enum st_dms_cr_status_t {
DMS_CR_STATUS_ABORT = 0,
DMS_CR_STATUS_INVISIBLE_TXN, /* local node invisible transaction */
DMS_CR_STATUS_OTHER_NODE_INVISIBLE_TXN, /* other node invisible transaction */
DMS_CR_STATUS_PENDING_TXN, /* prepared transaction */
DMS_CR_STATUS_ALL_VISIBLE,
} dms_cr_status_t;
typedef struct st_dms_cr_assist_t {
void *handle; /* IN parameter */
unsigned long long query_scn; /* IN parameter */
unsigned int ssn; /* IN parameter */
unsigned int relay_inst; /* OUT parameter */
char *page; /* IN & OUT parameter */
char *fb_mark; /* IN & OUT parameter */
char page_id[DMS_PAGEID_SIZE]; /* IN parameter */
char curr_xid[DMS_XID_SIZE]; /* IN parameter */
char wxid[DMS_XID_SIZE]; /* OUT parameter */
char entry[DMS_PAGEID_SIZE]; /* IN parameter */
char profile[DMS_INDEX_PROFILE_SIZE]; /* IN parameter */
unsigned int check_restart; /* IN parameter */
unsigned int *check_found; /* IN & OUT parameter */
dms_cr_phase_t phase; /* OUT parameter */
dms_cr_status_t status; /* OUT parameter */
} dms_cr_assist_t;
#define DMS_RESID_SIZE 32
#define DMS_DRID_SIZE sizeof(dms_drid_t)
@ -207,6 +275,14 @@ typedef struct st_dms_process_context {
unsigned int inst_id; // current instance id
} dms_process_context_t;
typedef struct st_drc_global_xid {
unsigned long long fmt_id;
char gtrid[DMS_MAX_XA_BASE16_GTRID_LEN];
char bqual[DMS_MAX_XA_BASE16_BQUAL_LEN];
unsigned char gtrid_len;
unsigned char bqual_len;
} drc_global_xid_t;
typedef struct st_dms_context {
union {
struct {
@ -229,6 +305,7 @@ typedef struct st_dms_context {
dms_xmap_ctx_t xmap_ctx;
dms_rfn_t rfn;
unsigned char edp_inst;
drc_global_xid_t global_xid;
};
} dms_context_t;
@ -238,6 +315,8 @@ typedef struct st_dms_cr {
unsigned int ssn;
char *page;
unsigned char *fb_mark;
dms_cr_status_t status;
dms_cr_phase_t phase;
} dms_cr_t;
typedef struct st_dms_opengauss_xid_csn {
@ -311,7 +390,6 @@ typedef struct st_dms_broadcast_context {
unsigned int len;
char *output_msg;
unsigned int *output_msg_len;
unsigned int msg_version;
} dms_broadcast_context_t;
typedef struct st_dms_buf_ctrl {
@ -324,6 +402,7 @@ typedef struct st_dms_buf_ctrl {
volatile unsigned char need_flush; // for recovery, owner is abort, copy instance should flush before release
volatile unsigned char been_loaded; // first alloc ctrl:FALSE, after successfully loaded: TRUE
volatile unsigned char in_rcy; // if drc lost, we can rebuild in_recovery flag according buf_ctrl
volatile unsigned char break_wal;
unsigned long long edp_scn; // set when become edp, lastest scn when page becomes edp
unsigned long long edp_map; // records edp instance
long long last_ckpt_time; // last time when local edp page is added to group.
@ -376,18 +455,6 @@ typedef enum en_dms_buf_load_status {
DMS_BUF_NEED_TRANSFER = 0x04, // used only in DTC, means need ask master/coordinator for latest version
} dms_buf_load_status_t;
typedef enum en_dms_cr_status {
DMS_CR_TRY_READ = 0,
DMS_CR_LOCAL_READ,
DMS_CR_READ_PAGE,
DMS_CR_READ_EDP_PAGE,
DMS_CR_CONSTRUCT,
DMS_CR_PAGE_VISIBLE,
DMS_CR_CHECK_MASTER,
DMS_CR_REQ_MASTER,
DMS_CR_REQ_OWNER,
} dms_cr_status_t;
typedef enum en_dms_log_level {
DMS_LOG_LEVEL_ERROR = 0, // error conditions
DMS_LOG_LEVEL_WARN, // warning conditions
@ -475,6 +542,8 @@ typedef enum en_dms_wait_event {
DMS_EVT_TXN_REQ_SNAPSHOT,
DMS_EVT_DLS_REQ_LOCK,
DMS_EVT_DLS_REQ_TABLE,
DMS_EVT_DLS_REQ_PART_X,
DMS_EVT_DLS_REQ_PART_S,
DMS_EVT_DLS_WAIT_TXN,
DMS_EVT_DEAD_LOCK_TXN,
DMS_EVT_DEAD_LOCK_TABLE,
@ -489,7 +558,11 @@ typedef enum en_dms_wait_event {
DMS_EVT_ONDEMAND_REDO,
DMS_EVT_PAGE_STATUS_INFO,
DMS_EVT_OPENGAUSS_SEND_XMIN,
DMS_EVT_DCS_REQ_CREATE_XA_RES,
DMS_EVT_DCS_REQ_DELETE_XA_RES,
DMS_EVT_DCS_REQ_XA_OWNER_ID,
DMS_EVT_DCS_REQ_XA_IN_USE,
DMS_EVT_DCS_REQ_END_XA,
DMS_EVT_COUNT,
} dms_wait_event_t;
@ -520,6 +593,28 @@ typedef enum en_reform_phase {
DMS_PHASE_END = 5,
} reform_phase_t;
typedef enum en_dms_reform_type {
// for multi_write
DMS_REFORM_TYPE_FOR_NORMAL = 0,
// for Gauss100
DMS_REFORM_TYPE_FOR_BUILD,
DMS_REFORM_TYPE_FOR_FAILOVER,
DMS_REFORM_TYPE_FOR_SWITCHOVER,
// for openGauss
DMS_REFORM_TYPE_FOR_NORMAL_OPENGAUSS,
DMS_REFORM_TYPE_FOR_FAILOVER_OPENGAUSS,
DMS_REFORM_TYPE_FOR_SWITCHOVER_OPENGAUSS,
// common
DMS_REFORM_TYPE_FOR_FULL_CLEAN, // for all instances are online and stable, and all instances status is IN
DMS_REFORM_TYPE_FOR_MAINTAIN, // for start database without CM, every instance is supported
// New type need to be added start from here
DMS_REFORM_TYPE_FOR_RST_RECOVER,
DMS_REFORM_TYPE_COUNT
} dms_reform_type_t;
typedef enum en_dms_status {
DMS_STATUS_OUT = 0,
DMS_STATUS_JOIN = 1,
@ -581,6 +676,11 @@ typedef struct st_stat_drc_info {
char data[DMS_RESID_SIZE]; /* user defined resource(page) identifier */
} stat_drc_info_t;
typedef enum en_broadcast_scope {
DMS_BROADCAST_OLDIN_LIST = 0, // default value
DMS_BROADCAST_ONLINE_LIST = 1,
} dms_broadcast_scope_e;
typedef int(*dms_get_list_stable)(void *db_handle, unsigned long long *list_stable, unsigned char *reformer_id);
typedef int(*dms_save_list_stable)(void *db_handle, unsigned long long list_stable, unsigned char reformer_id,
unsigned long long list_in, unsigned int save_ctrl);
@ -592,11 +692,13 @@ typedef int(*dms_confirm_owner)(void *db_handle, char *pageid, unsigned char *lo
unsigned long long *lsn);
typedef int(*dms_flush_copy)(void *db_handle, char *pageid);
typedef int(*dms_need_flush)(void *db_handle, char *pageid);
typedef int(*dms_edp_to_owner)(void *db_handle, char *pageid);
typedef int(*dms_edp_lsn)(void *db_handle, char *pageid, unsigned long long *lsn);
typedef int(*dms_disk_lsn)(void *db_handle, char *pageid, unsigned long long *lsn);
typedef int(*dms_recovery)(void *db_handle, void *recovery_list, int is_reformer);
typedef int(*dms_recovery)(void *db_handle, void *recovery_list, int reform_type, int is_reformer);
typedef int(*dms_recovery_analyse)(void *db_handle, void *recovery_list, int is_reformer);
typedef int(*dms_dw_recovery)(void *db_handle, void *recovery_list, int is_reformer);
typedef int(*dms_df_recovery)(void *db_handle);
typedef int(*dms_df_recovery)(void *db_handle, unsigned long long list_in, void *recovery_list);
typedef int(*dms_opengauss_startup)(void *db_handle);
typedef int(*dms_opengauss_recovery_standby)(void *db_handle, int inst_id);
typedef int(*dms_opengauss_recovery_primary)(void *db_handle, int inst_id);
@ -605,6 +707,7 @@ typedef void(*dms_reform_start_notify)(void *db_handle, dms_role_t role, unsigne
typedef int(*dms_undo_init)(void *db_handle, unsigned char inst_id);
typedef int(*dms_tx_area_init)(void *db_handle, unsigned char inst_id);
typedef int(*dms_tx_area_load)(void *db_handle, unsigned char inst_id);
typedef int(*dms_convert_to_readwrite)(void *db_handle);
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]);
@ -631,28 +734,15 @@ typedef char *(*dms_get_page)(dms_buf_ctrl_t *buf_ctrl);
typedef int (*dms_invalidate_page)(void *db_handle, char pageid[DMS_PAGEID_SIZE], unsigned char invld_owner);
typedef void *(*dms_get_db_handle)(unsigned int *db_handle_index, dms_session_type_e session_type);
typedef void (*dms_release_db_handle)(void *db_handle);
typedef void *(*dms_stack_push_cr_cursor)(void *db_handle);
typedef void (*dms_stack_pop_cr_cursor)(void *db_handle);
typedef int(*dms_init_cr_cursor)(void *cr_cursor, char pageid[DMS_PAGEID_SIZE], char xid[DMS_XID_SIZE],
unsigned long long query_scn, unsigned int ssn);
typedef void(*dms_init_index_cr_cursor)(void *cr_cursor, char pageid[DMS_PAGEID_SIZE], char xid[DMS_XID_SIZE],
unsigned long long query_scn, unsigned int ssn, char entry[DMS_PAGEID_SIZE], char *index_profile);
typedef void(*dms_init_check_cr_cursor)(void *cr_cursor, char rowid[DMS_ROWID_SIZE], char xid[DMS_XID_SIZE],
unsigned long long query_scn, unsigned int ssn);
typedef char *(*dms_get_wxid_from_cr_cursor)(void *cr_cursor);
typedef unsigned char(*dms_get_instid_of_xid_from_cr_cursor)(void *db_handle, void *cr_cursor);
typedef int(*dms_get_page_invisible_txn_list)(void *db_handle, void *cr_cursor, void *cr_page,
unsigned char *is_empty_txn_list, unsigned char *exist_waiting_txn);
typedef int(*dms_reorganize_heap_page_with_undo)(void *db_handle, void *cr_cursor, void *cr_page,
unsigned char *fb_mark);
typedef int(*dms_reorganize_index_page_with_undo)(void *db_handle, void *cr_cursor, void *cr_page);
typedef int(*dms_check_heap_page_visible_with_undo_snapshot)(void *db_handle, void *cr_cursor, void *page,
unsigned char *is_found);
typedef void(*dms_set_page_force_request)(void *db_handle, char pageid[DMS_PAGEID_SIZE]);
typedef void(*dms_get_entry_pageid_from_cr_cursor)(void *cr_cursor, char index_entry_pageid[DMS_PAGEID_SIZE]);
typedef void(*dms_get_index_profile_from_cr_cursor)(void *cr_cursor, char index_profile[DMS_INDEX_PROFILE_SIZE]);
typedef void(*dms_get_xid_from_cr_cursor)(void *cr_cursor, char xid[DMS_XID_SIZE]);
typedef void(*dms_get_rowid_from_cr_cursor)(void *cr_cursor, char rowid[DMS_ROWID_SIZE]);
typedef int (*dms_heap_construct_cr_page)(dms_cr_assist_t *pcr);
typedef int (*dms_btree_construct_cr_page)(dms_cr_assist_t *pcr);
typedef int (*dms_check_heap_page_visible)(dms_cr_assist_t *pcr);
typedef int(*dms_read_page)(void *db_handle, dms_read_page_assist_t *assist, char **page_addr, unsigned int *status);
typedef void(*dms_leave_page)(void *db_handle, unsigned char changed, unsigned int status);
typedef char *(*dms_mem_alloc)(void *context, unsigned int size);
@ -698,6 +788,8 @@ 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);
typedef void (*dms_reset_user)(void *db_handle, unsigned long long list_in);
typedef int (*dms_drc_xa_res_rebuild)(void *db_handle, unsigned char thread_index, unsigned char parall_num);
typedef void (*dms_reform_shrink_xa_rms)(unsigned char undo_seg_id);
// for openGauss
typedef void (*dms_thread_init_t)(unsigned char need_startup, char **reg_data);
@ -740,7 +832,10 @@ typedef int (*dms_update_node_oldest_xmin)(void *db_handle, unsigned char inst_i
typedef void (*dms_set_inst_behavior)(void *db_handle, dms_inst_behavior_t inst_behavior);
typedef int (*dms_db_prepare)(void *db_handle);
typedef void (*dms_get_buf_info)(char* resid, stat_buf_info_t *buf_info);
typedef int (*dms_end_xa)(void *db_handle, void *knl_xa_xid, unsigned long long flags, unsigned long long scn,
unsigned char is_commit);
typedef unsigned char (*dms_xa_inuse)(void *db_handle, void *knl_xa_xid);
typedef int (*dms_get_part_changed)(void *db_handle, char* resid);
typedef struct st_dms_callback {
// used in reform
dms_get_list_stable get_list_stable;
@ -751,10 +846,11 @@ typedef struct st_dms_callback {
dms_confirm_converting confirm_converting;
dms_flush_copy flush_copy;
dms_need_flush need_flush;
dms_edp_to_owner edp_to_owner;
dms_edp_lsn edp_lsn;
dms_disk_lsn disk_lsn;
dms_recovery recovery;
dms_recovery recovery_analyse;
dms_recovery_analyse recovery_analyse;
dms_dw_recovery dw_recovery;
dms_df_recovery df_recovery;
dms_db_is_primary db_is_primary;
@ -762,6 +858,7 @@ typedef struct st_dms_callback {
dms_undo_init undo_init;
dms_tx_area_init tx_area_init;
dms_tx_area_load tx_area_load;
dms_convert_to_readwrite convert_to_readwrite;
dms_tx_rollback_finish tx_rollback_finish;
dms_recovery_in_progress recovery_in_progress;
dms_drc_buf_res_rebuild dms_reform_rebuild_buf_res;
@ -770,6 +867,8 @@ typedef struct st_dms_callback {
dms_check_if_build_complete check_if_build_complete;
dms_check_if_restore_recover check_if_restore_recover;
dms_reset_user reset_user;
dms_drc_xa_res_rebuild dms_reform_rebuild_xa_res;
dms_reform_shrink_xa_rms dms_shrink_xa_rms;
// used in reform for opengauss
dms_thread_init_t dms_thread_init;
@ -802,23 +901,15 @@ typedef struct st_dms_callback {
dms_invalidate_page invalidate_page;
dms_get_db_handle get_db_handle;
dms_release_db_handle release_db_handle;
dms_stack_push_cr_cursor stack_push_cr_cursor;
dms_stack_pop_cr_cursor stack_pop_cr_cursor;
dms_init_cr_cursor init_heap_cr_cursor;
dms_init_index_cr_cursor init_index_cr_cursor;
dms_init_check_cr_cursor init_check_cr_cursor;
dms_get_wxid_from_cr_cursor get_wxid_from_cr_cursor;
dms_get_instid_of_xid_from_cr_cursor get_instid_of_xid_from_cr_cursor;
dms_get_page_invisible_txn_list get_heap_invisible_txn_list;
dms_get_page_invisible_txn_list get_index_invisible_txn_list;
dms_reorganize_heap_page_with_undo reorganize_heap_page_with_undo;
dms_reorganize_index_page_with_undo reorganize_index_page_with_undo;
dms_check_heap_page_visible_with_undo_snapshot check_heap_page_visible_with_udss;
dms_set_page_force_request set_page_force_request;
dms_get_entry_pageid_from_cr_cursor get_entry_pageid_from_cr_cursor;
dms_get_index_profile_from_cr_cursor get_index_profile_from_cr_cursor;
dms_get_xid_from_cr_cursor get_xid_from_cr_cursor;
dms_get_rowid_from_cr_cursor get_rowid_from_cr_cursor;
dms_heap_construct_cr_page heap_construct_cr_page;
dms_btree_construct_cr_page btree_construct_cr_page;
dms_check_heap_page_visible check_heap_page_visible;
dms_read_page read_page;
dms_leave_page leave_page;
dms_verify_page verify_page;
@ -887,6 +978,9 @@ typedef struct st_dms_callback {
dms_db_prepare db_prepare;
dms_get_buf_info get_buf_info;
dms_end_xa end_xa;
dms_xa_inuse xa_inuse;
dms_get_part_changed get_part_changed;
} dms_callback_t;
typedef struct st_dms_instance_net_addr {
@ -958,20 +1052,11 @@ typedef enum en_dms_info_id {
DMS_INFO_REFORM_LAST = 1,
} dms_info_id_e;
typedef enum st_dms_protocol_version {
DMS_PROTO_VER_0 = 0, // invalid version
DMS_PROTO_VER_1 = 1, // first version
} dms_protocol_version_e;
#define DMS_INVALID_PROTO_VER DMS_PROTO_VER_0
#define DMS_SW_PROTO_VER DMS_PROTO_VER_1
#define DMS_LOCAL_MAJOR_VER_WEIGHT 1000000
#define DMS_LOCAL_MINOR_VER_WEIGHT 1000
#define DMS_LOCAL_MAJOR_VERSION 0
#define DMS_LOCAL_MINOR_VERSION 0
#define DMS_LOCAL_VERSION 95
#define DMS_LOCAL_VERSION 104
#ifdef __cplusplus
}
#endif

View File

@ -0,0 +1,177 @@
/*
* Copyright (c) 2022 Huawei Technologies Co.,Ltd.
*
* DMS is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
*
* http://license.coscl.org.cn/MulanPSL2
*
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
* -------------------------------------------------------------------------
*
* dms_error.h
*
*
* IDENTIFICATION
* src/common/dms_error.h
*
* -------------------------------------------------------------------------
*/
#ifndef __DMS_ERROR_H__
#define __DMS_ERROR_H__
#ifdef __cplusplus
extern "C" {
#endif
/* ****BEGIN error code definition of dms common 10001 ~ 11000 **** */
enum en_errno_dms_common {
ERRNO_DMS_COMMON_BASE = 10000,
/* add new errno below */
ERRNO_DMS_SECUREC_CHECK_FAIL = 10001,
ERRNO_DMS_COMMON_MSG_ACK = 10002,
ERRNO_DMS_PARAM_NULL = 10003,
ERRNO_DMS_CMD_INVALID = 10004,
ERRNO_DMS_ALLOC_FAILED = 10005,
ERRNO_DMS_PARAM_INVALID = 10007,
ERRNO_DMS_CAPABILITY_NOT_SUPPORT = 10008,
ERRNO_DMS_COMMON_COPY_PAGEID_FAIL = 10009,
ERRNO_DMS_SEND_MSG_FAILED = 10010,
ERRNO_DMS_RECV_MSG_FAILED = 10011,
ERRNO_DMS_COMMON_CBB_FAILED = 10012,
ERRNO_DMS_MFC_NO_TICKETS = 10013,
ERRNO_DMS_MES_INVALID_MSG = 10014,
ERRNO_DMS_INIT_LOG_FAILED = 10016,
ERRNO_DMS_PROTOCOL_VERSION_NOT_MATCH = 10017,
ERRNO_DMS_PROTOCOL_VERSION_NOT_SUPPORT = 10018,
/* add new errno above */
ERRNO_DMS_COMMON_END
};
#define ERRNO_DMS_COMMON_INDEX(x) ((x) - ERRNO_DMS_COMMON_BASE)
#define ERRNO_IS_DMS_COMMON(x) ((x) > ERRNO_DMS_COMMON_BASE && (x) < ERRNO_DMS_COMMON_END)
/* BEGIN error code definition of dms dcs 11001 ~ 13000 **** */
enum en_errno_dms_dcs {
ERRNO_DMS_DCS_BASE = 11000,
/* add new errno below */
ERRNO_DMS_DCS_PAGE_MASTER_ID = 11001,
ERRNO_DMS_DCS_MSG_EAGAIN = 11002,
ERRNO_DMS_DCS_READ_LOCAL_PAGE = 11003,
ERRNO_DMS_DCS_BROADCAST_FAILED = 11004,
ERRNO_DMS_DCS_GET_TXN_INFO_FAILED = 11005,
ERRNO_DMS_DCS_GET_TXN_SNAPSHOT_FAILED = 11006,
ERRNO_DMS_DCS_SEND_EDP_FAILED = 11007,
ERRNO_DMS_DCS_GET_UPDATE_XID_FAILED = 11009,
ERRNO_DMS_DCS_GET_TXN_STATUS_FAILED = 11011,
ERRNO_DMS_DCS_GET_XID_CSN_FAILED = 11012,
ERRNO_DMS_DCS_LOCK_BUFFER_FAILED = 11013,
ERRNO_DMS_DCS_GET_PAGE_IN_BUFFER_FAILED = 11014,
ERRNO_DMS_DCS_PAGE_CHECKSUM_FAILED = 11015,
/* add new errno above */
ERRNO_DMS_DCS_END
};
#define ERRNO_DMS_DCS_INDEX(x) ((x) - ERRNO_DMS_DCS_BASE)
#define ERRNO_IS_DMS_DCS(x) ((x) > ERRNO_DMS_DCS_BASE && (x) < ERRNO_DMS_DCS_END)
/* ****BEGIN errror code definition of dms drc 13001 ~ 15000 **** */
enum en_errno_dms_drc {
ERRNO_DMS_DRC_BASE = 13000,
/* add new errno below */
ERRNO_DMS_DRC_RES_SIZE_TOO_SMALL = 13001,
ERRNO_DMS_DRC_REQ_OWNER_TYPE_NOT_EXPECT = 13002,
ERRNO_DMS_DRC_PAGE_POOL_CAPACITY_NOT_ENOUGH = 13003,
ERRNO_DMS_DRC_ENQ_ITEM_CAPACITY_NOT_ENOUGH = 13004,
ERRNO_DMS_DRC_PAGE_NOT_FOUND = 13005,
ERRNO_DMS_DRC_LOCK_ABANDON_TRY = 13009,
ERRNO_DMS_DRC_PAGE_MASTER_NOT_FOUND = 13012,
ERRNO_DMS_DRC_CONFLICT_WITH_OTHER_REQER = 13013,
ERRNO_DMS_DRC_RECOVERY_PAGE = 13016,
ERRNO_DMS_DRC_LOCK_STATUS_FAIL = 13017,
ERRNO_DMS_DRC_INVALID_REPEAT_REQUEST = 13018,
ERRNO_DMS_DRC_INVALID = 13020,
ERRNO_DMS_DRC_IS_RECYCLING = 13021,
ERRNO_DMS_DRC_XA_MASTER_NOT_FOUND = 13022,
ERRNO_DMS_DRC_XA_POOL_CAPACITY_NOT_ENOUGH = 13023,
ERRNO_DMS_DRC_XA_RES_ALREADY_EXISTS = 13024,
ERRNO_DMS_DRC_XA_RES_NOT_EXISTS = 13025,
/* add new errno above */
ERRNO_DMS_DRC_END
};
#define ERRNO_DMS_DRC_INDEX(x) ((x) - ERRNO_DMS_DRC_BASE)
#define ERRNO_IS_DMS_DRC(x) ((x) > ERRNO_DMS_DRC_BASE && (x) < ERRNO_DMS_DRC_END)
/* ****BEGIN error code definition of dms dls 15001 ~ 16000 **** */
enum en_errno_dms_dls {
ERRNO_DMS_DLS_BASE = 15000,
/* add new errno below */
ERRNO_DMS_DLS_TRY_RELEASE_LOCK_FAILED = 15001,
ERRNO_DMS_DLS_TRY_LOCK_FAILED = 15002,
/* add new errno above */
ERRNO_DMS_DLS_END
};
#define ERRNO_DMS_DLS_INDEX(x) ((x) - ERRNO_DMS_DLS_BASE)
#define ERRNO_IS_DMS_DLS(x) ((x) > ERRNO_DMS_DLS_BASE && (x) < ERRNO_DMS_DLS_END)
/* ****BEGIN error code definition of dms callback function 16001 ~ 17000 **** */
enum en_errno_dms_cb {
ERRNO_DMS_CALLBACK_BASE = 16000,
/* add new errno below */
ERRNO_DMS_CALLBACK_ALLOC_CR_CURSOR = 16001,
ERRNO_DMS_CALLBACK_GET_HEAP_INVISIBLE_TXN_LIST = 16002,
ERRNO_DMS_CALLBACK_GET_INDEX_INVISIBLE_TXN_LIST = 16003,
ERRNO_DMS_CALLBACK_REORGANIZE_HEAP_PAGE_WITH_UNDO = 16004,
ERRNO_DMS_CALLBACK_REORGANIZE_INDEX_PAGE_WITH_UNDO = 16005,
ERRNO_DMS_CALLBACK_READ_PAGE = 16006,
ERRNO_DMS_CALLBACK_STACK_PUSH = 16008,
ERRNO_DMS_CALLBACK_RC_UNDO_INIT = 16009,
ERRNO_DMS_CALLBACK_RC_TX_AREA_INIT = 16010,
ERRNO_DMS_CALLBACK_RC_TX_AREA_LOAD = 16011,
ERRNO_DMS_CALLBACK_GET_DB_HANDLE = 16012,
/* add new errno above */
ERRNO_DMS_CALLBACK_END
};
#define ERRNO_DMS_CB_INDEX(x) ((x) - ERRNO_DMS_CALLBACK_BASE)
#define ERRNO_IS_DMS_CB(x) ((x) > ERRNO_DMS_CALLBACK_BASE && (x) < ERRNO_DMS_CALLBACK_END)
/* ****BEGIN error code definition of rc function 17001 ~ 18000 **** */
enum en_errno_dms_reform {
ERRNO_DMS_REFORM_BASE = 17000,
/* add new errno below */
ERRNO_DMS_REFORM_SWITCHOVER_NOT_FINISHED = 17002,
ERRNO_DMS_REFORM_FAIL_GET_STAT_LIST = 17003,
ERRNO_DMS_REFORM_SWITCHOVER_NOT_REFORMER = 17004,
ERRNO_DMS_REFORM_NOT_FINISHED = 17005,
ERRNO_DMS_REFORM_SAVE_LIST_STABLE_FAILED = 17006,
ERRNO_DMS_REFORM_FAIL = 17007,
ERRNO_DMS_REFORM_IN_PROCESS = 17008,
ERRNO_DMS_REFORM_GET_LOCK_FAILED = 17009,
/* add new errno above */
ERRNO_DMS_REFORM_END
};
#define ERRNO_DMS_REFORM_INDEX(x) ((x) - ERRNO_DMS_REFORM_BASE)
#define ERRNO_IS_DMS_REFORM(x) ((x) > ERRNO_DMS_REFORM_BASE && (x) < ERRNO_DMS_REFORM_END)
#ifdef __cplusplus
}
#endif
#endif /* __DMS_ERROR_H__ */

View File

@ -179,18 +179,6 @@ typedef struct SSBroadcastCmdOnly {
SSBroadcastOp type; // must be first
} SSBroadcastCmdOnly;
typedef enum SSReformType {
DMS_REFORM_TYPE_FOR_NORMAL = 0,
DMS_REFORM_TYPE_FOR_BUILD,
DMS_REFORM_TYPE_FOR_FAILOVER,
DMS_REFORM_TYPE_FOR_SWITCHOVER,
DMS_REFORM_TYPE_FOR_NORMAL_OPENGAUSS,
DMS_REFORM_TYPE_FOR_FAILOVER_OPENGAUSS,
DMS_REFORM_TYPE_FOR_SWITCHOVER_OPENGAUSS,
DMS_REFORM_TYPE_FOR_FULL_CLEAN,
DMS_REFORM_TYPE_FOR_MAINTAIN
} SSReformType;
typedef enum SSGlobalClusterState {
CLUSTER_IN_ONDEMAND_BUILD = 0,
CLUSTER_IN_ONDEMAND_REDO,

View File

@ -62,7 +62,7 @@ typedef struct st_reformer_ctrl {
typedef struct st_reform_info {
bool in_reform;
dms_role_t dms_role;
SSReformType reform_type;
dms_reform_type_t reform_type;
unsigned long long bitmap_nodes;
timeval reform_start_time;
timeval reform_end_time;