diff options
| author | Mark Stapp <mjs.ietf@gmail.com> | 2025-04-09 09:51:47 -0400 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-09 09:51:47 -0400 | 
| commit | 2aa6e786a28108ab07546542a90fd8e70f34bef7 (patch) | |
| tree | 29b0cf49e87c658875396a0f9d48bab3a02143a0 /mgmtd/mgmt_txn.c | |
| parent | 1f9c8802979aa49652aad969a49105e557ebcee4 (diff) | |
| parent | 59d2368b0f055f28aeda8f6080d686acfa35c20b (diff) | |
Merge pull request #18601 from LabNConsulting/chopps/mgmtd-candidate-overwrite
mgmtd: remove bogus "hedge" code which corrupted active candidate DS
Diffstat (limited to 'mgmtd/mgmt_txn.c')
| -rw-r--r-- | mgmtd/mgmt_txn.c | 26 | 
1 files changed, 10 insertions, 16 deletions
diff --git a/mgmtd/mgmt_txn.c b/mgmtd/mgmt_txn.c index 9e06ce9f5f..96ca62c847 100644 --- a/mgmtd/mgmt_txn.c +++ b/mgmtd/mgmt_txn.c @@ -764,17 +764,15 @@ static int mgmt_txn_send_commit_cfg_reply(struct mgmt_txn_ctx *txn,  			 !txn->commit_cfg_req->req.commit_cfg.rollback);  		/* -		 * Successful commit: Merge Src DS into Dst DS if and only if +		 * Successful commit: Copy Src DS to Dst DS if and only if  		 * this was not a validate-only or abort request.  		 */  		if ((txn->session_id &&  		     !txn->commit_cfg_req->req.commit_cfg.validate_only &&  		     !txn->commit_cfg_req->req.commit_cfg.abort) ||  		    txn->commit_cfg_req->req.commit_cfg.rollback) { -			mgmt_ds_copy_dss(txn->commit_cfg_req->req.commit_cfg -						 .src_ds_ctx, -					 txn->commit_cfg_req->req.commit_cfg -						 .dst_ds_ctx, +			mgmt_ds_copy_dss(txn->commit_cfg_req->req.commit_cfg.dst_ds_ctx, +					 txn->commit_cfg_req->req.commit_cfg.src_ds_ctx,  					 create_cmt_info_rec);  		} @@ -783,22 +781,18 @@ static int mgmt_txn_send_commit_cfg_reply(struct mgmt_txn_ctx *txn,  		 * request.  		 */  		if (txn->session_id && txn->commit_cfg_req->req.commit_cfg.abort) -			mgmt_ds_copy_dss(txn->commit_cfg_req->req.commit_cfg -						 .dst_ds_ctx, -					 txn->commit_cfg_req->req.commit_cfg -						 .src_ds_ctx, -					 false); +			mgmt_ds_copy_dss(txn->commit_cfg_req->req.commit_cfg.src_ds_ctx, +					 txn->commit_cfg_req->req.commit_cfg.dst_ds_ctx, false);  	} else {  		/*  		 * The commit has failied. For implicit commit requests restore -		 * back the contents of the candidate DS. +		 * back the contents of the candidate DS. For non-implicit +		 * commit we want to allow the user to re-commit on the changes +		 * (whether further modified or not).  		 */  		if (txn->commit_cfg_req->req.commit_cfg.implicit) -			mgmt_ds_copy_dss(txn->commit_cfg_req->req.commit_cfg -						 .dst_ds_ctx, -					 txn->commit_cfg_req->req.commit_cfg -						 .src_ds_ctx, -					 false); +			mgmt_ds_copy_dss(txn->commit_cfg_req->req.commit_cfg.src_ds_ctx, +					 txn->commit_cfg_req->req.commit_cfg.dst_ds_ctx, false);  	}  	if (txn->commit_cfg_req->req.commit_cfg.rollback) {  | 
