4
0
Эх сурвалжийг харах

Be more flexible (correct) with flowcontrol.

Many functions do not require flowcontrol and are two-way
so they can get failures from corosync.
Only cpg_mcast_joined() _really_ needs the current level
of flowcontrol.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
Angus Salkeld 14 жил өмнө
parent
commit
a748700cde
2 өөрчлөгдсөн 6 нэмэгдсэн , 2 устгасан
  1. 4 2
      exec/ipc_glue.c
  2. 2 0
      lib/cpg.c

+ 4 - 2
exec/ipc_glue.c

@@ -733,7 +733,7 @@ static void cs_ipcs_check_for_flow_control(void)
 		if (ais_service[i] == NULL || ipcs_mapper[i].inst == NULL) {
 			continue;
 		}
-		fc_enabled = QB_TRUE;
+		fc_enabled = QB_IPCS_RATE_OFF;
 		if (ipc_fc_is_quorate == 1 ||
 			ais_service[i]->allow_inquorate == CS_LIB_ALLOW_INQUORATE) {
 			/*
@@ -743,10 +743,12 @@ static void cs_ipcs_check_for_flow_control(void)
 			if (ipc_fc_totem_queue_level != TOTEM_Q_LEVEL_CRITICAL &&
 				ipc_fc_sync_in_process == 0) {
 				fc_enabled = QB_FALSE;
+			} else {
+				fc_enabled = QB_IPCS_RATE_OFF_2;
 			}
 		}
 		if (fc_enabled) {
-			qb_ipcs_request_rate_limit(ipcs_mapper[i].inst, QB_IPCS_RATE_OFF);
+			qb_ipcs_request_rate_limit(ipcs_mapper[i].inst, fc_enabled);
 
 			qb_loop_timer_add(cs_poll_handle_get(), QB_LOOP_MED, 1*QB_TIME_NS_IN_MSEC,
 			       NULL, corosync_recheck_the_q_level, &ipcs_check_for_flow_control_timer);

+ 2 - 0
lib/cpg.c

@@ -940,7 +940,9 @@ cs_error_t cpg_mcast_joined (
 	iov[0].iov_len = sizeof (struct req_lib_cpg_mcast);
 	memcpy (&iov[1], iovec, iov_len * sizeof (struct iovec));
 
+	qb_ipcc_fc_enable_max_set(cpg_inst->c,  2);
 	error = qb_to_cs_error(qb_ipcc_sendv(cpg_inst->c, iov, iov_len + 1));
+	qb_ipcc_fc_enable_max_set(cpg_inst->c,  1);
 
 	hdb_handle_put (&cpg_handle_t_db, handle);