You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by mp...@apache.org on 2017/11/20 06:04:25 UTC

[2/2] kudu git commit: [RaftPeerPB] introduce attributes and health status

[RaftPeerPB] introduce attributes and health status

This standalone commit introduces changes to provide necessary interface
for the new 3-4-3 scheme of automated replica replacement.

Attributes and health report information has been added into the
RaftPeerPB message (which represents a tablet replica).

The 'health_report' is a non-persistent optional field which is populated
by leader replica.  It reflects the health of the replica as seen by
the leader.

The 'attrs' field is used as an umbrella for various per-replica
attributes.  The attributes are persisted along with other fields
for RaftPeerPB structure.  Right away, the 'promote' and 'replace'
attributes are introduced: they are necessary for the new scheme
of automated replica replacement:

  * 'promote' is applicable to non-voter replicas only.  When set
     to 'true', it makes the leader replica promoting the non-voter
     replica once it catches up with the leader's WAL.

  * 'replace' is applicable to voter replicas only.  When set, it means
    'replace the replica regardless of its health status'.
    This attribute is needed to provide the capability to manually move
    a replica from its current location using the kudu CLI tool
    (i.e. 'kudu tablet change_config move_replica ...').

Change-Id: Id82f838fd3612ab9bc3f91cac7a840cb9f36ff4c
Reviewed-on: http://gerrit.cloudera.org:8080/8561
Reviewed-by: Mike Percy <mp...@apache.org>
Tested-by: Mike Percy <mp...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/5bb3f430
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/5bb3f430
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/5bb3f430

Branch: refs/heads/master
Commit: 5bb3f430d01babe231b7d84ed42fe49a641af2ae
Parents: a8a7773
Author: Alexey Serbin <as...@cloudera.com>
Authored: Wed Nov 15 17:06:40 2017 -0800
Committer: Mike Percy <mp...@apache.org>
Committed: Mon Nov 20 06:03:25 2017 +0000

----------------------------------------------------------------------
 src/kudu/consensus/metadata.proto | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/5bb3f430/src/kudu/consensus/metadata.proto
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/metadata.proto b/src/kudu/consensus/metadata.proto
index 718d9eb..a310127 100644
--- a/src/kudu/consensus/metadata.proto
+++ b/src/kudu/consensus/metadata.proto
@@ -25,6 +25,32 @@ import "kudu/common/common.proto";
 //  Consensus Metadata
 // ===========================================================================
 
+// Per-replica attributes.
+message RaftPeerAttrsPB {
+  // Whether to promote a replica when it has caught up with the leader,
+  // changing its membership type from NON_VOTER to VOTER. This field is
+  // applicable only for NON_VOTER replicas.
+  optional bool promote = 1 [ default = false ];
+
+  // If set to 'true', the replica needs to be replaced regardless of
+  // its health report.
+  optional bool replace = 2 [ default = false ];
+}
+
+// Report on a replica's (peer's) health.
+message HealthReportPB {
+  enum HealthStatus {
+    UNKNOWN = 999;  // No information on the health status.
+    FAILED = 0;     // Replica has failed and needs replacement.
+    HEALTHY = 1;    // Replica is functioning properly.
+  }
+
+  // Overall health status of a replica. Reflects at least the responsiveness
+  // (i.e. time of last contact) and the lag of the replica's WAL
+  // behind the leader's.
+  optional HealthStatus overall_health = 1;
+}
+
 // A peer in a configuration.
 message RaftPeerPB {
   // The possible roles for peers.
@@ -56,6 +82,7 @@ message RaftPeerPB {
     NON_VOTER = 0;
     VOTER = 1;
   };
+
   // Permanent uuid is optional: RaftPeerPB/RaftConfigPB instances may
   // be created before the permanent uuid is known (e.g., when
   // manually specifying a configuration for Master/CatalogManager);
@@ -63,6 +90,13 @@ message RaftPeerPB {
   optional bytes permanent_uuid = 1;
   optional MemberType member_type = 2;
   optional HostPortPB last_known_addr = 3;
+
+  // Replica attributes.
+  optional RaftPeerAttrsPB attrs = 4;
+
+  // Replica's health report, as seen by the leader. This is a run-time
+  // only field, it should not be persisted or read from the persistent storage.
+  optional HealthReportPB health_report = 5;
 }
 
 // A set of peers, serving a single tablet.