typedef void(* nn::nex::PromotionReferee::ComputeAffinityCallback)(DOHandle hObject, qByte *pbyAffinity, TimeInterval *ptiWaitTime);
The typedef
for ComputeAffinityCallback
.
The default levels of affinity are: 100 for server processes, 50 for client processes, and 0 for tool processes. The session master gets additional 10 points as a bonus. Unknown processes are treated as client processes by default. Accordingly, server processes have precedence over client processes and tool processes as the location where objects will be migrated. If PromotionReferee
is called by a number of processes that have the same level of affinity, the station that called PromotionReferee
first gets selected as the new duplication master.
The wait time
makes PromotionReferee
wait and prolongs the time before the selected station gets declared as the new duplication master. This is done to be prepared for situations where another station with even higher affinity is late responding to the fault.
The default ptiWaitTime
is 1,000 milliseconds for tool processes (because it is strongly desired for a non-tool process to have control over objects), 500 ms for a client process, and 0 ms for a server process. Consequently, if a server process reports to PromotionReferee
that it will look after the orphaned objects, that function call is returned.
After a fault occurs, the station from which PromotionReferee
receives the first migration request is marked as the best selection for becoming the new duplication master, and then PromotionReferee
waits for just the specified wait time
to determine whether a request comes from a station with a higher level affinity. If no other request comes, that first station is approved as the new duplication master and object migration proceeds. If, on the other hand, a request comes from a station with a higher level affinity, that station now becomes the one marked as best selection and then PromotionReferee
waits for that appropriate wait time
before approving that station as the new duplication master. This process continues until wait time
expires, at which point PromotionReferee
makes its final decision and all subsequent requests are ignored. Once PromotionReferee
has decided on a new duplication master station, the attempt is made to migrate to this new master station.
Note: This method is applied to user duplicated objects that are not well-known objects.
CONFIDENTIAL