your solution for the rollback of a confirmed commit on timeout expiry seems to need a small extension. Consider the following command sequence - similar to the sysrepo issue#3014 but without the locking:
edit-config --target running ### set test-string to RUNNING ###
edit-config --target candidate ### set test-string to CANDIDATE ###
get-config --source running ### test-string is RUNNING ###
get-config --source candidate ### test-string is CANDIDATE ###
commit --confirmed --confirm-timeout 10
get ### test-string is CANDIDATE ###
### wait 10 seconds ###
get-config --source running ### test-string is CANDIDATE but should be RUNNING ###
The netopeer2 log shows the following output for each installed module:
[INF]: NP: Rolling back module "test-module"...
[ERR]: SR: Invalid arguments for function "sr_replace_config".
[ERR]: NP: Failed restoring backup for module "test-module".
It seems that the get operation sets the session datastore to SR_DS_OPERATIONAL and this is rejected in sr_replace_config() when the commit is rolled back. So, I guess this should be set to SR_DS_RUNNING or SR_DS_CANDIDATE before calling the mentioned function. What do you think?
Hi Michal,
your solution for the rollback of a confirmed commit on timeout expiry seems to need a small extension. Consider the following command sequence - similar to the sysrepo issue#3014 but without the locking:
The netopeer2 log shows the following output for each installed module:
It seems that the get operation sets the session datastore to SR_DS_OPERATIONAL and this is rejected in sr_replace_config() when the commit is rolled back. So, I guess this should be set to SR_DS_RUNNING or SR_DS_CANDIDATE before calling the mentioned function. What do you think?
BR, Peter