[ovs-git] [openvswitch/ovs] 380699: raft.c: Election timer initial reset with value fr...

Han Zhou noreply at github.com
Fri Aug 23 21:43:43 UTC 2019


  Branch: refs/heads/branch-2.12
  Home:   https://github.com/openvswitch/ovs
  Commit: 380699d9588250ab6660521fd27aa5b893d662d8
      https://github.com/openvswitch/ovs/commit/380699d9588250ab6660521fd27aa5b893d662d8
  Author: Han Zhou <hzhou8 at ebay.com>
  Date:   2019-08-23 (Fri, 23 Aug 2019)

  Changed paths:
    M ovsdb/raft.c

  Log Message:
  -----------
  raft.c: Election timer initial reset with value from log.

After election timer is changed through cluster/change-election-timer
command, if a server restarts, it firstly initializes with the default
value and use it to reset the timer. Although it reads the latest
timer value later from the log, the first timeout may be much shorter
than expected by other servers that use latest timeout, and it would
start election before it receives the first heartbeat from the leader.

This patch fixes it by changing the order of reading log and resetting
timer so that the latest value is read from the log before the initial
resetting of the timer.

Fixes: commit 8e35461 ("ovsdb raft: Support leader election time change online.")
Signed-off-by: Han Zhou <hzhou8 at ebay.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>


  Commit: d133ffa98b2480b97f536fd9ba7f33ca9b3429a6
      https://github.com/openvswitch/ovs/commit/d133ffa98b2480b97f536fd9ba7f33ca9b3429a6
  Author: Han Zhou <hzhou8 at ebay.com>
  Date:   2019-08-23 (Fri, 23 Aug 2019)

  Changed paths:
    M Documentation/ref/ovsdb.5.rst
    M ovsdb/raft-private.c

  Log Message:
  -----------
  raft: Save and read new election timer in header snapshot.

This patch store the latest election timer in snapshot during log
compression, and when server restarts it reads the value from the log.
Without this, any previous changes to election timer will be lost
in the log, and if server restarts, it will use the default value
instead of the changed value.

Fixes: commit 8e35461 ("ovsdb raft: Support leader election time change online.")
Signed-off-by: Han Zhou <hzhou8 at ebay.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>


  Commit: e1f15d60c0827ed1ff3f6ee958188be75a1f09f0
      https://github.com/openvswitch/ovs/commit/e1f15d60c0827ed1ff3f6ee958188be75a1f09f0
  Author: Han Zhou <hzhou8 at ebay.com>
  Date:   2019-08-23 (Fri, 23 Aug 2019)

  Changed paths:
    M Documentation/ref/ovsdb.5.rst

  Log Message:
  -----------
  ovsdb.5.rst: Fix minor format problem.

Signed-off-by: Han Zhou <hzhou8 at ebay.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>


Compare: https://github.com/openvswitch/ovs/compare/e11151442781...e1f15d60c082


More information about the git mailing list