Uploaded image for project: 'Couchbase Gateway'
  1. Couchbase Gateway
  2. CBG-3457

[3.1.2 backport] Prevent minor version downgrade

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 3.1.2
    • None
    • SyncGateway
    • Security Level: Public
    • None
    • CBG Sprint 137
    • 1

    Description

      By default, Sync Gateway should prevent startup when a collection being targeted by the database contains metadata from a higher Sync Gateway version.

      We should perform this check at database creation, update, and startup.

      Implementation overview:

      • add Sync Gateway version to base.SyncInfo
      • modify SetSyncInfo to populate version
      • modify InitSyncInfo to populate version on init, and to identify version mismatch for existing files

      Database startup

      • When the SyncInfo in a collection targeted by a db is on a newer minor version, fail to load the database. (note: unlike existing handling for metadataID mismatches, we don't just want to leave it offline - should fail to load and report an error)
      • It should be possible for users to delete or update the database config (to remove references to collections with a higher SyncInfo)

      Database creation/update

      • Write a new GetSyncInfo that does a simple fetch of Sync Info
      • On creation/update, iterate over all collections targeted by the database, fetch SyncInfo, and return error if any of them have a newer major or minor version than SG's version

      Config override

      • We may want the ability for on prem customers to override and allow this downgrade, for cases where they know what they are doing. For this scenario I think it's reasonable to include an db-level unsupported flag that would disable the checks above

      Testing recommendations

      • All of the below should be tested with _default._default and named collections
      • All of the above should be tested with
      • bucket contains version with newer major version - should fail
      • bucket contains version with newer minor version - should fail
      • bucket contains version with newer maintenance version - should succeed
      • bucket contains version with matching version - should succeed
      • bucket contains version with older version - should succeed
      • Test the following:
      • Create db targeting collection(s)
      • Update db to add collection
      • Start db targeting collection(s)

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              tor.colvin Tor Colvin
              tor.colvin Tor Colvin
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty