Skip to content

Commit 946d29e

Browse files
committed
ING-1464: Added support for reporting mixed cluster editions.
1 parent 03941d0 commit 946d29e

4 files changed

Lines changed: 12 additions & 9 deletions

File tree

gateway/dataimpl/server_v1/xdcrserver.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,20 @@ func (s *XdcrServer) GetClusterInfo(ctx context.Context, in *internal_xdcr_v1.Ge
6262
return nil, errSt.Err()
6363
}
6464

65-
clusterInfo, err := clusterAgent.GetClusterInfo(ctx, &cbmgmtx.GetClusterInfoOptions{
65+
clusterInfo, err := clusterAgent.GetAggregatedClusterInfo(ctx, &gocbcorex.GetAggregatedClusterInfoOptions{
6666
OnBehalfOf: oboUser,
6767
})
6868
if err != nil {
6969
return nil, s.errorHandler.NewGenericStatus(ctx, err).Err()
7070
}
7171

7272
var edition internal_xdcr_v1.ClusterEdition
73-
if clusterInfo.IsEnterprise {
73+
if clusterInfo.AllEnterprise {
7474
edition = internal_xdcr_v1.ClusterEdition_CLUSTER_EDITION_ENTERPRISE
75-
} else {
75+
} else if clusterInfo.AllCommunity {
7676
edition = internal_xdcr_v1.ClusterEdition_CLUSTER_EDITION_COMMUNITY
77+
} else {
78+
edition = internal_xdcr_v1.ClusterEdition_CLUSTER_EDITION_MIXED
7779
}
7880

7981
return &internal_xdcr_v1.GetClusterInfoResponse{

gateway/test/xdcr_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ func (s *GatewayOpsTestSuite) TestXdcrGetClusterInfo() {
4343
require.Contains(s.T(), []internal_xdcr_v1.ClusterEdition{
4444
internal_xdcr_v1.ClusterEdition_CLUSTER_EDITION_COMMUNITY,
4545
internal_xdcr_v1.ClusterEdition_CLUSTER_EDITION_ENTERPRISE,
46+
internal_xdcr_v1.ClusterEdition_CLUSTER_EDITION_MIXED,
4647
}, *clusterInfoResp.Edition)
4748
}
4849

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ require (
88
github.com/Azure/azure-sdk-for-go/sdk/keyvault/azsecrets v0.12.0
99
github.com/aws/aws-sdk-go-v2/config v1.32.8
1010
github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.41.1
11-
github.com/couchbase/gocbcorex v0.0.0-20260302200007-00087f22161f
12-
github.com/couchbase/goprotostellar v1.0.6-0.20260407143512-d7af25156dcc
11+
github.com/couchbase/gocbcorex v0.0.0-20260427194529-5580e123837f
12+
github.com/couchbase/goprotostellar v1.0.6-0.20260427185542-d3cc7955fca9
1313
github.com/couchbaselabs/gocbconnstr v1.0.5
1414
github.com/couchbaselabs/gocbconnstr/v2 v2.0.0
1515
github.com/fsnotify/fsnotify v1.9.0

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UF
6868
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
6969
github.com/cncf/xds/go v0.0.0-20251210132809-ee656c7534f5 h1:6xNmx7iTtyBRev0+D/Tv1FZd4SCg8axKApyNyRsAt/w=
7070
github.com/cncf/xds/go v0.0.0-20251210132809-ee656c7534f5/go.mod h1:KdCmV+x/BuvyMxRnYBlmVaq4OLiKW6iRQfvC62cvdkI=
71-
github.com/couchbase/gocbcorex v0.0.0-20260302200007-00087f22161f h1:eGRME9PeeeSGK+g/2Ixz5CiEaQbuo2lN7/NMA50p+To=
72-
github.com/couchbase/gocbcorex v0.0.0-20260302200007-00087f22161f/go.mod h1:yhzN/7UDbjYEYD9Ee7gOMD5f4ViYT4QjnnjrATiwcoQ=
73-
github.com/couchbase/goprotostellar v1.0.6-0.20260407143512-d7af25156dcc h1:wQfvYGOutMCo9be0xnHtM1FqnwKcmPVGRPx6xXw5wOo=
74-
github.com/couchbase/goprotostellar v1.0.6-0.20260407143512-d7af25156dcc/go.mod h1:X58ot5FRqlBTBkwG/oI4klunpu4MApjGktheqeRWQw0=
71+
github.com/couchbase/gocbcorex v0.0.0-20260427194529-5580e123837f h1:WT0OOCoEb9TdQ70nXB9YOresJY71jDbWH/cPlXD8Ahk=
72+
github.com/couchbase/gocbcorex v0.0.0-20260427194529-5580e123837f/go.mod h1:yhzN/7UDbjYEYD9Ee7gOMD5f4ViYT4QjnnjrATiwcoQ=
73+
github.com/couchbase/goprotostellar v1.0.6-0.20260427185542-d3cc7955fca9 h1:qf77TOXsWpty1oQ7XEvnbWb7kiBrM4Z7wm9MEnilJMA=
74+
github.com/couchbase/goprotostellar v1.0.6-0.20260427185542-d3cc7955fca9/go.mod h1:X58ot5FRqlBTBkwG/oI4klunpu4MApjGktheqeRWQw0=
7575
github.com/couchbaselabs/gocbconnstr v1.0.5 h1:e0JokB5qbcz7rfnxEhNRTKz8q1svoRvDoZihsiwNigA=
7676
github.com/couchbaselabs/gocbconnstr v1.0.5/go.mod h1:KV3fnIKMi8/AzX0O9zOrO9rofEqrRF1d2rG7qqjxC7o=
7777
github.com/couchbaselabs/gocbconnstr/v2 v2.0.0 h1:HU9DlAYYWR69jQnLN6cpg0fh0hxW/8d5hnglCXXjW78=

0 commit comments

Comments
 (0)