Commit Graph

16 Commits

Author SHA1 Message Date
Bin Liu
28f40c7fe0 Qnetd lms: Use UTILS_PRI_RING_ID printf format str
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2017-04-20 08:53:41 +02:00
Jan Friesse
b0c850f308 Qnetd LMS: Fix two partition use case
Solves situation when in 2 node cluster tie-breaker node dies. Because
code contains two bugs, other node got NACK instead of ACK.

- Algo timer is not stack, so calling abort and schedule in timer
callback without setting reschedule is noop.
- It's needed to check not only what current node thinks about
membership, but also what other nodes thinks. If views diverge -> wait.

Thanks Christine Caulfield <ccaulfie@redhat.com> for fixing the English
in the comments somewhat.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
2016-08-30 16:58:51 +02: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
Christine Caulfield
6cfe96eb03 qdevice-lms: improvements to LMS algorithm
Use the new timers to get better response from LMS when the network
splits, this also closes a race where the remote side could go inquorate
before we confirmed the vote.

Add client-side (qdevice-net) code to cope with a detached qnetd if we
are quorate and have wait_for_all enabled. THat situation will now
keep quorum.

Signed-off-by: Christine Caulfield <ccaulfie@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
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
5b097c818e algo-lms: some tidying
Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
2016-06-28 13:58:39 +02:00
Christine Caulfield
2ff2d136b1 qdevice: qnetd_algo_lms: Fix nominated tie_breaker node
Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
2016-06-28 13:58:39 +02:00
Christine Caulfield
5e457d9e0a qnetd: lms: Add support for other tie_breaker options.
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
98548e1880 qnetd: lms: Fix search for node/ring_id check
We were looking for us in other node lists, rather than
others in our nodelist.

Also, remove debug print in votequorum.c

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
2016-06-28 13:58:39 +02:00
Christine Caulfield
cd3a96f26a qnetd: Add LMS algorithm
Only lightly tested so far

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