Commit Graph

12 Commits

Author SHA1 Message Date
Bin Liu
5cf587554f Qdevice: fix spell errors in qdevice
There are somwe spell errors in qdevice-net-algo-test.c,
qnetd-algo-2nodelms.c, qnetd-algo-test.c qnetd-algo-ffsplit.c

Signed-off-by: Bin Liu <bliu@suse.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2016-12-12 11:32:20 +01:00
Jan Friesse
6f6c80f582 Qdevice: Send ring id in more messages
To prevent receiving vote from old membership ring id is sent to server
during init and replied back to client in every node list,
ask for vote reply and vote info messages.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:43 +02:00
Jan Friesse
59e2de05ef Qdevice: Add format macro for nodeid, ring, ...
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:41 +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
Christine Caulfield
c4090cba6a qnetd: Use ring_id, not client->last_ring_id in algorithms
ring_id should only be copied into the client structure after the
algorithm has run (so the last one is also available), so fix the
algorithms to use the passed-in ring_id where available.

Also tidy some debug logging in algo-lms

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
2016-06-28 13:58:39 +02:00
Jan Friesse
6c1add2925 Improve qdevice
- Add support for cmap node list configuration change
- Add client side algorithms
- Check if currently received ring id in membership message
  equals to last sent ring id
- Send config node list only if config node list really changes and not
  after every reload
- Add tlv_ring_id_eq (replacing qnetd_algo_rings_eq) so it's usable in
  client
- Move debug logs from algo-test into qnetd-log-debug.c and call them in
  proper places (= logs are now algorithm independent)
- Fix memory leak in msg

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:39 +02:00
Christine Caulfield
2f5ff28c4d qnetd-algo: Refactor common routines
Move several commonly used routines into their own
qnetd-algo-utils.[ch] files and change over to using
the ring_id held in the client structure rather than
managint it ourself.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
2016-06-28 13:58:39 +02:00
Christine Caulfield
b842be0f5f qnetd: Add tie_breaker options to 2nodelms
Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
2016-06-28 13:58:39 +02:00
Jan Friesse
8c0a45de41 qnet: Add TLV_VOTE_NO_CHANGE
State used for informative only callbacks (quorum node list) and
possibly informative only callbacks (configuration node list). Client
doesn't change cast vote timer state.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:39 +02:00
Jan Friesse
afa22646f9 qnet: Migrate to new votequorum API
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2016-06-28 13:58:39 +02:00
Christine Caulfield
9e2fb2492b qdevice: 2nodelms: don't split-brain when the primary node comes back.
Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
2016-06-28 13:58:39 +02:00
Christine Caulfield
a4fe280cbb qnetd: move 2nodelms algo files to the right directory
No, I don't know how that happened.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
2016-06-28 13:58:38 +02:00