Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-58300

[CBM] [TC] Versions are compared as strings

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • master
    • master
    • tools-common
    • None
    • Untriaged
    • 0
    • Unknown

    Description

      Problem

      In tools-common, node versions are compared as strings (e.g. https://github.com/couchbase/tools-common/blob/5105de5e9963241b1e10710d52d4d9640b1ca323/couchbase/value/version.go#L87). This will break when server versions >10 are released e.g. when compared as strings "10.0.0" < "7.6.0". This will lead to the version checks not working.

      This problem also affects backup indirectly, from using Older()/Newer()/AtLeast() e.g. https://github.com/couchbase/backup/blob/90b63165f36e815fd8f4c808f37c2f207cf374b3/archive/dir_repo.go#L611

      Fix

      Don't compare versions as strings. The easiest solution might be to modify the compare() method to parse out the ints separating the major/minor version and compare them properly as ints.

      Attachments

        Issue Links

          For Gerrit Dashboard: MB-58300
          # Subject Branch Project Status CR V

          Activity

            People

              james.lee James Lee
              safian.ali Safian Ali
              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