- issue id
- CCM-01
Summary: CCM code cleanups which need doing
Created by: -- Lars Marowsky-Brée 2004-02-18 09:41:52
g_malloc() cannot return NULL; it will abort and dump core instead. So the checks for g_malloc() returning NULL are confusing and redundant; if error handling is desired, maybe CCM should use ha_malloc et al?
ccmbitmap.[ch] define functions working on bitmaps. These should however take void ** instead of char ** to avoid type casting problems.
ccm.c uses these bitmaps to encode and pass over the network a binary integer array. This is bound to break across systems with different endianess or different integer sizes.
Extra points added by AndrewBeekhof:
- Some documentation on the functions and what the various events mean would certainly help people trying to use, modify or debug the CCM
The practice of declaring lists/blobs as arrays of fixed size is deceptive. For example in ccmlib.h
typedef struct ccm_llm_s { /* information about low level membership info */
uint n; //number of nodes in the cluster
int mynode; //index of mynode
struct node_s {
uint Uuid; /* a cluster unique id for the node */
char Id[NODEIDSIZE];
} node[0];
} ccm_llm_t;
Should be
typedef struct ccm_llm_s { /* information about low level membership info */
uint n; //number of nodes in the cluster
int mynode; //index of mynode
struct node_s {
uint Uuid; /* a cluster unique id for the node */
char Id[NODEIDSIZE];
} *node;
} ccm_llm_t;
- I understand that the standard for #defines is ALL CAPS, but the high usage of ALL CAPS is very hard on the eye.
