Commit Graph

17 Commits

Author SHA1 Message Date
Jan Friesse
c9584c965f Qdevice: Enhance delay before reconnect
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:43 +02:00
Jan Friesse
8516ee8ffd Qdevice: Correct API comments
Also after votequorum node list is received and qnetd is connected,
default vote is changed to WAIT_FOR_REPLY. This make much more sense
because it ensures qdevice doesn't vote with new ring id until qnetd
sends reply.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:42 +02:00
Jan Friesse
e7beaad5e0 Qdevice: Add expected votes notify callback API
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:42 +02:00
Jan Friesse
41d6d1e438 Qdevice: Add advanced settings
All previously defined defaults are now configurable via -S option.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:42 +02:00
Jan Friesse
d3059b855d qdevice: Make sure qdevice exists on corosync exit
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:42 +02:00
Jan Friesse
0552b339d1 Qdevice: Support for IPC status cmd in net model
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:41 +02:00
Jan Friesse
40ca891974 qdevice: Improve socket based IPC
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:41 +02:00
Jan Friesse
cfe273b275 qdevice: Remove compiler warning
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:40 +02:00
Jan Friesse
ea7611a9dd qdevice: Add support for daemonize
Also local unix socket is now created. In future this is going to be
used for qdevice-tool, for now it's used only for handling SIGINT and
SIGTERM.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:40 +02:00
Jan Friesse
1ec61e33cc qdevice-net: Add option to force ip version
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:40 +02:00
Jan Friesse
5cc52fe3cb qnetd: Add dead peer (client) detection
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:40 +02:00
Jan Friesse
9e2310c5ad qdevice: Wait a while before reconnect
It's viable to give qnetd a little time before client tries reconnect.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:40 +02:00
Jan Friesse
0c9df248f8 qdevice: Force send of heartbeat
Previously client was not force to use heartbeat. Because we have to be
able to detect dead client in qnetd, heartbeat setting is now forced.
Insted of set_option message, heartbeat is force to exists in init
message. This also means that
QDEVICE_NET_INSTANCE_STATE_WAITING_SET_OPTION_REPLY can be removed and
client is considered as connected after init_reply is received. So
currently, set_option is not used (but implementation of these two
messages still exists).

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:40 +02:00
Jan Friesse
04ac73018e qnetd: Add support for qnetd algo timer
Algo timer is simplified timer designed for qnetd algorithm. Instead of
full timer only one can exists per client. Workflow is:
- In one of algorithm callbacks qnetd_client_algo_timer_schedule is
  called
- On timeout .timer_callback is called (for example
  qnetd_algo_test_timer_callback). It's possible to set send_vote and
  result_vote to send vote info to client
- It's possible to discard timer by calling
  qnetd_client_algo_timer_abort

Timer is automatically deleted on client disconnect.

To make all this possible, qnetd main loop now has support for
timer-list (main_timer_list). To be able to handle error and disconnect
client from timer callback, client has schedule_disconnect. If this is
set to 1, client is disconnected on current call of poll loop.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:40 +02:00
Jan Friesse
3179ccfdba qdevice-net: Allow connect to choose lists to send
Also disconnect and connect can now affect vote timer.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:40 +02:00
Jan Friesse
3ff96e8d56 qdevice-net: Ensure to free non blocking client
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:40 +02:00
Jan Friesse
131cfbe4ae Refactor qdevice-net
- corosync-device-net as binary is gone. Replacement is
  corosync-qdevice
- corosync-qdevice has support for multiple models (only net is
  currently implemented)
- Completelly redesign qdevice-net main loop.
  - Connect is non blocking
  - Cmap and Votequorum events are handled even before connect to
    qnetd. Algorithm gets send_node_list and vote set so it's not needed
    to check connection status and also vote_timer is running and voting
    until something changes (configuration or votequorum node list)
  - If connect fails, algorithm_disconnected with new reason
    CANT_CONNECT_TO_THE_SERVER is called
- Logging for qdevice is based on libqb logging functions. Also
  logging configuration from corosync.conf is now used and dynamic
  changes of configuration are handled.
- Added qdevice_net_algorithm_config_node_list_changed
- Changed qdevice_net_algorithm_votequorum_node_list_notify in respect
  of adding  send_node_list so it's similar to other functions.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:40 +02:00