From 9cf81522518dc97cbd84f9ae196b0122565d3c5e Mon Sep 17 00:00:00 2001 From: ganglyu Date: Tue, 29 Oct 2024 06:04:20 +0000 Subject: [PATCH 1/3] Improve gnmi full config update --- .../SONiC_GNMI_Server_Interface_Design.md | 40 +++++++++++++------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/doc/mgmt/gnmi/SONiC_GNMI_Server_Interface_Design.md b/doc/mgmt/gnmi/SONiC_GNMI_Server_Interface_Design.md index d97234ba3ad..73d33001d07 100644 --- a/doc/mgmt/gnmi/SONiC_GNMI_Server_Interface_Design.md +++ b/doc/mgmt/gnmi/SONiC_GNMI_Server_Interface_Design.md @@ -441,18 +441,34 @@ For incremental configuration, 'config apply-patch' should not restart gNMI, bgp ##### 1.2.1.11.2 Full Configurations -For full configuration, there’re 2 possible solutions: -* gNMI server needs to send response at first, and then invoke 'config reload'. - -full-gnmi - -* Use gNMI request and gNOI request together to implement full configuration update. - -full-gnmi-gnoi - -The full configuration request will be overwritten by subsequent full configuration request or incremental configuration request. - -overwritten-config +We will use single gnmi request to support full configuration update. +1. The host service will perform YANG validation and return an error if it fails. +2. The host service will mask the gNMI service, preventing it from restarting after a config reload. +3. The host service will execute a config reload using the input configuration. +4. The host service will execute a config save if step 3 is successful. +5. The host service will perform a config reload to recover if step 3 fails. +6. The host service will unmask the gNMI service. + +```mermaid +sequenceDiagram + participant client + box SONiC + participant gnmi server + participant host service + end + client->>gnmi server: update full configuration + gnmi server->>host service: reload configuration + host service->>host service: run yang validation, return if failed + host service->>host service: mask gnmi service + host service->>host service: run config reload with input config + host service->>host service: if config reload suceeded, run config save + host service->>host service: if config reload failed, run config reload to recover + host service->>host service: unmask gnmi service + host service-->>gnmi server: result + gnmi server-->>client: result +``` + +One limitation is that we can't restart the gNMI server. Therefore, if we update the configuration for the gNMI server, the changes will not take effect. #### 1.2.1.12 Backward Compatibility From 18b9ca5b1419516a53d953691f498fa651ebff26 Mon Sep 17 00:00:00 2001 From: ganglyu Date: Tue, 29 Oct 2024 06:12:39 +0000 Subject: [PATCH 2/3] Fix flow chart --- .../gnmi/SONiC_GNMI_Server_Interface_Design.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/doc/mgmt/gnmi/SONiC_GNMI_Server_Interface_Design.md b/doc/mgmt/gnmi/SONiC_GNMI_Server_Interface_Design.md index 73d33001d07..a7bdac057b9 100644 --- a/doc/mgmt/gnmi/SONiC_GNMI_Server_Interface_Design.md +++ b/doc/mgmt/gnmi/SONiC_GNMI_Server_Interface_Design.md @@ -457,12 +457,20 @@ sequenceDiagram participant host service end client->>gnmi server: update full configuration - gnmi server->>host service: reload configuration - host service->>host service: run yang validation, return if failed + gnmi server->>host service: run yang validation + host service->>host service: run yang validation + host service-->>gnmi server: result + gnmi server->>host service: run config reload with input config host service->>host service: mask gnmi service host service->>host service: run config reload with input config - host service->>host service: if config reload suceeded, run config save - host service->>host service: if config reload failed, run config reload to recover + host service->>host service: unmask gnmi service + host service-->>gnmi server: result + gnmi server->>host service: if config reload suceeded, run config save + host service->>host service: run config save + host service-->>gnmi server: result + gnmi server->>host service: if config reload failed, run config reload to recover + host service->>host service: mask gnmi service + host service->>host service: run config reload -f host service->>host service: unmask gnmi service host service-->>gnmi server: result gnmi server-->>client: result From 46fa9564256bff445b55fec3917c55f1e235424d Mon Sep 17 00:00:00 2001 From: ganglyu Date: Mon, 4 Nov 2024 00:57:31 +0000 Subject: [PATCH 3/3] Update limitation --- doc/mgmt/gnmi/SONiC_GNMI_Server_Interface_Design.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/mgmt/gnmi/SONiC_GNMI_Server_Interface_Design.md b/doc/mgmt/gnmi/SONiC_GNMI_Server_Interface_Design.md index a7bdac057b9..817ecfd2d89 100644 --- a/doc/mgmt/gnmi/SONiC_GNMI_Server_Interface_Design.md +++ b/doc/mgmt/gnmi/SONiC_GNMI_Server_Interface_Design.md @@ -476,7 +476,7 @@ sequenceDiagram gnmi server-->>client: result ``` -One limitation is that we can't restart the gNMI server. Therefore, if we update the configuration for the gNMI server, the changes will not take effect. +One limitation is that we can't restart the gNMI server. Therefore, if we update the configuration for the gNMI server, the changes will not take effect. And we can use gNOI reboot request to apply the whole configurations. #### 1.2.1.12 Backward Compatibility