A CI pipeline's NETCONF commit to a router might cut off the pipeline's own management path; how does a confirmed commit protect it, and when does it roll back?
answer
- a commit that must be confirmed
- ten minutes unless told otherwise
- dropped session means revert
- persist survives the drop
- cancel-commit reverts early
basics
~20 sA confirmed commit applies the candidate but reverts running to its prior state unless a confirming <commit> arrives within confirm-timeout (600 seconds by default); it also reverts at once if the issuing session drops, unless <persist> was set.
solid answer
~50 sWith `:confirmed-commit:1.1`, the pipeline sends `<commit>` with `<confirmed/>` and optionally `<confirm-timeout>` in seconds; the default is 600 (RFC 6241 §8.4). The change goes live, then the server waits for a **confirming commit** - a `<commit>` without `<confirmed/>`. If none arrives before the timer expires, the server restores the configuration as it was before the confirmed commit. If the change cuts the management path, the session usually dies, and the server must then restore the old configuration rather than wait for the timer, unless the commit carried `<persist>`; a reboot also reverts. With `<persist>`, the commit survives a session ending and any session can confirm or cancel it by quoting the token as `<persist-id>`. `<cancel-commit>` reverts without waiting. Locks still matter: the revert can undo other sessions' changes, so RFC 6241 says to lock shared datastores.
code
xml · 14 lines<rpc message-id="201" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<commit>
<confirmed/>
<confirm-timeout>300</confirm-timeout>
<persist>ci-job-4711</persist>
</commit>
</rpc>
<!-- later, from a new session, after the tests pass -->
<rpc message-id="7" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<commit>
<persist-id>ci-job-4711</persist-id>
</commit>
</rpc>go deeper
Remember that a confirmed commit is a provisional change that reverts unless confirmed, with a default window of 600 seconds.
Explain the confirming commit, the follow-up confirmed commit that resets the timer, and each trigger that rolls the change back.
Walk through the lockout case: the session dies first, so revert is immediate without persist. Weigh persist against that, and size the timeout to your tests.
Treat confirmed commit as one device's undo window, not a transaction; discuss what it cannot undo, such as another session's work or state outside the device.
## The failure it exists for A CI pipeline manages a router over NETCONF, reaching it through the same interfaces it is about to reconfigure. The change replaces an access list on the management interface. If the new list omits the pipeline's own address, the commit succeeds, the reply may never arrive, and nothing can reach the router to undo the mistake. Someone drives to the site. **Confirmed commit** (RFC 6241 §8.4) turns that into a self-healing event. The device applies the change, but treats it as provisional: unless the client proves it can still talk to the device by confirming, the device puts the old configuration back on its own. ## The mechanism The capability is `:confirmed-commit:1.1` (`urn:ietf:params:netconf:capability:confirmed-commit:1.1`), and it is only relevant together with `:candidate`. It adds four parameters to `<commit>` and one new operation: | Element | Meaning | |---|---| | `<confirmed/>` | make this commit provisional | | `<confirm-timeout>` | seconds to wait for confirmation; **600 by default** | | `<persist>` | a token that lets the commit survive the session ending | | `<persist-id>` | quotes that token from a later session | | `<cancel-commit>` | revert now instead of waiting for the timer | The life cycle runs like this: 1. The client sends `<commit>` with `<confirmed/>`. `running` takes the candidate's contents and a timer starts. 2. The client tests the device - reachability, routing, the new peer coming up. 3. To keep the change, it sends a **confirming commit**: a `<commit>` **without** `<confirmed/>`. 4. If no confirming commit arrives before the timer expires, the server **MUST** restore the configuration to its state before the confirmed commit. A **follow-up confirmed commit** - another `<commit>` with `<confirmed/>` before the timer expires - resets the timer to its new value. Both it and the confirming commit may carry further changes. ## When the server rolls back - **Timer expiry** with no confirming commit. - **The issuing session ends** for any reason before the timer expires - unless the commit carried `<persist>`. - **The device reboots** before the timer expires, with or without `<persist>`. - **`<cancel-commit>`**, which reverts at once. Without `<persist-id>` it must come from the issuing session; with `<persist-id>`, a value that does not match fails with `invalid-value`. - **`<kill-session>`** received while a confirmed commit is in progress: RFC 6241 §7.9 requires the server to restore the pre-commit configuration. In the lockout case the second rule usually fires first: the access list cuts the management path, the SSH connection carrying the session dies, and the server reverts as soon as it notices the session is gone - often well before 600 seconds. ## persist: surviving a dropped session Without `<persist>`, every follow-up commit and the confirming commit MUST come from the session that issued the confirmed commit. That is fragile for automation: if the pipeline's runner restarts mid-job, the session ends and the change reverts even though the router is fine. `<persist>` sets a token on the pending commit. The commit then survives the session ending, and any session may confirm, extend or cancel it by sending the token back as `<persist-id>`. The cost is real: a persistent confirmed commit no longer reverts when the session drops, so a change that cuts the management path stays in place until the timer expires. Choose the timeout with that in mind. The `:confirmed-commit:1.0` capability of RFC 4741 had neither `<persist>` nor `<cancel-commit>`; version 1.1 added both. ## Why locks still matter The revert restores **the configuration as it was before the confirmed commit**. If another session changed `running` in the meantime, the revert can alter or remove that work. RFC 6241 therefore says locking **SHOULD** be used with confirmed commit on shared datastores. The protocol also helps from its side: while one session's confirmed commit is pending, another session's `<lock>` on `running` is refused, and RFC 5717 denies a partial lock with `in-use` and `error-app-tag` `outstanding-confirmed-commit`. ## Operating notes - Size `<confirm-timeout>` to cover the post-change tests, not the default by habit. - Confirm only after testing over the path you might have broken. - A confirmed commit does not save to `startup`; with `:startup`, a separate `<copy-config>` from `running` to `startup` is still needed. - RFC 6470 defines a `netconf-confirmed-commit` notification whose `confirm-event` is `start`, `cancel`, `timeout`, `extend` or `complete` - the audit trail of every provisional change.
- Why might a pipeline deliberately leave out <persist>?Because without it the session dropping is itself a revert trigger. If the change cuts the management path, the SSH connection dies and the server restores the old configuration as soon as it notices, instead of waiting out the timer. The price is that a restart of the pipeline's own runner also reverts a change that was fine.
- How does a pipeline extend a confirmed commit while slow tests finish?It sends a follow-up confirmed commit - another `<commit>` with `<confirmed/>` - before the timer expires. RFC 6241 §8.4.1 resets the timer to the new value, 600 seconds unless `<confirm-timeout>` says otherwise. For a persistent commit sent from a different session, it must also carry the matching `<persist-id>`.
- What does a confirmed commit do to changes another session made while it was pending?If it reverts, it restores the configuration as it was before the confirmed commit, so it can alter or remove changes made in the meantime. That is why RFC 6241 says locking should be used with confirmed commit on shared datastores, and why another session cannot lock running while a confirmed commit is pending.
A display-settings dialog that applies a new resolution and reverts unless you click to keep it: if the new mode leaves you staring at a blank screen, you cannot click, and the old setting returns by itself.
saying these in an interview costs you the question
- A confirming commit is a second <commit> that also carries <confirmed/>.
- Without a confirm-timeout parameter, a confirmed commit waits indefinitely for confirmation.
- If the session drops, the change stays until the timer expires, even without persist.
- With <persist>, a reboot keeps the unconfirmed change in place.
- Confirmed commit makes locking unnecessary, because a bad change reverts anyway.