defect 703

checkpoint synchronize calls do not check if active replica set


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@741 fd59a12c-fef9-0310-b244-a6a79926bd2f
This commit is contained in:
Steven Dake 2005-07-13 20:06:04 +00:00
parent 0469a201e4
commit d8accbfacc
3 changed files with 12 additions and 1 deletions

View File

@ -3233,11 +3233,19 @@ static int message_handler_req_lib_ckpt_sectionread (struct conn_info *conn_info
static int message_handler_req_lib_ckpt_checkpointsynchronize (struct conn_info *conn_info, void *message)
{
struct req_lib_ckpt_checkpointsynchronize *req_lib_ckpt_checkpointsynchronize = (struct req_lib_ckpt_checkpointsynchronize *)message;
struct res_lib_ckpt_checkpointsynchronize res_lib_ckpt_checkpointsynchronize;
struct saCkptCheckpoint *checkpoint;
checkpoint = ckpt_checkpoint_find_global (&req_lib_ckpt_checkpointsynchronize->checkpointName);
if (checkpoint->active_replica_set == 1) {
res_lib_ckpt_checkpointsynchronize.header.error = SA_AIS_OK;
} else {
res_lib_ckpt_checkpointsynchronize.header.error = SA_AIS_ERR_NOT_EXIST;
}
res_lib_ckpt_checkpointsynchronize.header.size = sizeof (struct res_lib_ckpt_checkpointsynchronize);
res_lib_ckpt_checkpointsynchronize.header.id = MESSAGE_RES_CKPT_CHECKPOINT_CHECKPOINTSYNCHRONIZE;
res_lib_ckpt_checkpointsynchronize.header.error = SA_AIS_OK;
libais_send_response (conn_info,
&res_lib_ckpt_checkpointsynchronize,

View File

@ -244,6 +244,7 @@ struct res_lib_ckpt_sectionread {
struct req_lib_ckpt_checkpointsynchronize {
struct req_header header;
SaNameT checkpointName;
};
struct res_lib_ckpt_checkpointsynchronize {

View File

@ -1582,6 +1582,8 @@ saCkptCheckpointSynchronize (
req_lib_ckpt_checkpointsynchronize.header.size = sizeof (struct req_lib_ckpt_checkpointsynchronize);
req_lib_ckpt_checkpointsynchronize.header.id = MESSAGE_REQ_CKPT_CHECKPOINT_CHECKPOINTSYNCHRONIZE;
memcpy (&req_lib_ckpt_checkpointsynchronize.checkpointName,
&ckptCheckpointInstance->checkpointName, sizeof (SaNameT));
pthread_mutex_lock (&ckptCheckpointInstance->response_mutex);