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

CouchbaseServerVersion should use clusterCompatibility version

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Unresolved
    • Affects Version/s: 2.1.1
    • Fix Version/s: 2.6.0
    • Component/s: SyncGateway
    • Security Level: Public
    • Labels:
      None
    • Sprint:
      CBG Sprint 13, CBG Sprint 15, CBG Sprint 16, CBG Sprint 17, CBG Sprint 18
    • Story Points:
      3

      Description

      CouchbaseServerVersion() naively picks the first server version it encounters, however in a mid-upgrade scenario, nodes in the cluster have different versions, and the cluster as a whole is only upgraded when all nodes are running on the same later version.

      https://github.com/couchbase/sync_gateway/blob/3e536e5f7e66ab893ff47a02673182c628292786/base/bucket_gocb.go#L2253-L2257

      cluster_compat_version is a encoded cluster-wide version number which reflects the Couchbase version of the entire cluster. This version is already used by other services determine feature compatibility, and seems cheaper to decode the major/minor versions from it than parsing the string formatted version.

      function encodeCompatVersion(major, minor) {
         if (major < 2) {
           return 1;
         }
         return major * 0x10000 + minor;
      }
      

      http://src.couchbase.org/source/xref/6.0.0/ns_server/priv/public/ui/app-new/admin/mn-admin-service.js#encodeCompatVersion

      We can get this out of the REST API at /pools/default or at /pools/default/buckets/:bucketName: (see attachment)

      Prior art: goxdcr uses it for feature detection seen here:
      https://github.com/couchbase/goxdcr/blob/e57c61b95f7a436b105a7592e978fe7a66d1f49e/utils/utils.go#L1318-L1336

      https://github.com/couchbase/goxdcr/blob/e57c61b95f7a436b105a7592e978fe7a66d1f49e/base/simple_utils.go#L432-L450

        Attachments

          Issue Links

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

            Activity

            Hide
            ben.brooks Ben Brooks added a comment -

            GoCB as of https://github.com/couchbase/gocb/commit/6b2b62622f1879b04fcbcff8863eda2da50b55e6

            now exposes ClusterCompatibility via the GetNodesMetadata API

            Show
            ben.brooks Ben Brooks added a comment - GoCB as of https://github.com/couchbase/gocb/commit/6b2b62622f1879b04fcbcff8863eda2da50b55e6 now exposes ClusterCompatibility via the GetNodesMetadata API
            Hide
            adamf Adam Fraser added a comment -

            Requires more significant testing/validation based on the gocb change.  

            Show
            adamf Adam Fraser added a comment - Requires more significant testing/validation based on the gocb change.  
            Hide
            build-team Couchbase Build Team added a comment -

            Build sync_gateway-2.6.0-2 contains sync_gateway commit d89fc50 with commit message:
            Fixes CBG-159 test (#4040)

            Show
            build-team Couchbase Build Team added a comment - Build sync_gateway-2.6.0-2 contains sync_gateway commit d89fc50 with commit message: Fixes CBG-159 test (#4040)
            Hide
            build-team Couchbase Build Team added a comment -

            Build sync_gateway-2.6.0-2 contains sync_gateway commit d89fc50 with commit message:
            Fixes CBG-159 test (#4040)

            Show
            build-team Couchbase Build Team added a comment - Build sync_gateway-2.6.0-2 contains sync_gateway commit d89fc50 with commit message: Fixes CBG-159 test (#4040)
            Hide
            build-team Couchbase Build Team added a comment -

            Build sync_gateway-2.6.0-2 contains sync_gateway commit 306b541 with commit message:
            CBG-159: CouchbaseServerVersion uses clusterCompatibility (#3982)

            Show
            build-team Couchbase Build Team added a comment - Build sync_gateway-2.6.0-2 contains sync_gateway commit 306b541 with commit message: CBG-159 : CouchbaseServerVersion uses clusterCompatibility (#3982)
            Hide
            build-team Couchbase Build Team added a comment -

            Build sync_gateway-2.6.0-2 contains sync_gateway commit 306b541 with commit message:
            CBG-159: CouchbaseServerVersion uses clusterCompatibility (#3982)

            Show
            build-team Couchbase Build Team added a comment - Build sync_gateway-2.6.0-2 contains sync_gateway commit 306b541 with commit message: CBG-159 : CouchbaseServerVersion uses clusterCompatibility (#3982)

              People

              • Assignee:
                jacques.rascagneres Jacques Rascagneres
                Reporter:
                ben.brooks Ben Brooks
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Gerrit Reviews

                  There are no open Gerrit changes

                    PagerDuty

                    Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.