summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Hopps <chopps@labn.net>2025-04-08 05:15:53 +0000
committerChristian Hopps <chopps@labn.net>2025-04-08 05:39:18 +0000
commitb12b4c28b4c4a76cbc906b703ee5a694a082ab74 (patch)
treed5fbd65228326ca438a50381fbe3a9bdeadf2e48
parent994fdeeb22567dae4bd65c38cf1db5d6dd74d4c4 (diff)
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>
-rw-r--r--mgmtd/mgmt_fe_adapter.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/mgmtd/mgmt_fe_adapter.c b/mgmtd/mgmt_fe_adapter.c
index 8d59198803..d077e08679 100644
--- a/mgmtd/mgmt_fe_adapter.c
+++ b/mgmtd/mgmt_fe_adapter.c
@@ -217,12 +217,6 @@ static void
mgmt_fe_session_cfg_txn_cleanup(struct mgmt_fe_session_ctx *session)
{
/*
- * Ensure any uncommitted changes in Candidate DS
- * is discarded.
- */
- mgmt_ds_copy_dss(mm->running_ds, mm->candidate_ds, false);
-
- /*
* Destroy the actual transaction created earlier.
*/
if (session->cfg_txn_id != MGMTD_TXN_ID_NONE)