Print this page
Try versioning as a new state

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/varpd/svp/common/libvarpd_svp.c
          +++ new/usr/src/lib/varpd/svp/common/libvarpd_svp.c
↓ open down ↓ 209 lines elided ↑ open up ↑
 210  210   *
 211  211   * The following diagram attempts to describe our state transition scheme, and
 212  212   * when we transition from one state to the next.
 213  213   *
 214  214   *                               |
 215  215   *                               * New remote IP from DNS resolution,
 216  216   *                               | not currently active in the system.
 217  217   *                               |
 218  218   *                               v                                Socket Error,
 219  219   *                       +----------------+                       still in DNS
 220      - *  +----------------<---| SVP_CS_INITIAL |<----------------------*-----+
 221      - *  |                    +----------------+                             |
 222      - *  |                            System  |                              |
 223      - *  | Connection . . . . .       success *               Successful     |
 224      - *  | failed             .               |               connect()      |
 225      - *  |               +----*---------+     |        +-----------*--+      |
 226      - *  |               |              |     |        |              |      |
 227      - *  |               V              ^     v        ^              V      ^
 228      - *  |  +----------------+         +-------------------+     +---------------+
 229      - *  +<-| SVP_CS_BACKOFF |         | SVP_CS_CONNECTING |     | SVP_CS_ACTIVE |
 230      - *  |  +----------------+         +-------------------+     +---------------+
 231      - *  |               V              ^  V                       V  V
 232      - *  | Backoff wait  *              |  |                       |  * Removed
 233      - *  v interval      +--------------+  +-----------------<-----+  | from DNS
      220 + *  +----------------<---| SVP_CS_INITIAL |<----------------------*--------+
      221 + *  |                    +----------------+                                |
      222 + *  |                            System  |                                 |
      223 + *  | Connection . . . . .       success *     Successful                  |
      224 + *  | failed             .               |     connect()                   |
      225 + *  |                    .               |        +-------------------+    |
      226 + *  |               +----*---------+     |    +-*>| SVP_CS_VERSIONING +    |
      227 + *  |               |              |     |    |   +-------------------+    |
      228 + *  |               |              |     |    |          V   V Set version |
      229 + *  |               |              |     |    |          |   * based on    |
      230 + *  |               |              |     |    |          |   | SVP_R_PONG  |
      231 + *  |               V              ^     v    ^          |   V             ^
      232 + *  |  +----------------+         +-------------------+  |  +---------------+
      233 + *  +<-| SVP_CS_BACKOFF |         | SVP_CS_CONNECTING |  |  | SVP_CS_ACTIVE |
      234 + *  |  +----------------+         +-------------------+  |  +---------------+
      235 + *  |               V              ^  V                  |    V  V
      236 + *  | Backoff wait  *              |  |                  |    |  * Removed
      237 + *  v interval      +--------------+  +-----------------<+----+  | from DNS
 234  238   *  | finished                        |                          |
 235  239   *  |                                 V                          |
 236  240   *  |                                 |                          V
 237  241   *  |                                 |            +-----------------+
 238  242   *  +----------------+----------<-----+-------<----| SVP_CS_WINDDOWN |
 239  243   *                   |                             +-----------------+
 240  244   *                   * . . .   Fatal system, not
 241  245   *                   |         socket error or
 242  246   *                   V         quiesced after
 243  247   *           +--------------+  removal from DNS
↓ open down ↓ 1175 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX