Просмотр исходного кода

defect 628
saCkptCheckpointStatusGet test case 13 from saftest fails

(Logical change 1.209)


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@675 fd59a12c-fef9-0310-b244-a6a79926bd2f

Steven Dake 20 лет назад
Родитель
Сommit
3f05a6fd64
3 измененных файлов с 16 добавлено и 2 удалено
  1. 14 1
      exec/ckpt.c
  2. 1 0
      exec/ckpt.h
  3. 1 1
      lib/ckpt.c

+ 14 - 1
exec/ckpt.c

@@ -1055,6 +1055,14 @@ static int message_handler_req_exec_ckpt_checkpointopen (void *message, struct i
 		ckptCheckpoint->referenceCount = 0;
 		ckptCheckpoint->retention_timer = 0;
 		ckptCheckpoint->expired = 0;
+		
+		if ((ckptCheckpoint->checkpointCreationAttributes.creationFlags & SA_CKPT_WR_ALL_REPLICAS) == 1 &&
+			(ckptCheckpoint->checkpointCreationAttributes.creationFlags & SA_CKPT_CHECKPOINT_COLLOCATED) == 0) {
+			ckptCheckpoint->active_replica_set = 1;
+		} else {
+			ckptCheckpoint->active_replica_set = 0;
+		}
+		
 		initialize_ckpt_refcount_array(ckptCheckpoint->ckpt_refcount);
 
 		/*
@@ -2345,6 +2353,7 @@ static int message_handler_req_lib_ckpt_activereplicaset (struct conn_info *conn
 		(checkpoint->checkpointCreationAttributes.creationFlags & (SA_CKPT_WR_ACTIVE_REPLICA | SA_CKPT_WR_ACTIVE_REPLICA_WEAK)) == 0) {
 		error = SA_AIS_ERR_BAD_OPERATION;
 	}
+	checkpoint->active_replica_set = 1;
 	res_lib_ckpt_activereplicaset.header.size = sizeof (struct res_lib_ckpt_activereplicaset);
 	res_lib_ckpt_activereplicaset.header.id = MESSAGE_RES_CKPT_ACTIVEREPLICASET;
 	res_lib_ckpt_activereplicaset.header.error = error;
@@ -2387,7 +2396,11 @@ static int message_handler_req_lib_ckpt_checkpointstatusget (struct conn_info *c
 	 */
 	res_lib_ckpt_checkpointstatusget.header.size = sizeof (struct res_lib_ckpt_checkpointstatusget);
 	res_lib_ckpt_checkpointstatusget.header.id = MESSAGE_RES_CKPT_CHECKPOINT_CHECKPOINTSTATUSGET;
-	res_lib_ckpt_checkpointstatusget.header.error = SA_AIS_OK;
+	if (checkpoint->active_replica_set == 1) {
+		res_lib_ckpt_checkpointstatusget.header.error = SA_AIS_OK;
+	} else {
+		res_lib_ckpt_checkpointstatusget.header.error = SA_AIS_ERR_NOT_EXIST;
+	}
 
 	memcpy (&res_lib_ckpt_checkpointstatusget.checkpointDescriptor.checkpointCreationAttributes,
 		&checkpoint->checkpointCreationAttributes,

+ 1 - 0
exec/ckpt.h

@@ -61,6 +61,7 @@ struct saCkptCheckpoint {
 	int unlinked;
 	poll_timer_handle retention_timer;
 	int expired;
+	int active_replica_set;
 	struct ckpt_refcnt ckpt_refcount[PROCESSOR_COUNT_MAX];	
 };
 

+ 1 - 1
lib/ckpt.c

@@ -853,7 +853,7 @@ saCkptCheckpointStatusGet (
 
 error_exit:
 	saHandleInstancePut (&checkpointHandleDatabase, checkpointHandle);
-	return (error);
+	return (error == SA_AIS_OK ? res_lib_ckpt_checkpointstatusget.header.error : error);
 }
 
 SaAisErrorT