@@ -28,7 +28,7 @@ const DefaultImportPartitions = 16
28
28
const DefaultImportPartitionsServerless = 6
29
29
30
30
// firstVersionToSupportCollections represents the earliest Sync Gateway release that supports collections.
31
- var firstVersionToSupportCollections = & ComparableVersion {
31
+ var firstVersionToSupportCollections = & ComparableBuildVersion {
32
32
epoch : 0 ,
33
33
major : 3 ,
34
34
minor : 1 ,
@@ -38,7 +38,7 @@ var firstVersionToSupportCollections = &ComparableVersion{
38
38
// nodeExtras is the contents of the JSON value of the cbgt.NodeDef.Extras field as used by Sync Gateway.
39
39
type nodeExtras struct {
40
40
// Version is the node's version.
41
- Version * ComparableVersion `json:"v"`
41
+ Version * ComparableBuildVersion `json:"v"`
42
42
}
43
43
44
44
// CbgtContext holds the two handles we have for CBGT-related functionality.
@@ -376,7 +376,7 @@ func (c *CbgtContext) StartManager(ctx context.Context, dbName string, configGro
376
376
377
377
// getNodeVersion returns the version of the node from its Extras field, or nil if none is stored. Returns an error if
378
378
// the extras could not be parsed.
379
- func getNodeVersion (def * cbgt.NodeDef ) (* ComparableVersion , error ) {
379
+ func getNodeVersion (def * cbgt.NodeDef ) (* ComparableBuildVersion , error ) {
380
380
if len (def .Extras ) == 0 {
381
381
return nil , nil
382
382
}
@@ -388,7 +388,7 @@ func getNodeVersion(def *cbgt.NodeDef) (*ComparableVersion, error) {
388
388
}
389
389
390
390
// getMinNodeVersion returns the version of the oldest node currently in the cluster.
391
- func getMinNodeVersion (cfg cbgt.Cfg ) (* ComparableVersion , error ) {
391
+ func getMinNodeVersion (cfg cbgt.Cfg ) (* ComparableBuildVersion , error ) {
392
392
nodes , _ , err := cbgt .CfgGetNodeDefs (cfg , cbgt .NODE_DEFS_KNOWN )
393
393
if err != nil {
394
394
return nil , err
@@ -397,14 +397,14 @@ func getMinNodeVersion(cfg cbgt.Cfg) (*ComparableVersion, error) {
397
397
// If there are no nodes at all, it's likely we're the first node in the cluster.
398
398
return ProductVersion , nil
399
399
}
400
- var minVersion * ComparableVersion
400
+ var minVersion * ComparableBuildVersion
401
401
for _ , node := range nodes .NodeDefs {
402
402
nodeVersion , err := getNodeVersion (node )
403
403
if err != nil {
404
404
return nil , fmt .Errorf ("failed to get version of node %v: %w" , MD (node .HostPort ).Redact (), err )
405
405
}
406
406
if nodeVersion == nil {
407
- nodeVersion = zeroComparableVersion ()
407
+ nodeVersion = zeroComparableBuildVersion ()
408
408
}
409
409
if minVersion == nil || nodeVersion .Less (minVersion ) {
410
410
minVersion = nodeVersion
@@ -678,11 +678,11 @@ func (meh *sgMgrEventHandlers) OnUnregisterPIndex(pindex *cbgt.PIndex) {
678
678
// OnFeedError is required to trigger reconnection to a feed on a closed connection (EOF).
679
679
// NotifyMgrOnClose will trigger cbgt closing and then attempt to reconnect to the feed, if the manager hasn't
680
680
// been stopped.
681
- func (meh * sgMgrEventHandlers ) OnFeedError (srcType string , r cbgt.Feed , feedErr error ) {
681
+ func (meh * sgMgrEventHandlers ) OnFeedError (_ string , r cbgt.Feed , feedErr error ) {
682
682
683
683
// cbgt always passes srcType = SOURCE_GOCBCORE, but we have a wrapped type associated with our indexes - use that instead
684
684
// for our logging
685
- srcType = SOURCE_DCP_SG
685
+ srcType : = SOURCE_DCP_SG
686
686
var bucketName , bucketUUID string
687
687
dcpFeed , ok := r .(cbgt.FeedEx )
688
688
if ok {
0 commit comments