try to connect to range from 0 to max starting with begin */
| 2641 | |
| 2642 | /* try to connect to range from 0 to max starting with begin */ |
| 2643 | static inline int cdb2_try_connect_range(cdb2_hndl_tp *hndl, int begin, int max) |
| 2644 | { |
| 2645 | for (int j = 0; j < max; j++) { |
| 2646 | int i = (begin + j) % max; |
| 2647 | hndl->node_seq = i + 1; |
| 2648 | if (i == hndl->master || i == hndl->connected_host || hndl->hosts_connected[i] == 1) |
| 2649 | continue; |
| 2650 | if (newsql_connect(hndl, i) == 0) |
| 2651 | return 0; |
| 2652 | } |
| 2653 | return -1; |
| 2654 | } |
| 2655 | |
| 2656 | static int cdb2_get_dbhosts(cdb2_hndl_tp *hndl); |
| 2657 |
no test coverage detected