UniInt End User


Interfaces Connect to Data Source at Approximately the Same Time



Download 1.93 Mb.
Page75/79
Date29.09.2022
Size1.93 Mb.
#59623
1   ...   71   72   73   74   75   76   77   78   79
UniInt Interface User Manual
PI BASemAPI

Interfaces Connect to Data Source at Approximately the Same Time


There may be a chance where both copies of the interface connect to the data source at approximately the same time and contend to become the primary interface. For example, both interfaces are running and then the data source is started, or both copies of the interface are started at the same time. If the data source is unavailable and the interface is running, attempts to update the failover control points will return an error. If the interface receives errors reading from or writing to the data source, it will transition to the backup role. At start-up, the interface starts in the backup role. It initially checks the value of the active ID point and the heartbeat point of the other copy of the interface. The value of the active ID point will be one of three values: the failover ID for this copy of the interface, the other copy’s failover ID, or something else. These three scenarios are discussed below.

  • If the ActiveID equals the failover ID for this copy of the interface, the interface transitions to the primary role and starts sending data to PI. In this situation, it will take two failover update intervals for data to show up in PI. This is because the interface actually transitions to the AssumingControl state for two intervals and queues its data. No data is lost during this two failover update interval start-up delay. The delay is used to prevent contention between the two interfaces trying to assume the role of primary at the same time.

  • If the ActiveID equals the failover ID for the other copy of the interface, the interface stays in the backup role and starts monitoring the heartbeat of the other copy. For example, if both copies of the interface are down and then one copy is started and the active ID point is equal to the other copy’s failover ID, it will take four update intervals for its data to show up in PI. This is because the interface assumes the backup role at startup and waits to verify the other copy’s heartbeat. If the other copy’s heartbeat point is not being updated, this copy will go through the process of assuming the role of primary. All data collected by the interface during this four interval start-up delay will be sent to PI.

  • If the ActiveID equals something other than this copy’s or the other copy’s failover ID, the interface transitions to the AssumingControl state. Again, the interface will stay in this state for up to two failover update intervals to avoid contention. For example, if interface IF1 reads the ActiveID, then interface IF2 reads the ActiveID before interface IF1’s update takes place. Interface IF1 will claim primary by setting the ActiveID to its failover ID. Interface IF2 will claim primary by setting the ActiveID to its failover ID. Then both copies wait one failover update interval and read the value of the active ID point. If the ActiveID has changed to the other copy’s failover ID, the interface will transition to the backup role. If the ActiveID is still equal to this copy’s failover ID, the interface will wait one more interval. If, after two intervals, the ActiveID still equals this copy’s failover ID, the interface will transition into the primary role and send the data it has queued during this process.

In any of the situations where a backup assumes control by updating the active ID point, the update takes place immediately after reading the point. The two interval delay resolves the collision problem and will only be an issue if both interfaces read the value of the active ID point before the update reaches the data source. If the latency for a write is more than two failover update intervals, then the failover update interval should be increased. This algorithm results in the last interface to make the update to the active ID point remaining the primary interface.
Refer to Figure 7,below which describes the failover action when both interface copies start at the same time and the latency for an update to the data source is equal to one half of an update interval.





Time

Action

T+0

Neither interface is running

T+1

Event A: IF1 starts and notices the active ID point is 0 so it transitions to active and writes a 1 to the active ID point.

T+1.25

Event B: IF2 starts and notices the active ID point is 0 so it transitions to active and writes a 2 to the active ID.

T+1.5

Event C: the update from IF1 reaches the data source

T+2

Event D: IF1 reads a 1 for the active ID point. Immediately after this, the update from IF2 reaches the data source.

T+2.5

IF2 reads a 2 for the active ID point and remains in the active mode.

T+3

IF1 reads a 2 for the active ID and immediately transitions to the backup role.

The last interface to update the active ID point is the interface that will remain in the primary role.



Figure 7: Timing chart for both interfaces starting at the same time.

Download 1.93 Mb.

Share with your friends:
1   ...   71   72   73   74   75   76   77   78   79




The database is protected by copyright ©ininet.org 2024
send message

    Main page