Page MenuHomeVyOS Platform

config-mgmt: rollback-soft and the commit-confirm revert run one command per changed line and take minutes on large configs
Open, NormalPublicBUG

Description

rollback-soft and the automatic revert after an unconfirmed commit-confirm load the target revision with the explicit loader of vyos.load_config. That loader works out the difference between the running config and the revision and then runs one my_set / my_delete process for each differing line, after reading the whole config twice. With a large list (prefix-lists, firewall rules) that changes in many lines, the load alone takes minutes, before the commit starts.

For the commit-confirm revert, the time the load takes is time the router stays on the configuration the operator did not confirm.

Measured on a VyOS 1.5.1 VM, one prefix-list where every rule differs between the revisions:

rulesrollback-soft 1, to the prompt
2,00070 s
10,000368 s, of which 216 s are the 20,000 per-line processes and 80 s are two reads of the config

On rolling (1.5-rolling-202610041311), 2,000 rules: rollback-soft 1 104.7 s; the commit-confirm revert 190.4 s.

The CLI load command already applies a whole file with one cli-shell-api loadFile call (the legacy loader).

Found while measuring: on stock, rollback-soft at a non-root edit level (after edit policy) fails for every path (Configuration path: [...] is not valid / Set failed, nothing applied) on 1.5.1 and rolling, because my_set / my_delete resolve paths against the edit level. loadFile does not use the edit level.

Proposed change. Load the revision with the legacy loader in both places, keep stock's refusal over uncommitted changes and outside a config session, and raise when loadFile reports a path it could not apply.

Details

Version
1.5.1, 1.5-rolling-20261010
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)