frr/mgmtd
Christian Hopps b12b4c28b4 mgmtd: remove bogus "hedge" code which corrupted active candidate DS
Say you have 2 mgmtd frontend sessions (2 vtysh's) the first one is long
running and is actively changing the global candidate datastore (DS),
the second one starts and exits, this code would then copy running
back over the candidate, blowing away any changes made by the first
session.

(the long running session could technically be any user)

Instead we need to trust the various cleanup code that already exits.
For example in the commit_cfg_reply on success candidate is copied to
running, and on failure *for implicit commit* running is copied back to
candidate clearing the change. This leaves the non-implicit
configuration changes in this case we actually want candidate to keep
it's changes in transactional cases, in the other case of pending commit
during a file read the code restores candidate (if needed) on exit from
"config terminal", with this call stack:

 vty_config_node_exit()
   nb_cli_pending_commit_check()
     nb_cli_classic_commit()
       nb_candidate_commit_prepare() [fail] -> copy running -> candidate
       nb_candidate_commit_apply() -> copy candidate -> running

fixes #18541

Signed-off-by: Christian Hopps <chopps@labn.net>
2025-04-08 05:39:18 +00:00
..
.gitignore mgmtd: Add to .gitignore for mgmtd_testc program 2024-08-10 20:21:27 -04:00
Makefile mgmtd: Bringup MGMTD daemon and datastore module support 2023-03-21 22:08:32 -04:00
mgmt.c lib: add flag to have libyang load internal ietf-yang-library module 2024-10-07 03:32:44 +00:00
mgmt.h *: create a single registry of daemons' default port values 2024-02-01 11:40:02 -05:00
mgmt_be_adapter.c mgmtd: testc: add listen for datastore notifications 2025-01-18 16:14:29 +00:00
mgmt_be_adapter.h mgmtd: add backend xpath map for RPC 2024-04-22 16:36:22 +03:00
mgmt_be_nb.c *: add XREF_SETUP() to libraries and utilites 2024-05-02 23:03:08 +02:00
mgmt_ds.c mgmtd: don't add implicit state data when reading config from file 2024-08-08 00:45:13 +03:00
mgmt_ds.h lib, mgmtd: fix commit history location 2024-01-27 19:02:52 +01:00
mgmt_fe_adapter.c mgmtd: remove bogus "hedge" code which corrupted active candidate DS 2025-04-08 05:39:18 +00:00
mgmt_fe_adapter.h mgmtd: add notify selectors to filter datastore notifications 2025-01-13 23:40:52 -05:00
mgmt_history.c lib: fix new (incorrect) CLANG SA warnings 2025-01-13 23:40:52 -05:00
mgmt_history.h mgmtd: assert an assertion for coverity 2023-06-06 15:12:58 -04:00
mgmt_main.c lib: introduce global -w option for VRF netns backend 2025-01-15 23:38:27 +02:00
mgmt_memory.c mgmtd: add native RPC processing 2024-04-22 16:36:22 +03:00
mgmt_memory.h mgmtd: add native RPC processing 2024-04-22 16:36:22 +03:00
mgmt_testc.c mgmtd: testc: add listen for datastore notifications 2025-01-18 16:14:29 +00:00
mgmt_txn.c mgmtd: Prevent use after free 2025-02-26 12:34:05 -05:00
mgmt_txn.h mgmtd: add notify selectors to filter datastore notifications 2025-01-13 23:40:52 -05:00
mgmt_vty.c lib: common debug status output 2024-08-27 09:53:02 -04:00
subdir.am *: add XREF_SETUP() to libraries and utilites 2024-05-02 23:03:08 +02:00