diff --git a/doc/mgmt/gnmi/SONiC_GNMI_Server_Interface_Design.md b/doc/mgmt/gnmi/SONiC_GNMI_Server_Interface_Design.md index d97234ba3a..817ecfd2d8 100644 --- a/doc/mgmt/gnmi/SONiC_GNMI_Server_Interface_Design.md +++ b/doc/mgmt/gnmi/SONiC_GNMI_Server_Interface_Design.md @@ -441,18 +441,42 @@ 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: 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: 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 +``` + +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