From b56b66d6e07d172a12171d5c8de7747c75cd52d4 Mon Sep 17 00:00:00 2001 From: Roman Dodin Date: Tue, 3 Oct 2023 13:42:49 +0300 Subject: [PATCH 1/3] commit confirmed initial version commit confirmed initial version moved commit confirmed messages to gnmi_ext file and removed "request suffix" from CommitConfirmed message moved commit confirmed messages to gnmi_ext file and removed "request suffix" from CommitConfirmed message added default rollback timeout clarifications added comments for CommitConfirmedAction enum values and changed ACTION_ACCEPT to ACTION_CONFIRM added comments for commitID message provided link to a future reference doc for the CommitConfirmed message clarified COMMIT_CONFIRMED_ACTION_START for an existing commit aligned file name with existing files fixed wrong doc ref --- proto/gnmi_ext/gnmi_ext.proto | 47 +++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/proto/gnmi_ext/gnmi_ext.proto b/proto/gnmi_ext/gnmi_ext.proto index 142fe1d2..b2d8ba66 100644 --- a/proto/gnmi_ext/gnmi_ext.proto +++ b/proto/gnmi_ext/gnmi_ext.proto @@ -21,6 +21,8 @@ syntax = "proto3"; // extensions defined outside of this package. package gnmi_ext; +import "google/protobuf/duration.proto"; + option go_package = "github.com/openconfig/gnmi/proto/gnmi_ext"; // The Extension message contains a single gNMI extension. @@ -30,6 +32,7 @@ message Extension { // Well known extensions. MasterArbitration master_arbitration = 2; // Master arbitration extension. History history = 3; // History extension. + CommitConfirmed commit_confirmed = 4; // Commit Confirmed extension. } } @@ -89,3 +92,47 @@ message TimeRange { int64 start = 1; // Nanoseconds since the epoch int64 end = 2; // Nanoseconds since the epoch } + +// The CommitID is returned by the gNMI server to indicate the ID of a commit. +// It is returned in response to the Set Request with the CommitConfirm message +// that had COMMIT_CONFIRMED_ACTION_START set. +// The CommitID is used in the subsequent SetRequest/CommitConfirm messages +// to identify commit to be confirmed, reset or rejected. +message CommitID { + string id = 1; +} + +// The CommitConfirmed allows automatic rollback of a commit +// if Set changes are not confirmed within the specified timeout. +// The document about gNMI commit confirmed can be found at +// https://github.com/openconfig/reference/blob/master/rpc/gnmi/gnmi-commit-confirmed.md +message CommitConfirmed { + CommitConfirmedAction action = 1; + // rollback timeout duration expressed in seconds and nanoseconds. + // If timeout is not set (or seconds and ns are both 0), then + // the default gNMI server's rollback timeout duration is used. + google.protobuf.Duration timeout = 2; + // CommitID from commit for ACCEPT or REJECT + CommitID commit_id = 3; +} + +// A COMMIT_CONFIRMED_ACTION_START starts a commit with a configured rollback +// timeout and will return the CommitID assigned by the server. The CommitID is +// used to identify the current commit. The COMMIT_CONFIRMED_ACTION_CONFIRM and +// COMMIT_CONFIRMED_ACTION_REJECT confirms or cancels a commit using the +// commit_id. +enum CommitConfirmedAction { + // gNMI server should return InvalidArgument error if the action is not + // specified for a CommitConfirmed extension. + COMMIT_CONFIRMED_ACTION_UNSPECIFIED = 0; + // Starts a commit with a specified rollback timeout + // or resets the timeout for the commit that has confirmation pending. + COMMIT_CONFIRMED_ACTION_START = 1; + // Confirm a commit identified by CommitID. + COMMIT_CONFIRMED_ACTION_CONFIRM = 2; + // Reject a commit identified by CommitID + // for which rollback timeout has not expired. + // If no active commit with the non expired rollback timeout is found, + // gNMI server should return InvalidArgument error. + COMMIT_CONFIRMED_ACTION_REJECT = 3; +} \ No newline at end of file From f71b0714e256b552c18078be50c69d11857a8f30 Mon Sep 17 00:00:00 2001 From: Roman Dodin Date: Wed, 11 Oct 2023 15:57:40 +0300 Subject: [PATCH 2/3] added newline --- proto/gnmi_ext/gnmi_ext.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto/gnmi_ext/gnmi_ext.proto b/proto/gnmi_ext/gnmi_ext.proto index b2d8ba66..51978108 100644 --- a/proto/gnmi_ext/gnmi_ext.proto +++ b/proto/gnmi_ext/gnmi_ext.proto @@ -135,4 +135,4 @@ enum CommitConfirmedAction { // If no active commit with the non expired rollback timeout is found, // gNMI server should return InvalidArgument error. COMMIT_CONFIRMED_ACTION_REJECT = 3; -} \ No newline at end of file +} From f619867ef6028a4de774b88fab93d6d7bca60656 Mon Sep 17 00:00:00 2001 From: Roman Dodin Date: Tue, 24 Oct 2023 18:31:13 +0200 Subject: [PATCH 3/3] mention rollback for a reject action Co-authored-by: Darren Loher --- proto/gnmi_ext/gnmi_ext.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto/gnmi_ext/gnmi_ext.proto b/proto/gnmi_ext/gnmi_ext.proto index 51978108..2a1ea82a 100644 --- a/proto/gnmi_ext/gnmi_ext.proto +++ b/proto/gnmi_ext/gnmi_ext.proto @@ -130,7 +130,7 @@ enum CommitConfirmedAction { COMMIT_CONFIRMED_ACTION_START = 1; // Confirm a commit identified by CommitID. COMMIT_CONFIRMED_ACTION_CONFIRM = 2; - // Reject a commit identified by CommitID + // Reject and rollback a commit identified by CommitID // for which rollback timeout has not expired. // If no active commit with the non expired rollback timeout is found, // gNMI server should return InvalidArgument error.