Skip to content

Add CDB compaction to startup script

Kristian Larsson requested to merge 33-test-upgrade-4-to-5 into master

If deemed necessary, i.e. we are starting NSO 5 and the CDB on disk is written by NSO 4, then perform a CDB compaction.

It's generally recommended that the upgrade procedure from NSO 4 to NSO 5 is as follows:

  • take backup of NSO (in NSO 4 format)
  • compact CDB
  • take backup of NSO (in NSO 5 format)
  • start NSO 5
    • this might fail due to YANG model inconsistencies
    • model inconsistencies can lead to data loss
    • if it fails
      • restore from backup that contains NSO 5 compacted CDB
      • retry starting NSO 5
      • repeat until done

Since there might be multiple failures related to models you might have to retry a few times. CDB compaction can take some time. By restoring from a backup of a compacted CDB, we don't have to reattempt the compaction for every retry.

In a production setting, I believe the correct course of action is to take a backup of the running CDB, move it to a development machine and then attempt the upgrades there, preferably even incorporating this into a CI pipeline. For such a scenario, it means we will test out the upgrade before actually attempting the upgrade in production. While we might use compacted backups to speed up the development testing of the NSO upgrade, the actual upgrade of the production database is going to happen in a NSO container and then it becomes useful if the container automatically determines the CDB version + NSO version and does compaction if deemed necessary. This patch does exactly that.

Closes #33 (closed)

Merge request reports