[Openais] flow control and merge recovery

Steven Dake sdake at mvista.com
Fri Sep 24 11:25:48 PDT 2004


if you want to merge it it looks good to me

Regards
-steve

On Fri, 2004-09-24 at 07:48, Mark Haverkamp wrote:
> On Thu, 2004-09-23 at 16:32, Steven Dake wrote:
> 
> > I'll work on the token rotation callback.  Can you work up the patch for
> > the gmi_send_ok/gmi_mcast/assert changes?
> > 
> 
> How does this look.
> 
> ===== exec/amf.c 1.13 vs edited =====
> --- 1.13/exec/amf.c	2004-09-18 00:01:11 -07:00
> +++ edited/exec/amf.c	2004-09-24 07:30:34 -07:00
> @@ -491,7 +491,7 @@
>  	iovecs[0].iov_base = (char *)&req_exec_amf_componentunregister;
>  	iovecs[0].iov_len = sizeof (req_exec_amf_componentunregister);
>  
> -	gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_MED);
> +	assert (gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_MED) == 0);
>  }
>  
>  #ifdef COMPILE_OUT
> @@ -715,7 +715,7 @@
>  	iovecs[0].iov_base = (char *)&req_exec_amf_hastateset;
>  	iovecs[0].iov_len = sizeof (req_exec_amf_hastateset);
>  
> -	gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_HIGH);
> +	assert (gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_HIGH) == 0);
>  }
>  
>  void readinessStateSetApi (struct saAmfComponent *component,
> @@ -806,7 +806,7 @@
>  	iovecs[0].iov_base = (char *)&req_exec_amf_readinessstateset;
>  	iovecs[0].iov_len = sizeof (req_exec_amf_readinessstateset);
>  
> -	gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_HIGH);
> +	assert (gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_HIGH) == 0);
>  }
>  
>  #ifdef CMOPILE_OUT
> @@ -1330,7 +1330,7 @@
>  	iovecs[0].iov_base = (char *)&req_exec_amf_errorreport;
>  	iovecs[0].iov_len = sizeof (req_exec_amf_errorreport);
>  
> -	gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_MED);
> +	assert (gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_MED) == 0);
>  }
>  
>  int healthcheck_instance = 0;
> @@ -2017,7 +2017,6 @@
>  	struct req_amf_componentregister *req_lib_amf_componentregister = (struct req_amf_componentregister *)message;
>  	struct req_exec_amf_componentregister req_exec_amf_componentregister;
>  	struct iovec iovecs[2];
> -	int result;
>  
>  	req_exec_amf_componentregister.header.size = sizeof (struct req_exec_amf_componentregister);
>  	req_exec_amf_componentregister.header.id = MESSAGE_REQ_EXEC_AMF_COMPONENTREGISTER;
> @@ -2031,7 +2030,7 @@
>  	iovecs[0].iov_base = (char *)&req_exec_amf_componentregister;
>  	iovecs[0].iov_len = sizeof (req_exec_amf_componentregister);
>  
> -	result = gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_MED);
> +	assert (gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_MED) == 0);
>  
>  	return (0);
>  }
> @@ -2041,7 +2040,6 @@
>  	struct req_lib_amf_componentunregister *req_lib_amf_componentunregister = (struct req_lib_amf_componentunregister *)message;
>  	struct req_exec_amf_componentunregister req_exec_amf_componentunregister;
>  	struct iovec iovecs[2];
> -	int result;
>  	struct saAmfComponent *component;
>  
>  	req_exec_amf_componentunregister.header.size = sizeof (struct req_exec_amf_componentunregister);
> @@ -2060,7 +2058,7 @@
>  	iovecs[0].iov_base = (char *)&req_exec_amf_componentunregister;
>  	iovecs[0].iov_len = sizeof (req_exec_amf_componentunregister);
>  
> -	result = gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_MED);
> +	assert (gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_MED) == 0);
>  
>  	return (0);
>  }
> @@ -2218,7 +2216,6 @@
>  	struct req_exec_amf_errorreport req_exec_amf_errorreport;
>  
>  	struct iovec iovecs[2];
> -	int result;
>  
>  	req_exec_amf_errorreport.header.size = sizeof (struct req_exec_amf_errorreport);
>  	req_exec_amf_errorreport.header.id = MESSAGE_REQ_EXEC_AMF_ERRORREPORT;
> @@ -2236,7 +2233,7 @@
>  //	iovecs[1].iov_base = (char *)&req_lib_amf_errorreport;
>  //	iovecs[1].iov_len = sizeof (req_lib_amf_errorreport);
>  
> -	result = gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_MED);
> +	assert (gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_MED) == 0);
>  
>  	return (0);
>  }
> @@ -2247,7 +2244,6 @@
>  	struct req_exec_amf_errorcancelall req_exec_amf_errorcancelall;
>  
>  	struct iovec iovecs[2];
> -	int result;
>  
>  	req_exec_amf_errorcancelall.header.size = sizeof (struct req_exec_amf_errorcancelall);
>  	req_exec_amf_errorcancelall.header.id = MESSAGE_REQ_EXEC_AMF_ERRORCANCELALL;
> @@ -2265,7 +2261,7 @@
>  //	iovecs[1].iov_base = (char *)&req_lib_amf_errorcancelall;
>  //	iovecs[1].iov_len = sizeof (req_lib_amf_errorcancelall);
>  
> -	result = gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_MED);
> +	assert (gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_MED) == 0);
>  
>  	return (0);
>  }
> ===== exec/ckpt.c 1.12 vs edited =====
> --- 1.12/exec/ckpt.c	2004-09-23 15:09:21 -07:00
> +++ edited/exec/ckpt.c	2004-09-24 07:34:11 -07:00
> @@ -427,7 +427,7 @@
>  	iovecs[0].iov_len = sizeof (req_exec_ckpt_checkpointclose);
>  
>  	if (gmi_send_ok (GMI_PRIO_HIGH, sizeof (struct req_exec_ckpt_checkpointclose))) {
> -		gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_HIGH);
> +		assert (gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_HIGH) == 0);
>  		return (0);
>  	}
>  
> @@ -624,7 +624,6 @@
>  {
>  	struct saCkptCheckpoint *checkpoint = (struct saCkptCheckpoint *)data;
>  	struct req_exec_ckpt_checkpointretentiondurationexpire req_exec_ckpt_checkpointretentiondurationexpire;
> -	int result;
>  	struct iovec iovec;
>  
>  	checkpoint->retention_timer = 0;
> @@ -639,7 +638,7 @@
>  	iovec.iov_base = (char *)&req_exec_ckpt_checkpointretentiondurationexpire;
>  	iovec.iov_len = sizeof (req_exec_ckpt_checkpointretentiondurationexpire);
>  
> -	result = gmi_mcast (&aisexec_groupname, &iovec, 1, GMI_PRIO_MED);
> +	assert (gmi_mcast (&aisexec_groupname, &iovec, 1, GMI_PRIO_MED) == 0);
>  }
>  
>  extern int message_handler_req_exec_ckpt_checkpointclose (void *message, struct in_addr source_addr)
> @@ -785,7 +784,7 @@
>  		iovecs[0].iov_base = (char *)&req_exec_ckpt_checkpointunlink;
>  		iovecs[0].iov_len = sizeof (req_exec_ckpt_checkpointunlink);
>  
> -		gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_MED);
> +		assert (gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_MED) == 0);
>  	}
>  	return (0);
>  }
> @@ -1328,7 +1327,6 @@
>  	struct req_lib_ckpt_checkpointopen *req_lib_ckpt_checkpointopen = (struct req_lib_ckpt_checkpointopen *)message;
>  	struct req_exec_ckpt_checkpointopen req_exec_ckpt_checkpointopen;
>  	struct iovec iovecs[2];
> -	int result;
>  
>  	log_printf (LOG_LEVEL_DEBUG, "Library request to open checkpoint.\n");
>  	req_exec_ckpt_checkpointopen.header.size =
> @@ -1345,7 +1343,7 @@
>  	iovecs[0].iov_base = (char *)&req_exec_ckpt_checkpointopen;
>  	iovecs[0].iov_len = sizeof (req_exec_ckpt_checkpointopen);
>  
> -	result = gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_MED);
> +	assert (gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_MED) == 0);
>  
>  	return (0);
>  }
> @@ -1361,7 +1359,6 @@
>  	struct req_lib_ckpt_checkpointunlink *req_lib_ckpt_checkpointunlink = (struct req_lib_ckpt_checkpointunlink *)message;
>  	struct req_exec_ckpt_checkpointunlink req_exec_ckpt_checkpointunlink;
>  	struct iovec iovecs[2];
> -	int result;
>  
>  	req_exec_ckpt_checkpointunlink.header.size =
>  		sizeof (struct req_exec_ckpt_checkpointunlink);
> @@ -1377,7 +1374,7 @@
>  	iovecs[0].iov_base = (char *)&req_exec_ckpt_checkpointunlink;
>  	iovecs[0].iov_len = sizeof (req_exec_ckpt_checkpointunlink);
>  
> -	result = gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_MED);
> +	assert (gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_MED) == 0);
>  
>  	return (0);
>  }
> @@ -1403,7 +1400,7 @@
>  	iovecs[0].iov_base = (char *)&req_exec_ckpt_checkpointretentiondurationset;
>  	iovecs[0].iov_len = sizeof (req_exec_ckpt_checkpointretentiondurationset);
>  
> -	gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_LOW);
> +	assert (gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_LOW) == 0);
>  
>  	return (0);
>  }
> @@ -1521,9 +1518,9 @@
>  #endif
>  	if (iovecs[1].iov_len > 0) {
>  		log_printf (LOG_LEVEL_DEBUG, "IOV_BASE is %s\n", iovecs[1].iov_base);
> -		gmi_mcast (&aisexec_groupname, iovecs, 2, GMI_PRIO_MED);
> +		assert (gmi_mcast (&aisexec_groupname, iovecs, 2, GMI_PRIO_MED) == 0);
>  	} else {
> -		gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_MED);
> +		assert (gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_MED) == 0);
>  	}
>  
>  	return (0);
> @@ -1561,9 +1558,9 @@
>  	iovecs[1].iov_len = req_lib_ckpt_sectiondelete->header.size - sizeof (struct req_lib_ckpt_sectiondelete);
>  
>  	if (iovecs[1].iov_len > 0) {
> -		gmi_mcast (&aisexec_groupname, iovecs, 2, GMI_PRIO_MED);
> +		assert (gmi_mcast (&aisexec_groupname, iovecs, 2, GMI_PRIO_MED) == 0);
>  	} else {
> -		gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_MED);
> +		assert (gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_MED) == 0);
>  	}
>  
>  	return (0);
> @@ -1601,9 +1598,9 @@
>  
>  	if (iovecs[1].iov_len > 0) {
>  		log_printf (LOG_LEVEL_DEBUG, "IOV_BASE is %s\n", iovecs[1].iov_base);
> -		gmi_mcast (&aisexec_groupname, iovecs, 2, GMI_PRIO_LOW);
> +		assert (gmi_mcast (&aisexec_groupname, iovecs, 2, GMI_PRIO_LOW) == 0);
>  	} else {
> -		gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_LOW);
> +		assert (gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_LOW) == 0);
>  	}
>  
>  	return (0);
> @@ -1659,9 +1656,9 @@
>  
>  //printf ("LIB writing checkpoint section is %s\n", ((char *)req_lib_ckpt_sectionwrite) + sizeof (struct req_lib_ckpt_sectionwrite));
>  	if (iovecs[1].iov_len > 0) {
> -		gmi_mcast (&aisexec_groupname, iovecs, 2, GMI_PRIO_LOW);
> +		assert (gmi_mcast (&aisexec_groupname, iovecs, 2, GMI_PRIO_LOW) == 0);
>  	} else {
> -		gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_LOW);
> +		assert (gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_LOW) == 0);
>  	}
>  
>  	return (0);
> @@ -1714,9 +1711,9 @@
>  	iovecs[1].iov_len = req_lib_ckpt_sectionoverwrite->header.size - sizeof (struct req_lib_ckpt_sectionoverwrite);
>  
>  	if (iovecs[1].iov_len > 0) {
> -		gmi_mcast (&aisexec_groupname, iovecs, 2, GMI_PRIO_LOW);
> +		assert (gmi_mcast (&aisexec_groupname, iovecs, 2, GMI_PRIO_LOW) == 0);
>  	} else {
> -		gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_LOW);
> +		assert (gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_LOW) == 0);
>  	}
>  
>  	return (0);
> @@ -1769,9 +1766,9 @@
>  	iovecs[1].iov_len = req_lib_ckpt_sectionread->header.size - sizeof (struct req_lib_ckpt_sectionread);
>  
>  	if (iovecs[1].iov_len > 0) {
> -		gmi_mcast (&aisexec_groupname, iovecs, 2, GMI_PRIO_LOW);
> +		assert (gmi_mcast (&aisexec_groupname, iovecs, 2, GMI_PRIO_LOW) == 0);
>  	} else {
> -		gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_LOW);
> +		assert (gmi_mcast (&aisexec_groupname, iovecs, 1, GMI_PRIO_LOW) == 0);
>  	}
>  
>  	return (0);
> ===== exec/clm.c 1.15 vs edited =====
> --- 1.15/exec/clm.c	2004-09-18 00:01:36 -07:00
> +++ edited/exec/clm.c	2004-09-24 07:36:11 -07:00
> @@ -401,7 +401,7 @@
>  	 * Send node information to other nodes
>  	 */
>  	if (joined_list_entries) {
> -		clmNodeJoinSend ();
> +		assert (clmNodeJoinSend () == 0);
>  	}
>  	for (i = 0; i < left_list_entries; i++) {
>  		nodes[i] = left_list[i].sin_addr.s_addr;
> ===== exec/evs.c 1.3 vs edited =====
> --- 1.3/exec/evs.c	2004-09-23 15:09:32 -07:00
> +++ edited/exec/evs.c	2004-09-24 07:37:58 -07:00
> @@ -351,8 +351,8 @@
>  	req_exec_evs_mcast_iovec[2].iov_base = &req_lib_evs_mcast_joined->msg;
>  	req_exec_evs_mcast_iovec[2].iov_len = req_lib_evs_mcast_joined->msg_len;
>  	
> -	gmi_mcast (&aisexec_groupname, req_exec_evs_mcast_iovec, 3,
> -		req_lib_evs_mcast_joined->priority);
> +	assert (gmi_mcast (&aisexec_groupname, req_exec_evs_mcast_iovec, 3,
> +		req_lib_evs_mcast_joined->priority) == 0);
>  
>  	res_lib_evs_mcast_joined.header.size = sizeof (struct res_lib_evs_mcast_joined);
>  	res_lib_evs_mcast_joined.header.id = MESSAGE_RES_EVS_MCAST_JOINED;
> @@ -389,8 +389,8 @@
>  	req_exec_evs_mcast_iovec[2].iov_base = msg_addr;
>  	req_exec_evs_mcast_iovec[2].iov_len = req_lib_evs_mcast_groups->msg_len;
>  	
> -	gmi_mcast (&aisexec_groupname, req_exec_evs_mcast_iovec, 3,
> -		req_lib_evs_mcast_groups->priority);
> +	assert (gmi_mcast (&aisexec_groupname, req_exec_evs_mcast_iovec, 3,
> +		req_lib_evs_mcast_groups->priority) == 0);
>  
>  	res_lib_evs_mcast_groups.header.size = sizeof (struct res_lib_evs_mcast_groups);
>  	res_lib_evs_mcast_groups.header.id = MESSAGE_RES_EVS_MCAST_GROUPS;
> ===== exec/gmi.c 1.34 vs edited =====
> --- 1.34/exec/gmi.c	2004-09-20 17:56:47 -07:00
> +++ edited/exec/gmi.c	2004-09-24 07:22:56 -07:00
> @@ -989,6 +989,10 @@
>  		assert (iovec[i].iov_len < MESSAGE_SIZE_MAX);
>  	}
>  
> +	if (!gmi_send_ok(priority, total_size)) {
> +		return -1;
> +	}
> +
>  	packet_count = (total_size / packet_size);
>  
>  	gmi_log_printf (gmi_log_level_debug, "Message size is %d\n", total_size);




More information about the Openais mailing list