Team,
Look like there is bug with NCS 3.4.6, with rollbacks using nr numbers. I tried following scenarios:
From NCS GUI
From custom GUI application integrated using JSON RPC
Anyone faced this issue, any resolution in later version?
Team,
Any input on this thread is appreciated. Please also recommend if you also see this an issue and we open a bug for it.
Hi Imran,
Right, the ‘nr’ number as provided in the JSON-RPC get_rollbacks method is the ‘rolling’ rollback number.
In the rolling scheme – NR - is the juniper-like scheme which will maintain ‘0’ as the most current commit, with the ‘nr’ for all other commits being incremented.
There is also a parallel fixed number scheme where the fixed number of the rollback that (by default config) is the 100xx number on the file or in the header of the rollback file:
# Created by: admin
# Date: 2016-11-03 15:56:15
# Via: cli
# Type: delta
# Label: Lag1-Rollback
# Comment:
# No: 10030
The Java API presents both numbers:
From Java maapi (assume similar in JSON-RPC) the getNR:
for (MaapiRollback file : rbList ) {
LOGGER.info("Rollback File List:" + file.toString());
int fnr = file.getFixedNR();
LOGGER.info("Rollback File Fixed NR:" + fnr);
int nr = file.getNR();
LOGGER.info("Rollback File NR:" + nr);
String fcreator = file.getCreator();
LOGGER.info("Rollback File creator:" + fcreator);
String fdate = file.getDate();
LOGGER.info("Rollback File date:" + fdate);
String fvia = file.getVia();
LOGGER.info("Rollback File via:" + fvia);
But since you are Labeling your commits and using that to determine the ‘nr’ number the Fixed number doesn’t do much for you anyway, that’s because the other rollback methods load_rollback, install_rollback currently only accept the rolling ‘nr’ number and not the fixed number.
So once you determine the ‘nr’ number you must use that number immediately, in the same transaction, to protect that the ‘nr’ does not get changed by another commit happening before you use it.
What would be useful would be for the ‘fixed number’ to also be returned from the get_rollbacks method and then add the capability that the fixed number be able to be used in the load_rollback/install_rollback methods as well.
So I think it is an enhancement, more-so than a bug, but would be worthy enhancement.
With that said, doing rollbacks (selective or cumulative) with other commits happening in parallel can be a recipe for confusion, if not disaster, if the results of the rollback can impact the configuration being committed following the commit being reverted. Really need to be careful here.
Regards,
-Larry
Thanks Larry for the detailed response.
So in summary, if we go through Java, then maapi is one option we can use.
If staying with JSON RPC and using nr#, then there is still a chance that we might revert wrong transaction which can be a potential disaster.
So if we want to stay with JSON RPC, then solutions are
Thanks again for your help.