MXS-2013 Remove skygw_chk_t

This commit is contained in:
Johan Wikman
2018-08-14 14:57:06 +03:00
parent bdb7481357
commit 8fd1648217
20 changed files with 0 additions and 231 deletions

View File

@ -62,14 +62,8 @@ enum user_type
*/ */
typedef struct admin_session typedef struct admin_session
{ {
#if defined(SS_DEBUG)
skygw_chk_t adminses_chk_top;
#endif
char user[ADMIN_USER_MAXLEN + 1]; /*< username */ char user[ADMIN_USER_MAXLEN + 1]; /*< username */
bool validated; /* Was user validated? */ bool validated; /* Was user validated? */
#if defined(SS_DEBUG)
skygw_chk_t adminses_chk_tail;
#endif
} ADMIN_session; } ADMIN_session;
void admin_users_init(); void admin_users_init();

View File

@ -132,7 +132,6 @@ typedef enum
typedef struct dcb typedef struct dcb
{ {
MXS_POLL_DATA poll; MXS_POLL_DATA poll;
skygw_chk_t dcb_chk_top;
bool dcb_errhandle_called; /*< this can be called only once */ bool dcb_errhandle_called; /*< this can be called only once */
dcb_role_t dcb_role; dcb_role_t dcb_role;
int fd; /**< The descriptor */ int fd; /**< The descriptor */
@ -185,7 +184,6 @@ typedef struct dcb
} thread; } thread;
uint32_t n_close; /** How many times dcb_close has been called. */ uint32_t n_close; /** How many times dcb_close has been called. */
char *path; /** If a Unix socket, the path it was bound to. */ char *path; /** If a Unix socket, the path it was bound to. */
skygw_chk_t dcb_chk_tail;
} DCB; } DCB;
/** /**

View File

@ -51,43 +51,6 @@ MXS_BEGIN_DECLS
#define CHK_NUM_BASE 101 #define CHK_NUM_BASE 101
typedef enum skygw_chk_t
{
CHK_NUM_SLIST = CHK_NUM_BASE,
CHK_NUM_SLIST_NODE,
CHK_NUM_SLIST_CURSOR,
CHK_NUM_MLIST,
CHK_NUM_MLIST_NODE,
CHK_NUM_MLIST_CURSOR,
CHK_NUM_QUERY_TEST,
CHK_NUM_LOGFILE,
CHK_NUM_FILEWRITER,
CHK_NUM_THREAD,
CHK_NUM_SIMPLE_MUTEX,
CHK_NUM_MESSAGE,
CHK_NUM_RWLOCK,
CHK_NUM_FNAMES,
CHK_NUM_LOGMANAGER,
CHK_NUM_FILE,
CHK_NUM_BLOCKBUF,
CHK_NUM_HASHTABLE,
CHK_NUM_DCB,
CHK_NUM_PROTOCOL,
CHK_NUM_SESSION,
CHK_NUM_SERVER,
CHK_NUM_ROUTER_SES,
CHK_NUM_MY_SESCMD,
CHK_NUM_ROUTER_PROPERTY,
CHK_NUM_SESCMD_CUR,
CHK_NUM_BACKEND,
CHK_NUM_BACKEND_REF,
CHK_NUM_PREP_STMT,
CHK_NUM_PINFO,
CHK_NUM_MYSQLSES,
CHK_NUM_ADMINSES,
CHK_NUM_MANAGED_LIST
} skygw_chk_t;
# define STRBOOL(b) ((b) ? "true" : "false") # define STRBOOL(b) ((b) ? "true" : "false")
# define STRQTYPE(t) ((t) == QUERY_TYPE_WRITE ? "QUERY_TYPE_WRITE" : \ # define STRQTYPE(t) ((t) == QUERY_TYPE_WRITE ? "QUERY_TYPE_WRITE" : \
@ -234,9 +197,6 @@ typedef enum skygw_chk_t
"Unknown DCB reason"))))))) "Unknown DCB reason")))))))
#define CHK_MLIST(l) { \ #define CHK_MLIST(l) { \
ss_info_dassert((l->mlist_chk_top == CHK_NUM_MLIST && \
l->mlist_chk_tail == CHK_NUM_MLIST), \
"Single-linked list structure under- or overflow"); \
if (l->mlist_first == NULL) { \ if (l->mlist_first == NULL) { \
ss_info_dassert(l->mlist_nodecount == 0, \ ss_info_dassert(l->mlist_nodecount == 0, \
"List head is NULL but element counter is not zero."); \ "List head is NULL but element counter is not zero."); \
@ -260,15 +220,9 @@ typedef enum skygw_chk_t
#define CHK_MLIST_NODE(n) { \ #define CHK_MLIST_NODE(n) { \
ss_info_dassert((n->mlnode_chk_top == CHK_NUM_MLIST_NODE && \
n->mlnode_chk_tail == CHK_NUM_MLIST_NODE), \
"Single-linked list node under- or overflow"); \
} }
#define CHK_MLIST_CURSOR(c) { \ #define CHK_MLIST_CURSOR(c) { \
ss_info_dassert(c->mlcursor_chk_top == CHK_NUM_MLIST_CURSOR && \
c->mlcursor_chk_tail == CHK_NUM_MLIST_CURSOR, \
"List cursor under- or overflow"); \
ss_info_dassert(c->mlcursor_list != NULL, \ ss_info_dassert(c->mlcursor_list != NULL, \
"List cursor doesn't have list"); \ "List cursor doesn't have list"); \
ss_info_dassert(c->mlcursor_pos != NULL || \ ss_info_dassert(c->mlcursor_pos != NULL || \
@ -278,9 +232,6 @@ typedef enum skygw_chk_t
} }
#define CHK_SLIST(l) { \ #define CHK_SLIST(l) { \
ss_info_dassert((l->slist_chk_top == CHK_NUM_SLIST && \
l->slist_chk_tail == CHK_NUM_SLIST), \
"Single-linked list structure under- or overflow"); \
if (l->slist_head == NULL) { \ if (l->slist_head == NULL) { \
ss_info_dassert(l->slist_nelems == 0, \ ss_info_dassert(l->slist_nelems == 0, \
"List head is NULL but element counter is not zero."); \ "List head is NULL but element counter is not zero."); \
@ -304,15 +255,9 @@ typedef enum skygw_chk_t
#define CHK_SLIST_NODE(n) { \ #define CHK_SLIST_NODE(n) { \
ss_info_dassert((n->slnode_chk_top == CHK_NUM_SLIST_NODE && \
n->slnode_chk_tail == CHK_NUM_SLIST_NODE), \
"Single-linked list node under- or overflow"); \
} }
#define CHK_SLIST_CURSOR(c) { \ #define CHK_SLIST_CURSOR(c) { \
ss_info_dassert(c->slcursor_chk_top == CHK_NUM_SLIST_CURSOR && \
c->slcursor_chk_tail == CHK_NUM_SLIST_CURSOR, \
"List cursor under- or overflow"); \
ss_info_dassert(c->slcursor_list != NULL, \ ss_info_dassert(c->slcursor_list != NULL, \
"List cursor doesn't have list"); \ "List cursor doesn't have list"); \
ss_info_dassert(c->slcursor_pos != NULL || \ ss_info_dassert(c->slcursor_pos != NULL || \
@ -322,15 +267,9 @@ typedef enum skygw_chk_t
} }
#define CHK_QUERY_TEST(q) { \ #define CHK_QUERY_TEST(q) { \
ss_info_dassert(q->qt_chk_top == CHK_NUM_QUERY_TEST && \
q->qt_chk_tail == CHK_NUM_QUERY_TEST, \
"Query test under- or overflow."); \
} }
#define CHK_LOGFILE(lf) { \ #define CHK_LOGFILE(lf) { \
ss_info_dassert(lf->lf_chk_top == CHK_NUM_LOGFILE && \
lf->lf_chk_tail == CHK_NUM_LOGFILE, \
"Logfile struct under- or overflow"); \
ss_info_dassert(lf->lf_filepath != NULL && \ ss_info_dassert(lf->lf_filepath != NULL && \
lf->lf_name_prefix != NULL && \ lf->lf_name_prefix != NULL && \
lf->lf_name_suffix != NULL && \ lf->lf_name_suffix != NULL && \
@ -339,27 +278,15 @@ typedef enum skygw_chk_t
} }
#define CHK_FILEWRITER(fwr) { \ #define CHK_FILEWRITER(fwr) { \
ss_info_dassert(fwr->fwr_chk_top == CHK_NUM_FILEWRITER && \
fwr->fwr_chk_tail == CHK_NUM_FILEWRITER, \
"File writer struct under- or overflow"); \
} }
#define CHK_THREAD(thr) { \ #define CHK_THREAD(thr) { \
ss_info_dassert(thr->sth_chk_top == CHK_NUM_THREAD && \
thr->sth_chk_tail == CHK_NUM_THREAD, \
"Thread struct under- or overflow"); \
} }
#define CHK_SIMPLE_MUTEX(sm) { \ #define CHK_SIMPLE_MUTEX(sm) { \
ss_info_dassert(sm->sm_chk_top == CHK_NUM_SIMPLE_MUTEX && \
sm->sm_chk_tail == CHK_NUM_SIMPLE_MUTEX, \
"Simple mutex struct under- or overflow"); \
} }
#define CHK_MESSAGE(mes) { \ #define CHK_MESSAGE(mes) { \
ss_info_dassert(mes->mes_chk_top == CHK_NUM_MESSAGE && \
mes->mes_chk_tail == CHK_NUM_MESSAGE, \
"Message struct under- or overflow"); \
} }
@ -377,63 +304,34 @@ typedef enum skygw_chk_t
} }
#define CHK_FNAMES_CONF(fn) { \ #define CHK_FNAMES_CONF(fn) { \
ss_info_dassert(fn->fn_chk_top == CHK_NUM_FNAMES && \
fn->fn_chk_tail == CHK_NUM_FNAMES, \
"File names confs struct under- or overflow"); \
} }
#define CHK_LOGMANAGER(lm) { \ #define CHK_LOGMANAGER(lm) { \
ss_info_dassert(lm->lm_chk_top == CHK_NUM_LOGMANAGER && \
lm->lm_chk_tail == CHK_NUM_LOGMANAGER, \
"Log manager struct under- or overflow"); \
} }
#define CHK_FILE(f) { \ #define CHK_FILE(f) { \
ss_info_dassert(f->sf_chk_top == CHK_NUM_FILE && \
f->sf_chk_tail == CHK_NUM_FILE, \
"File struct under- or overflow"); \
} }
#define CHK_BLOCKBUF(bb) { \ #define CHK_BLOCKBUF(bb) { \
ss_info_dassert(bb->bb_chk_top == CHK_NUM_BLOCKBUF, \
"Block buf under- or overflow"); \
} }
#define CHK_HASHTABLE(t) { \ #define CHK_HASHTABLE(t) { \
ss_info_dassert(t->ht_chk_top == CHK_NUM_HASHTABLE && \
t->ht_chk_tail == CHK_NUM_HASHTABLE, \
"Hashtable under- or overflow"); \
} }
#define CHK_MANAGED_LIST(l) { \ #define CHK_MANAGED_LIST(l) { \
ss_info_dassert(l->list_entry_chk_top == CHK_NUM_MANAGED_LIST && \
l->list_entry_chk_tail == CHK_NUM_MANAGED_LIST, \
"Managed list under- or overflow"); \
} }
#define CHK_DCB(d) { \ #define CHK_DCB(d) { \
ss_info_dassert(d->dcb_chk_top == CHK_NUM_DCB && \
d->dcb_chk_tail == CHK_NUM_DCB, \
"Dcb under- or overflow"); \
} }
#define CHK_PROTOCOL(p) { \ #define CHK_PROTOCOL(p) { \
ss_info_dassert(p->protocol_chk_top == CHK_NUM_PROTOCOL && \
p->protocol_chk_tail == CHK_NUM_PROTOCOL, \
"Protocol under- or overflow"); \
} }
#define CHK_SESSION(s) { \ #define CHK_SESSION(s) { \
ss_info_dassert(s->ses_chk_top == CHK_NUM_SESSION && \
s->ses_chk_tail == CHK_NUM_SESSION, \
"Session under- or overflow"); \
} }
#define CHK_SERVER(s) { \ #define CHK_SERVER(s) { \
ss_info_dassert(s->server_chk_top == CHK_NUM_SERVER && \
s->server_chk_tail == CHK_NUM_SERVER, \
"Server under- or overflow"); \
} }
#define CHK_GWBUF(b) { \ #define CHK_GWBUF(b) { \
@ -442,63 +340,33 @@ typedef enum skygw_chk_t
} }
#define CHK_CLIENT_RSES(r) { \ #define CHK_CLIENT_RSES(r) { \
ss_info_dassert((r)->rses_chk_top == CHK_NUM_ROUTER_SES && \
(r)->rses_chk_tail == CHK_NUM_ROUTER_SES, \
"Router client session has invalid check fields"); \
} }
#define CHK_RSES_PROP(p) { \ #define CHK_RSES_PROP(p) { \
ss_info_dassert((p)->rses_prop_chk_top == CHK_NUM_ROUTER_PROPERTY && \
(p)->rses_prop_chk_tail == CHK_NUM_ROUTER_PROPERTY, \
"Router property has invalid check fields"); \
} }
#define CHK_MYSQL_SESCMD(s) { \ #define CHK_MYSQL_SESCMD(s) { \
ss_info_dassert((s)->my_sescmd_chk_top == CHK_NUM_MY_SESCMD && \
(s)->my_sescmd_chk_tail == CHK_NUM_MY_SESCMD, \
"Session command has invalid check fields"); \
} }
#define CHK_SESCMD_CUR(c) { \ #define CHK_SESCMD_CUR(c) { \
ss_info_dassert((c)->scmd_cur_chk_top == CHK_NUM_SESCMD_CUR && \
(c)->scmd_cur_chk_tail == CHK_NUM_SESCMD_CUR, \
"Session command cursor has invalid check fields"); \
} }
#define CHK_BACKEND(b) { \ #define CHK_BACKEND(b) { \
ss_info_dassert((b)->be_chk_top == CHK_NUM_BACKEND && \
(b)->be_chk_tail == CHK_NUM_BACKEND, \
"BACKEND has invalid check fields"); \
} }
#define CHK_BACKEND_REF(r) { \ #define CHK_BACKEND_REF(r) { \
ss_info_dassert((r)->bref_chk_top == CHK_NUM_BACKEND_REF && \
(r)->bref_chk_tail == CHK_NUM_BACKEND_REF, \
"Backend reference has invalid check fields"); \
} }
#define CHK_PREP_STMT(p) { \ #define CHK_PREP_STMT(p) { \
ss_info_dassert((p)->pstmt_chk_top == CHK_NUM_PREP_STMT && \
(p)->pstmt_chk_tail == CHK_NUM_PREP_STMT, \
"Prepared statement struct has invalid check fields"); \
} }
#define CHK_PARSING_INFO(p) { \ #define CHK_PARSING_INFO(p) { \
ss_info_dassert((p)->pi_chk_top == CHK_NUM_PINFO && \
(p)->pi_chk_tail == CHK_NUM_PINFO, \
"Parsing info struct has invalid check fields"); \
} }
#define CHK_MYSQL_SESSION(s) { \ #define CHK_MYSQL_SESSION(s) { \
ss_info_dassert((s)->myses_chk_top == CHK_NUM_MYSQLSES && \
(s)->myses_chk_tail == CHK_NUM_MYSQLSES, \
"MYSQL session struct has invalid check fields"); \
} }
#define CHK_ADMIN_SESSION(s) { \ #define CHK_ADMIN_SESSION(s) { \
ss_info_dassert((s)->adminses_chk_top == CHK_NUM_ADMINSES && \
(s)->adminses_chk_tail == CHK_NUM_ADMINSES, \
"Admin session struct has invalid check fields"); \
} }

View File

@ -71,9 +71,6 @@ typedef void (*HASHFREEFN)(void *);
*/ */
typedef struct hashtable typedef struct hashtable
{ {
#if defined(SS_DEBUG)
skygw_chk_t ht_chk_top;
#endif
int hashsize; /**< The number of HASHENTRIES */ int hashsize; /**< The number of HASHENTRIES */
HASHENTRIES **entries; /**< The entries themselves */ HASHENTRIES **entries; /**< The entries themselves */
HASHHASHFN hashfn; /**< The hash function */ HASHHASHFN hashfn; /**< The hash function */
@ -87,9 +84,6 @@ typedef struct hashtable
int writelock; /**< The table is locked by a writer */ int writelock; /**< The table is locked by a writer */
bool ht_isflat; /**< Indicates whether hashtable is in stack or heap */ bool ht_isflat; /**< Indicates whether hashtable is in stack or heap */
int n_elements; /**< Number of added elements */ int n_elements; /**< Number of added elements */
#if defined(SS_DEBUG)
skygw_chk_t ht_chk_tail;
#endif
} HASHTABLE; } HASHTABLE;
extern HASHTABLE *hashtable_alloc(int, HASHHASHFN hashfn, HASHCMPFN cmpfn); extern HASHTABLE *hashtable_alloc(int, HASHHASHFN hashfn, HASHCMPFN cmpfn);

View File

@ -139,17 +139,11 @@ typedef enum
*/ */
typedef struct mysql_session typedef struct mysql_session
{ {
#if defined(SS_DEBUG)
skygw_chk_t myses_chk_top;
#endif
uint8_t client_sha1[MYSQL_SCRAMBLE_LEN]; /*< SHA1(password) */ uint8_t client_sha1[MYSQL_SCRAMBLE_LEN]; /*< SHA1(password) */
char user[MYSQL_USER_MAXLEN + 1]; /*< username */ char user[MYSQL_USER_MAXLEN + 1]; /*< username */
char db[MYSQL_DATABASE_MAXLEN + 1]; /*< database */ char db[MYSQL_DATABASE_MAXLEN + 1]; /*< database */
int auth_token_len; /*< token length */ int auth_token_len; /*< token length */
uint8_t *auth_token; /*< token */ uint8_t *auth_token; /*< token */
#if defined(SS_DEBUG)
skygw_chk_t myses_chk_tail;
#endif
} MYSQL_session; } MYSQL_session;
/** Protocol packing macros. */ /** Protocol packing macros. */
@ -320,9 +314,6 @@ static const char* const MXS_LAST_GTID = "last_gtid";
*/ */
typedef struct typedef struct
{ {
#if defined(SS_DEBUG)
skygw_chk_t protocol_chk_top;
#endif
int fd; /*< The socket descriptor */ int fd; /*< The socket descriptor */
struct dcb* owner_dcb; /*< The DCB of the socket we are running on */ struct dcb* owner_dcb; /*< The DCB of the socket we are running on */
mxs_mysql_cmd_t current_command; /*< Current command being executed */ mxs_mysql_cmd_t current_command; /*< Current command being executed */
@ -340,9 +331,6 @@ typedef struct
bool changing_user; bool changing_user;
uint32_t num_eof_packets; /*< Encountered eof packet number, used for check packet type */ uint32_t num_eof_packets; /*< Encountered eof packet number, used for check packet type */
bool large_query; /*< Whether to ignore the command byte of the next packet*/ bool large_query; /*< Whether to ignore the command byte of the next packet*/
#if defined(SS_DEBUG)
skygw_chk_t protocol_chk_tail;
#endif
} MySQLProtocol; } MySQLProtocol;
typedef struct typedef struct

View File

@ -114,9 +114,6 @@ static uint64_t server_encode_version(const SERVER_VERSION* server_version)
*/ */
typedef struct server typedef struct server
{ {
#if defined(SS_DEBUG)
skygw_chk_t server_chk_top;
#endif
// Base settings // Base settings
char *name; /**< Server config name */ char *name; /**< Server config name */
char address[MAX_SERVER_ADDRESS_LEN]; /**< Server hostname/IP-address */ char address[MAX_SERVER_ADDRESS_LEN]; /**< Server hostname/IP-address */
@ -159,9 +156,6 @@ typedef struct server
* by rwsplit. TODO: Move to rwsplit */ * by rwsplit. TODO: Move to rwsplit */
bool warn_ssl_not_enabled; /**< SSL not used for an SSL enabled server */ bool warn_ssl_not_enabled; /**< SSL not used for an SSL enabled server */
MxsDiskSpaceThreshold* disk_space_threshold; /**< Disk space thresholds */ MxsDiskSpaceThreshold* disk_space_threshold; /**< Disk space thresholds */
#if defined(SS_DEBUG)
skygw_chk_t server_chk_tail;
#endif
} SERVER; } SERVER;
enum enum

View File

@ -165,7 +165,6 @@ typedef char* (*session_variable_handler_t)(void* context,
*/ */
typedef struct session typedef struct session
{ {
skygw_chk_t ses_chk_top;
mxs_session_state_t state; /*< Current descriptor state */ mxs_session_state_t state; /*< Current descriptor state */
uint64_t ses_id; /*< Unique session identifier */ uint64_t ses_id; /*< Unique session identifier */
struct dcb *client_dcb; /*< The client connection */ struct dcb *client_dcb; /*< The client connection */
@ -186,7 +185,6 @@ typedef struct session
GWBUF* buffer; /*< Buffer to deliver to up. */ GWBUF* buffer; /*< Buffer to deliver to up. */
} response; /*< Shortcircuited response */ } response; /*< Shortcircuited response */
session_close_t close_reason; /*< Reason why the session was closed */ session_close_t close_reason; /*< Reason why the session was closed */
skygw_chk_t ses_chk_tail;
} MXS_SESSION; } MXS_SESSION;
/** /**

View File

@ -133,9 +133,6 @@ static const char* map_function_name(NAME_MAPPING* function_name_mappings, const
#define MAX_QUERYBUF_SIZE 2048 #define MAX_QUERYBUF_SIZE 2048
typedef struct parsing_info_st : public QC_STMT_INFO typedef struct parsing_info_st : public QC_STMT_INFO
{ {
#if defined(SS_DEBUG)
skygw_chk_t pi_chk_top;
#endif
void* pi_handle; /*< parsing info object pointer */ void* pi_handle; /*< parsing info object pointer */
char* pi_query_plain_str; /*< query as plain string */ char* pi_query_plain_str; /*< query as plain string */
void (*pi_done_fp)(void *); /*< clean-up function for parsing info */ void (*pi_done_fp)(void *); /*< clean-up function for parsing info */
@ -149,9 +146,6 @@ typedef struct parsing_info_st : public QC_STMT_INFO
qc_parse_result_t result; qc_parse_result_t result;
int32_t type_mask; int32_t type_mask;
NAME_MAPPING* function_name_mappings; NAME_MAPPING* function_name_mappings;
#if defined(SS_DEBUG)
skygw_chk_t pi_chk_tail;
#endif
} parsing_info_t; } parsing_info_t;
#define QTYPE_LESS_RESTRICTIVE_THAN_WRITE(t) (t<QUERY_TYPE_WRITE ? true : false) #define QTYPE_LESS_RESTRICTIVE_THAN_WRITE(t) (t<QUERY_TYPE_WRITE ? true : false)
@ -1717,10 +1711,6 @@ static parsing_info_t* parsing_info_init(void (*donefun)(void *))
goto retblock; goto retblock;
} }
#if defined(SS_DEBUG)
pi->pi_chk_top = CHK_NUM_PINFO;
pi->pi_chk_tail = CHK_NUM_PINFO;
#endif
/** Set handle and free function to parsing info struct */ /** Set handle and free function to parsing info struct */
pi->pi_handle = mysql; pi->pi_handle = mysql;
pi->pi_done_fp = donefun; pi->pi_done_fp = donefun;

View File

@ -127,7 +127,6 @@ static int downstream_throttle_callback(DCB *dcb, DCB_REASON reason, void *userd
void dcb_global_init() void dcb_global_init()
{ {
this_unit.dcb_initialized.dcb_chk_top = CHK_NUM_DCB;
this_unit.dcb_initialized.fd = DCBFD_CLOSED; this_unit.dcb_initialized.fd = DCBFD_CLOSED;
this_unit.dcb_initialized.state = DCB_STATE_ALLOC; this_unit.dcb_initialized.state = DCB_STATE_ALLOC;
this_unit.dcb_initialized.ssl_state = SSL_HANDSHAKE_UNKNOWN; this_unit.dcb_initialized.ssl_state = SSL_HANDSHAKE_UNKNOWN;
@ -135,7 +134,6 @@ void dcb_global_init()
this_unit.dcb_initialized.high_water_reached = false; this_unit.dcb_initialized.high_water_reached = false;
this_unit.dcb_initialized.low_water = config_writeq_low_water(); this_unit.dcb_initialized.low_water = config_writeq_low_water();
this_unit.dcb_initialized.high_water = config_writeq_high_water(); this_unit.dcb_initialized.high_water = config_writeq_high_water();
this_unit.dcb_initialized.dcb_chk_tail = CHK_NUM_DCB;
int nthreads = config_threadcount(); int nthreads = config_threadcount();

View File

@ -145,10 +145,6 @@ hashtable_alloc_real(HASHTABLE* target,
rval->ht_isflat = true; rval->ht_isflat = true;
} }
#if defined(SS_DEBUG)
rval->ht_chk_top = CHK_NUM_HASHTABLE;
rval->ht_chk_tail = CHK_NUM_HASHTABLE;
#endif
rval->hashsize = size > 0 ? size : 1; rval->hashsize = size > 0 ? size : 1;
rval->hashfn = hashfn; rval->hashfn = hashfn;
rval->cmpfn = cmpfn; rval->cmpfn = cmpfn;

View File

@ -144,10 +144,6 @@ SERVER* server_alloc(const char *name, MXS_CONFIG_PARAMETER* params)
address, sizeof(server->address)); address, sizeof(server->address));
} }
#if defined(SS_DEBUG)
server->server_chk_top = CHK_NUM_SERVER;
server->server_chk_tail = CHK_NUM_SERVER;
#endif
server->name = my_name; server->name = my_name;
server->port = config_get_integer(params, CN_PORT); server->port = config_get_integer(params, CN_PORT);
server->protocol = my_protocol; server->protocol = my_protocol;

View File

@ -64,8 +64,6 @@ namespace
static struct session dummy_session() static struct session dummy_session()
{ {
struct session session = {}; struct session session = {};
session.ses_chk_top = CHK_NUM_SESSION;
session.ses_chk_tail = CHK_NUM_SESSION;
session.state = SESSION_STATE_DUMMY; session.state = SESSION_STATE_DUMMY;
session.refcount = 1; session.refcount = 1;
return session; return session;
@ -114,7 +112,6 @@ MXS_SESSION* session_alloc_with_id(SERVICE *service, DCB *client_dcb, uint64_t i
static MXS_SESSION* session_alloc_body(SERVICE* service, DCB* client_dcb, static MXS_SESSION* session_alloc_body(SERVICE* service, DCB* client_dcb,
MXS_SESSION* session, uint64_t id) MXS_SESSION* session, uint64_t id)
{ {
session->ses_chk_top = CHK_NUM_SESSION;
session->state = SESSION_STATE_READY; session->state = SESSION_STATE_READY;
session->ses_id = id; session->ses_id = id;
session->client_dcb = client_dcb; session->client_dcb = client_dcb;
@ -147,7 +144,6 @@ static MXS_SESSION* session_alloc_body(SERVICE* service, DCB* client_dcb,
session->qualifies_for_pooling = false; session->qualifies_for_pooling = false;
memset(&session->response, 0, sizeof(session->response)); memset(&session->response, 0, sizeof(session->response));
session->close_reason = SESSION_CLOSE_NONE; session->close_reason = SESSION_CLOSE_NONE;
session->ses_chk_tail = CHK_NUM_SESSION;
/* /*
* Only create a router session if we are not the listening DCB or an * Only create a router session if we are not the listening DCB or an

View File

@ -123,10 +123,6 @@ max_admin_auth_set_protocol_data(DCB *dcb, GWBUF *buf)
if ((session_data = (ADMIN_session *)MXS_CALLOC(1, sizeof(ADMIN_session))) != NULL) if ((session_data = (ADMIN_session *)MXS_CALLOC(1, sizeof(ADMIN_session))) != NULL)
{ {
int user_len = (GWBUF_LENGTH(buf) > ADMIN_USER_MAXLEN) ? ADMIN_USER_MAXLEN : GWBUF_LENGTH(buf); int user_len = (GWBUF_LENGTH(buf) > ADMIN_USER_MAXLEN) ? ADMIN_USER_MAXLEN : GWBUF_LENGTH(buf);
#if defined(SS_DEBUG)
session_data->adminses_chk_top = CHK_NUM_ADMINSES;
session_data->adminses_chk_tail = CHK_NUM_ADMINSES;
#endif
memcpy(session_data->user, GWBUF_DATA(buf), user_len); memcpy(session_data->user, GWBUF_DATA(buf), user_len);
session_data->validated = false; session_data->validated = false;
dcb->data = (void *)session_data; dcb->data = (void *)session_data;

View File

@ -20,11 +20,9 @@ void initialize_dcb(DCB* pDcb)
{ {
memset(pDcb, 0, sizeof(DCB)); memset(pDcb, 0, sizeof(DCB));
pDcb->dcb_chk_top = CHK_NUM_DCB;
pDcb->fd = DCBFD_CLOSED; pDcb->fd = DCBFD_CLOSED;
pDcb->state = DCB_STATE_ALLOC; pDcb->state = DCB_STATE_ALLOC;
pDcb->ssl_state = SSL_HANDSHAKE_UNKNOWN; pDcb->ssl_state = SSL_HANDSHAKE_UNKNOWN;
pDcb->dcb_chk_tail = CHK_NUM_DCB;
} }
} }

View File

@ -27,9 +27,7 @@ Session::Session(Client* pClient)
memset(pSession, 0, sizeof(MXS_SESSION)); memset(pSession, 0, sizeof(MXS_SESSION));
pSession->ses_chk_top = CHK_NUM_SESSION;
pSession->state = SESSION_STATE_ALLOC; pSession->state = SESSION_STATE_ALLOC;
pSession->ses_chk_tail = CHK_NUM_SESSION;
pSession->client_dcb = &m_client_dcb; pSession->client_dcb = &m_client_dcb;

View File

@ -78,16 +78,10 @@ typedef struct cdc_session
*/ */
typedef struct cdc_protocol typedef struct cdc_protocol
{ {
#ifdef SS_DEBUG
skygw_chk_t protocol_chk_top;
#endif
int state; /*< CDC protocol state */ int state; /*< CDC protocol state */
char user[CDC_USER_MAXLEN + 1]; /*< username for authentication */ char user[CDC_USER_MAXLEN + 1]; /*< username for authentication */
SPINLOCK lock; /*< Protocol structure lock */ SPINLOCK lock; /*< Protocol structure lock */
char type[CDC_TYPE_LEN + 1]; /*< Request Type */ char type[CDC_TYPE_LEN + 1]; /*< Request Type */
#ifdef SS_DEBUG
skygw_chk_t protocol_chk_tail;
#endif
} CDC_protocol; } CDC_protocol;
/* routines */ /* routines */

View File

@ -395,10 +395,6 @@ cdc_protocol_init(DCB* dcb)
/* memory allocation here */ /* memory allocation here */
p->state = CDC_STATE_WAIT_FOR_AUTH; p->state = CDC_STATE_WAIT_FOR_AUTH;
#ifdef SS_DEBUG
p->protocol_chk_tail = p->protocol_chk_top = CHK_NUM_PROTOCOL;
#endif
CHK_PROTOCOL(p); CHK_PROTOCOL(p);
return p; return p;

View File

@ -39,14 +39,6 @@ MYSQL_session* mysql_session_alloc()
{ {
MYSQL_session* ses = (MYSQL_session*)MXS_CALLOC(1, sizeof(MYSQL_session)); MYSQL_session* ses = (MYSQL_session*)MXS_CALLOC(1, sizeof(MYSQL_session));
if (ses)
{
#ifdef SS_DEBUG
ses->myses_chk_top = CHK_NUM_MYSQLSES;
ses->myses_chk_tail = CHK_NUM_MYSQLSES;
#endif
}
return ses; return ses;
} }
@ -71,10 +63,6 @@ MySQLProtocol* mysql_protocol_init(DCB* dcb, int fd)
p->changing_user = false; p->changing_user = false;
p->num_eof_packets = 0; p->num_eof_packets = 0;
p->large_query = false; p->large_query = false;
#if defined(SS_DEBUG)
p->protocol_chk_top = CHK_NUM_PROTOCOL;
p->protocol_chk_tail = CHK_NUM_PROTOCOL;
#endif
/*< Assign fd with protocol */ /*< Assign fd with protocol */
p->fd = fd; p->fd = fd;
p->owner_dcb = dcb; p->owner_dcb = dcb;

View File

@ -1151,11 +1151,6 @@ newSession(MXS_ROUTER *instance, MXS_SESSION *session)
return NULL; return NULL;
} }
#if defined(SS_DEBUG)
slave->rses_chk_top = CHK_NUM_ROUTER_SES;
slave->rses_chk_tail = CHK_NUM_ROUTER_SES;
#endif
memset(&slave->stats, 0, sizeof(SLAVE_STATS)); memset(&slave->stats, 0, sizeof(SLAVE_STATS));
atomic_add(&inst->stats.n_slaves, 1); atomic_add(&inst->stats.n_slaves, 1);
slave->state = BLRS_CREATED; /* Set initial state of the slave */ slave->state = BLRS_CREATED; /* Set initial state of the slave */

View File

@ -496,9 +496,6 @@ typedef struct slave_encryption_ctx
*/ */
typedef struct router_slave typedef struct router_slave
{ {
#if defined(SS_DEBUG)
skygw_chk_t rses_chk_top;
#endif
DCB *dcb; /*< The slave server DCB */ DCB *dcb; /*< The slave server DCB */
int state; /*< The state of this slave */ int state; /*< The state of this slave */
uint32_t binlog_pos; /*< Binlog position for this slave */ uint32_t binlog_pos; /*< Binlog position for this slave */
@ -550,9 +547,6 @@ typedef struct router_slave
sqlite3 *gtid_maps; /*< GTID storage client handle, read only*/ sqlite3 *gtid_maps; /*< GTID storage client handle, read only*/
MARIADB_GTID_INFO f_info; /*< GTID info for file name prefix */ MARIADB_GTID_INFO f_info; /*< GTID info for file name prefix */
bool annotate_rows; /*< MariaDB 10 Slave requests ANNOTATE_ROWS */ bool annotate_rows; /*< MariaDB 10 Slave requests ANNOTATE_ROWS */
#if defined(SS_DEBUG)
skygw_chk_t rses_chk_tail;
#endif
} ROUTER_SLAVE; } ROUTER_SLAVE;