From 3f6be7402578f0f8e3de020762067412cd065857 Mon Sep 17 00:00:00 2001 From: Christian Hopps Date: Tue, 8 Apr 2025 07:04:19 +0000 Subject: [PATCH] doc: add a diagram for config datastore cleanup on file reads Signed-off-by: Christian Hopps --- doc/developer/mgmtd-dev.rst | 5 + doc/figures/datastores.drawio | 291 ++++++++++++++++++++++++++++++++++ doc/figures/datastores.svg | 3 + 3 files changed, 299 insertions(+) create mode 100644 doc/figures/datastores.drawio create mode 100644 doc/figures/datastores.svg diff --git a/doc/developer/mgmtd-dev.rst b/doc/developer/mgmtd-dev.rst index f113d1b521..554f767c39 100644 --- a/doc/developer/mgmtd-dev.rst +++ b/doc/developer/mgmtd-dev.rst @@ -429,3 +429,8 @@ The client and server sides of oper-state query .. figure:: ../figures/cli-oper-state.svg :align: center + +Config datastore cleanup for non-implict commits (i.e., file reads currently) + +.. figure:: ../figures/datastores.svg + :align: center diff --git a/doc/figures/datastores.drawio b/doc/figures/datastores.drawio new file mode 100644 index 0000000000..5e17087196 --- /dev/null +++ b/doc/figures/datastores.drawio @@ -0,0 +1,291 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/figures/datastores.svg b/doc/figures/datastores.svg new file mode 100644 index 0000000000..41f612fc68 --- /dev/null +++ b/doc/figures/datastores.svg @@ -0,0 +1,3 @@ + + +
nb_candidate_commit_apply()
nb_candidate_commit_apply()
Daemon CLI Parsing (lib/vty.c)
Daemon CLI Parsing (lib/vty.c)
mgmtd
(new config path)
mgmtd...
vty_shared_
candidate_config
vty_shared_...
running_config
running_config
B daemon (old direct vty)
B daemon (old direct vty)
vty_shared_
candidate_config
vty_shared_...
running_config
running_config
A daemon (old direct vty)
A daemon (old direct vty)
running_config
running_config
vty_mgmt_
candidate_config
vty_mgmt_...
mm->running
mm->running
mm->candidate
mm->candidate
vty_config_entry()
vty_config_entry()
vty_shared_
candidate_config
vty_shared_...
CLI: config_exclusive()
(northbound_cli.c)
CLI: config_exclusive()...
CLI: config_private()
(northbound_cli.c)
CLI: config_private()...
vty_config_entry()
vty_config_entry()
private_config
private_config
2
2
1
1
1: (mgmtd only)
1: (mgmtd only)
CLI: config_terminal()
(command.c)
CLI: config_terminal(...

vty_read_config()
vty_read_config()
vty_apply_config()
vty_apply_config()
"copy FILE to rrunning"
"copy FILE to rrunning"
vtysh_main.c: main()
vtysh_main.c: main()
VTYSH
VTYSH
vty_read_file()
"conf term file-lock"
vty_read_file()...
lock mm->candidate
lock mm->candidate
If we don't lock for non-mgmtd then
multiple vtysh conf t are allowed!
If we don't lock for non-mgmtd then...
vty_config_node_exit()
vty_config_node_exit()
pendign == true
pendign == true
   nb_cli_pending_commit_check()

nb_cli_pending_commit_check...
success
success
nb_cli_classic_commit()
nb_cli_classic_commit()
fail
fail
nb_candidate_commit_prepare()
nb_candidate_commit_prepare()
running
running
private or
candidate

private or...
running
running
private or
candidate

private or...
Config Datastore Non-Implicit Commit Cleanup
Config Datastore Non-Implicit Commit Cleanup
\ No newline at end of file -- 2.39.5