[Tarantool-patches] [PATCH v2 01/10] applier: store instance_id in struct applier

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Tue Sep 8 01:54:11 MSK 2020


Hi! Thanks for the review!

>> diff --git a/src/box/applier.cc b/src/box/applier.cc
>> index c1d07ca54..699b5a683 100644
>> --- a/src/box/applier.cc
>> +++ b/src/box/applier.cc
>> @@ -67,6 +67,23 @@ applier_set_state(struct applier *applier, enum applier_state state)
>>       trigger_run_xc(&applier->on_state, applier);
>>   }
>>   +static inline void
>> +applier_assign_instance_id(struct applier *applier)
> Maybe call it `applier_set_id`? This way it's shorter and resembles `replica_set_id`.

Indeed, that looks better.

====================
diff --git a/src/box/applier.cc b/src/box/applier.cc
index 699b5a683..db17c7338 100644
--- a/src/box/applier.cc
+++ b/src/box/applier.cc
@@ -68,7 +68,7 @@ applier_set_state(struct applier *applier, enum applier_state state)
 }
 
 static inline void
-applier_assign_instance_id(struct applier *applier)
+applier_set_id(struct applier *applier)
 {
 	/*
 	 * After final join, the applier already received latest
@@ -620,7 +620,7 @@ applier_join(struct applier *applier)
 	say_info("final data received");
 
 	applier_set_state(applier, APPLIER_JOINED);
-	applier_assign_instance_id(applier);
+	applier_set_id(applier);
 	applier_set_state(applier, APPLIER_READY);
 }
 
@@ -1225,7 +1225,7 @@ applier_subscribe(struct applier *applier)
 		    instance_id != REPLICA_ID_NIL) {
 			say_info("final data received");
 			applier_set_state(applier, APPLIER_JOINED);
-			applier_assign_instance_id(applier);
+			applier_set_id(applier);
 			applier_set_state(applier, APPLIER_READY);
 			applier_set_state(applier, APPLIER_FOLLOW);
 		}


More information about the Tarantool-patches mailing list