diff --git a/src/cluster/generated/proto/placementpb/placement.pb.go b/src/cluster/generated/proto/placementpb/placement.pb.go index cc82824669..263fbc2954 100644 --- a/src/cluster/generated/proto/placementpb/placement.pb.go +++ b/src/cluster/generated/proto/placementpb/placement.pb.go @@ -370,7 +370,8 @@ func (m *PlacementSnapshots) GetCompressedPlacement() []byte { } type Options struct { - IsSharded *google_protobuf.BoolValue `protobuf:"bytes,1,opt,name=is_sharded,json=isSharded" json:"is_sharded,omitempty"` + IsSharded *google_protobuf.BoolValue `protobuf:"bytes,1,opt,name=is_sharded,json=isSharded" json:"is_sharded,omitempty"` + SkipPortMirroring *google_protobuf.BoolValue `protobuf:"bytes,2,opt,name=skip_port_mirroring,json=skipPortMirroring" json:"skip_port_mirroring,omitempty"` } func (m *Options) Reset() { *m = Options{} } @@ -385,6 +386,13 @@ func (m *Options) GetIsSharded() *google_protobuf.BoolValue { return nil } +func (m *Options) GetSkipPortMirroring() *google_protobuf.BoolValue { + if m != nil { + return m.SkipPortMirroring + } + return nil +} + func init() { proto.RegisterType((*Placement)(nil), "placementpb.Placement") proto.RegisterType((*Instance)(nil), "placementpb.Instance") @@ -709,6 +717,16 @@ func (m *Options) MarshalTo(dAtA []byte) (int, error) { } i += n4 } + if m.SkipPortMirroring != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintPlacement(dAtA, i, uint64(m.SkipPortMirroring.Size())) + n5, err := m.SkipPortMirroring.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n5 + } return i, nil } @@ -864,6 +882,10 @@ func (m *Options) Size() (n int) { l = m.IsSharded.Size() n += 1 + l + sovPlacement(uint64(l)) } + if m.SkipPortMirroring != nil { + l = m.SkipPortMirroring.Size() + n += 1 + l + sovPlacement(uint64(l)) + } return n } @@ -1935,6 +1957,39 @@ func (m *Options) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SkipPortMirroring", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPlacement + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthPlacement + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SkipPortMirroring == nil { + m.SkipPortMirroring = &google_protobuf.BoolValue{} + } + if err := m.SkipPortMirroring.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipPlacement(dAtA[iNdEx:]) @@ -2066,58 +2121,59 @@ func init() { } var fileDescriptorPlacement = []byte{ - // 835 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x54, 0xcd, 0x6e, 0x1b, 0x37, - 0x10, 0xf6, 0x4a, 0xb6, 0xac, 0x1d, 0xfd, 0x74, 0xcb, 0xa6, 0xe9, 0xd6, 0x6d, 0x54, 0x55, 0x45, - 0x50, 0xc1, 0x45, 0x25, 0x44, 0xbe, 0x24, 0x39, 0x14, 0x90, 0x13, 0x37, 0xd8, 0xc2, 0x56, 0x02, - 0x4a, 0xf5, 0x21, 0x97, 0x05, 0xb5, 0xa4, 0x24, 0xa2, 0xda, 0xe5, 0x82, 0xe4, 0xe6, 0xa7, 0x4f, - 0xd1, 0x57, 0x2a, 0xd0, 0x43, 0x8f, 0x7d, 0x84, 0xc2, 0x7d, 0x88, 0x02, 0x3d, 0x15, 0x4b, 0xee, - 0xea, 0x27, 0xf6, 0x8d, 0xf3, 0xcd, 0x37, 0x9c, 0xe1, 0x37, 0x33, 0x84, 0x9f, 0x96, 0x5c, 0xaf, - 0xb2, 0xf9, 0x20, 0x12, 0xf1, 0x30, 0x3e, 0xa3, 0xf3, 0x61, 0x7c, 0x36, 0x54, 0x32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0xf7, - 0xef, 0xde, 0xfc, 0xf3, 0x8a, 0xef, 0xe0, 0x2d, 0x19, 0xfd, 0x00, 0xad, 0x48, 0xc4, 0xa9, 0x64, - 0x4a, 0x85, 0xb1, 0xa0, 0xa5, 0x76, 0x9f, 0xef, 0x45, 0x3f, 0x2b, 0x18, 0x57, 0x82, 0x32, 0xdc, - 0x8c, 0x76, 0x2c, 0xf4, 0x08, 0xee, 0x95, 0x36, 0xa3, 0xe1, 0x26, 0xc8, 0xe8, 0xd9, 0xc4, 0x9f, - 0x6c, 0x7d, 0x9b, 0x0a, 0x7a, 0xcf, 0xe1, 0xf8, 0x65, 0x9a, 0xef, 0x80, 0x42, 0x4f, 0xf6, 0xbe, - 0x09, 0xc7, 0x68, 0x72, 0x72, 0x4b, 0x93, 0x73, 0x21, 0xd6, 0x56, 0x91, 0xed, 0x17, 0x72, 0xfa, - 0x14, 0x60, 0xdb, 0x52, 0xe4, 0x41, 0x33, 0x98, 0x04, 0xb3, 0x60, 0x7c, 0x19, 0xbc, 0x0e, 0x26, - 0x2f, 0xbc, 0x03, 0xd4, 0x02, 0x77, 0x7c, 0x3d, 0x0e, 0x2e, 0xc7, 0xe7, 0x97, 0x17, 0x9e, 0x83, - 0x1a, 0x70, 0x7c, 0x79, 0x31, 0xbe, 0xce, 0x7d, 0x95, 0xd3, 0x1e, 0x34, 0x77, 0x9f, 0x84, 0xea, - 0x70, 0x38, 0x79, 0x39, 0xb9, 0xf0, 0x0e, 0xf2, 0xd3, 0xeb, 0xe9, 0xec, 0xb9, 0xe7, 0x9c, 0x7b, - 0x7f, 0xde, 0x74, 0x9c, 0xbf, 0x6e, 0x3a, 0xce, 0xdf, 0x37, 0x1d, 0xe7, 0xb7, 0x7f, 0x3a, 0x07, - 0xf3, 0x9a, 0x29, 0xe8, 0xec, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x46, 0x70, 0xf8, 0xb6, 0xee, - 0x05, 0x00, 0x00, + // 861 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x54, 0xcb, 0x8e, 0xdb, 0x36, + 0x14, 0x0d, 0xed, 0x19, 0x8f, 0x75, 0xfd, 0xa8, 0xc2, 0xa4, 0xa9, 0x3a, 0x6d, 0x5c, 0xd7, 0x45, + 0x50, 0x63, 0x8a, 0xda, 0x88, 0x67, 0x93, 0x64, 0x51, 0xc0, 0x93, 0x4e, 0x03, 0x05, 0x63, 0x27, + 0xa0, 0xa7, 0xb3, 0xc8, 0x46, 0xa0, 0x25, 0xda, 0x26, 0x62, 0x89, 0x02, 0x49, 0xe5, 0xd1, 0xaf, + 0xc8, 0x2f, 0x15, 0xe8, 0xa2, 0xcb, 0x7e, 0x42, 0x31, 0xfd, 0x88, 0x02, 0x5d, 0x15, 0x22, 0x25, + 0x3f, 0x9a, 0x41, 0x77, 0xbc, 0xe7, 0x9e, 0x4b, 0x5e, 0x1e, 0x9e, 0x4b, 0x78, 0xbe, 0xe4, 0x7a, + 0x95, 0xcd, 0x07, 0xa1, 0x88, 0x87, 0xf1, 0x69, 0x34, 0x1f, 0xc6, 0xa7, 0x43, 0x25, 0xc3, 0x61, + 0xb8, 0xce, 0x94, 0x66, 0x72, 0xb8, 0x64, 0x09, 0x93, 0x54, 0xb3, 0x68, 0x98, 0x4a, 0xa1, 0xc5, + 0x30, 0x5d, 0xd3, 0x90, 0xc5, 0x2c, 0xd1, 0xe9, 0x7c, 0xbb, 0x1e, 0x98, 0x1c, 0x6e, 0xec, 0x24, + 0x8f, 0x3b, 0x4b, 0x21, 0x96, 0x6b, 0x66, 0xcb, 0xe6, 0xd9, 0x62, 0xf8, 0x56, 0xd2, 0x34, 0x65, + 0x52, 0x59, 0x72, 0xef, 0xef, 0x0a, 0x38, 0x2f, 0x4b, 0x3e, 0x7e, 0x0a, 0x0e, 0x4f, 0x94, 0xa6, + 0x49, 0xc8, 0x94, 0x87, 0xba, 0xd5, 0x7e,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0x44, 0x39, 0x13, 0x62, 0x6d, 0x25, 0xd9, 0xf9, 0x43, + 0x9e, 0xc3, 0x1d, 0xf5, 0x9a, 0xa7, 0xc6, 0x25, 0xc5, 0x3f, 0xc1, 0x93, 0x65, 0x31, 0xc0, 0xff, + 0xb7, 0xc7, 0xed, 0xbc, 0x2c, 0xb7, 0xd2, 0xa4, 0x2c, 0x3a, 0x79, 0x02, 0xb0, 0xf5, 0x07, 0x76, + 0xa1, 0xe9, 0x4f, 0xfd, 0x4b, 0x7f, 0x7c, 0xe1, 0xbf, 0xf2, 0xa7, 0xcf, 0xdc, 0x5b, 0xb8, 0x05, + 0xce, 0xf8, 0x6a, 0xec, 0x5f, 0x8c, 0xcf, 0x2e, 0xce, 0x5d, 0x84, 0x1b, 0x70, 0x74, 0x71, 0x3e, + 0xbe, 0xca, 0x73, 0x95, 0x93, 0x1e, 0x34, 0x77, 0xf5, 0xc1, 0x75, 0x38, 0x98, 0xbe, 0x98, 0x9e, + 0xbb, 0xb7, 0xf2, 0xd5, 0xab, 0xd9, 0xe5, 0x8f, 0x2e, 0x3a, 0x73, 0x7f, 0xbf, 0xee, 0xa0, 0x3f, + 0xae, 0x3b, 0xe8, 0xcf, 0xeb, 0x0e, 0xfa, 0xf0, 0x57, 0xe7, 0xd6, 0xbc, 0x66, 0x1a, 0x3b, 0xfd, + 0x37, 0x00, 0x00, 0xff, 0xff, 0x38, 0x0a, 0x4d, 0xba, 0x3b, 0x06, 0x00, 0x00, } diff --git a/src/cluster/generated/proto/placementpb/placement.proto b/src/cluster/generated/proto/placementpb/placement.proto index 87467413e9..7df9cb5a6c 100644 --- a/src/cluster/generated/proto/placementpb/placement.proto +++ b/src/cluster/generated/proto/placementpb/placement.proto @@ -96,5 +96,6 @@ message PlacementSnapshots { message Options { google.protobuf.BoolValue is_sharded = 1; + google.protobuf.BoolValue skip_port_mirroring = 2; // TODO: cover all the fields in src/cluster/placement/config.go } diff --git a/src/cluster/placement/config.go b/src/cluster/placement/config.go index 61b8feca36..2988cbbb88 100644 --- a/src/cluster/placement/config.go +++ b/src/cluster/placement/config.go @@ -38,6 +38,7 @@ type Configuration struct { IsSharded *bool `yaml:"isSharded"` ShardStateMode *ShardStateMode `yaml:"shardStateMode"` IsMirrored *bool `yaml:"isMirrored"` + SkipPortMirroring *bool `yaml:"skipPortMirroring"` IsStaged *bool `yaml:"isStaged"` ValidZone *string `yaml:"validZone"` } @@ -63,6 +64,9 @@ func (c *Configuration) NewOptions() Options { if value := c.IsMirrored; value != nil { opts = opts.SetIsMirrored(*value) } + if value := c.SkipPortMirroring; value != nil { + opts = opts.SetSkipPortMirroring(*value) + } if value := c.IsStaged; value != nil { opts = opts.SetIsStaged(*value) } @@ -94,6 +98,10 @@ func (c Configuration) ApplyOverride(opts *placementpb.Options) Configuration { isShardedValueCopy := opts.IsSharded.Value c.IsSharded = &isShardedValueCopy } + if opts.SkipPortMirroring != nil { + skipPortMirroringCopy := opts.SkipPortMirroring.Value + c.SkipPortMirroring = &skipPortMirroringCopy + } return c } diff --git a/src/cluster/placement/options.go b/src/cluster/placement/options.go index d54c4d7e46..e0c434c8a1 100644 --- a/src/cluster/placement/options.go +++ b/src/cluster/placement/options.go @@ -76,6 +76,7 @@ type options struct { dryrun bool isSharded bool isMirrored bool + skipPortMirroring bool isStaged bool compress bool instanceSelector InstanceSelector @@ -153,6 +154,15 @@ func (o options) SetIsMirrored(v bool) Options { return o } +func (o options) SkipPortMirroring() bool { + return o.skipPortMirroring +} + +func (o options) SetSkipPortMirroring(v bool) Options { + o.skipPortMirroring = v + return o +} + func (o options) IsStaged() bool { return o.isStaged } diff --git a/src/cluster/placement/placement_mock.go b/src/cluster/placement/placement_mock.go index 02e661103b..91513322c3 100644 --- a/src/cluster/placement/placement_mock.go +++ b/src/cluster/placement/placement_mock.go @@ -1523,6 +1523,20 @@ func (mr *MockOptionsMockRecorder) SetShardStateMode(value interface{}) *gomock. return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetShardStateMode", reflect.TypeOf((*MockOptions)(nil).SetShardStateMode), value) } +// SetSkipPortMirroring mocks base method. +func (m *MockOptions) SetSkipPortMirroring(v bool) Options { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SetSkipPortMirroring", v) + ret0, _ := ret[0].(Options) + return ret0 +} + +// SetSkipPortMirroring indicates an expected call of SetSkipPortMirroring. +func (mr *MockOptionsMockRecorder) SetSkipPortMirroring(v interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetSkipPortMirroring", reflect.TypeOf((*MockOptions)(nil).SetSkipPortMirroring), v) +} + // SetValidZone mocks base method. func (m *MockOptions) SetValidZone(z string) Options { m.ctrl.T.Helper() @@ -1593,6 +1607,20 @@ func (mr *MockOptionsMockRecorder) ShardStateMode() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ShardStateMode", reflect.TypeOf((*MockOptions)(nil).ShardStateMode)) } +// SkipPortMirroring mocks base method. +func (m *MockOptions) SkipPortMirroring() bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SkipPortMirroring") + ret0, _ := ret[0].(bool) + return ret0 +} + +// SkipPortMirroring indicates an expected call of SkipPortMirroring. +func (mr *MockOptionsMockRecorder) SkipPortMirroring() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SkipPortMirroring", reflect.TypeOf((*MockOptions)(nil).SkipPortMirroring)) +} + // ValidZone mocks base method. func (m *MockOptions) ValidZone() string { m.ctrl.T.Helper() diff --git a/src/cluster/placement/selector/mirrored.go b/src/cluster/placement/selector/mirrored.go index a89eee35fd..dc1a1618ac 100644 --- a/src/cluster/placement/selector/mirrored.go +++ b/src/cluster/placement/selector/mirrored.go @@ -87,7 +87,7 @@ func (f *mirroredPortSelector) SelectInitialInstances( continue } - groupedInstances, err := groupInstancesByHostPort(groupedHosts) + groupedInstances, err := groupInstancesByHostPort(groupedHosts, f.opts.SkipPortMirroring()) if err != nil { return nil, err } @@ -128,7 +128,7 @@ func (f *mirroredPortSelector) SelectAddingInstances( if !f.opts.AddAllCandidates() { // When AddAllCandidates option is disabled, we will only add // one pair of hosts into the placement. - groups, err = groupInstancesByHostPort(groupedHosts[:1]) + groups, err = groupInstancesByHostPort(groupedHosts[:1], f.opts.SkipPortMirroring()) if err != nil { return nil, err } @@ -136,7 +136,7 @@ func (f *mirroredPortSelector) SelectAddingInstances( break } - newGroups, err := groupInstancesByHostPort(groupedHosts) + newGroups, err := groupInstancesByHostPort(groupedHosts, f.opts.SkipPortMirroring()) if err != nil { return nil, err } @@ -222,7 +222,7 @@ func (f *mirroredPortSelector) SelectReplaceInstances( continue } - groups, err := groupInstancesByHostPort([][]host{[]host{h, candidateHost}}) + groups, err := groupInstancesByHostPort([][]host{{h, candidateHost}}, f.opts.SkipPortMirroring()) if err != nil { f.logger.Warn("could not match up candidate host with target host", zap.String("candidate", candidateHost.name), @@ -416,25 +416,56 @@ func groupHostsWithIsolationGroupCheck(hosts []host, rf int) (groups [][]host, u return groups, ungrouped } -func groupInstancesByHostPort(hostGroups [][]host) ([][]placement.Instance, error) { +func groupInstancesByHostPort(hostGroups [][]host, skipPortMatching bool) ([][]placement.Instance, error) { var instanceGroups = make([][]placement.Instance, 0, len(hostGroups)) for _, hostGroup := range hostGroups { - for port, instance := range hostGroup[0].portToInstance { - instanceGroup := make([]placement.Instance, 0, len(hostGroup)) - instanceGroup = append(instanceGroup, instance) - for _, otherHost := range hostGroup[1:] { - otherInstance, ok := otherHost.portToInstance[port] - if !ok { - return nil, fmt.Errorf("could not find port %d on host %s", port, otherHost.name) + if !skipPortMatching { + for port, instance := range hostGroup[0].portToInstance { + instanceGroup := make([]placement.Instance, 0, len(hostGroup)) + instanceGroup = append(instanceGroup, instance) + for _, otherHost := range hostGroup[1:] { + otherInstance, ok := otherHost.portToInstance[port] + if !ok { + return nil, fmt.Errorf("could not find port %d on host %s", port, otherHost.name) + } + instanceGroup = append(instanceGroup, otherInstance) } - instanceGroup = append(instanceGroup, otherInstance) + instanceGroups = append(instanceGroups, instanceGroup) + } + } else { + numInstancesPerHost, instancesByHost := convertHostGroupToInstanceLists(hostGroup) + for i := 0; i < numInstancesPerHost; i++ { + instanceGroup := make([]placement.Instance, 0, len(hostGroup)) + for _, list := range instancesByHost { + instanceGroup = append(instanceGroup, list[i]) + } + instanceGroups = append(instanceGroups, instanceGroup) } - instanceGroups = append(instanceGroups, instanceGroup) } } return instanceGroups, nil } +func convertHostGroupToInstanceLists(hostGroup []host) (int, [][]placement.Instance) { + numInstancePerHost := 0 + instancesByHost := make([][]placement.Instance, 0, len(hostGroup)) + for i, host := range hostGroup { + if i == 0 { + numInstancePerHost = len(host.portToInstance) + } else if numInstancePerHost > len(host.portToInstance) { + numInstancePerHost = len(host.portToInstance) + } + + instances := make([]placement.Instance, 0, numInstancePerHost) + for _, instance := range host.portToInstance { + instances = append(instances, instance) + } + instancesByHost = append(instancesByHost, instances) + } + + return numInstancePerHost, instancesByHost +} + // assignShardsetsToGroupedInstances is a helper for mirrored selectors, which assigns shardset // IDs to the given groups. func assignShardsetsToGroupedInstances( diff --git a/src/cluster/placement/selector/mirrored_test.go b/src/cluster/placement/selector/mirrored_test.go index f92f4631cc..c6fd8ea328 100644 --- a/src/cluster/placement/selector/mirrored_test.go +++ b/src/cluster/placement/selector/mirrored_test.go @@ -800,22 +800,50 @@ func TestGroupInstancesByHostPort(t *testing.T) { i2 := newInstanceWithID("i2").SetPort(port).SetHostname("h2") hosts := [][]host{{{ - name: "h1", + name: "h1", isolationGroup: "g1", portToInstance: map[uint32]placement.Instance{ port: i1, }, }, { - name: "h2", + name: "h2", isolationGroup: "g2", portToInstance: map[uint32]placement.Instance{ port: i2, }, }}} - groups, err := groupInstancesByHostPort(hosts) + groups, err := groupInstancesByHostPort(hosts, false) require.NoError(t, err) assert.Equal(t, [][]placement.Instance{{i1, i2}}, groups) }) + + t.Run("maintains host order with 2 instances with different ports", func(t *testing.T) { + port1 := uint32(5) + i1 := newInstanceWithID("i1").SetPort(port1).SetHostname("h1") + port2 := uint32(15) + i2 := newInstanceWithID("i2").SetPort(port2).SetHostname("h2") + + hosts := [][]host{{{ + name: "h1", + isolationGroup: "g1", + portToInstance: map[uint32]placement.Instance{ + port1: i1, + }, + }, { + name: "h2", + isolationGroup: "g2", + portToInstance: map[uint32]placement.Instance{ + port2: i2, + }, + }}} + + groups, err := groupInstancesByHostPort(hosts, true) + require.NoError(t, err) + assert.Equal(t, [][]placement.Instance{{i1, i2}}, groups) + + _, err = groupInstancesByHostPort(hosts, false) + require.NotNil(t, err) + }) } diff --git a/src/cluster/placement/types.go b/src/cluster/placement/types.go index c7a0e31bf4..4a39303b49 100644 --- a/src/cluster/placement/types.go +++ b/src/cluster/placement/types.go @@ -326,6 +326,14 @@ type Options interface { // SetIsMirrored sets IsMirrored. SetIsMirrored(m bool) Options + // SkipPortMirroring returns whether to ignore the port numbers while selecting + // mirroring instances. + SkipPortMirroring() bool + + // SetSkipPortMirroring sets whether to ignore the port numbers while selecting + // mirroring instances. + SetSkipPortMirroring(v bool) Options + // IsStaged returns whether the placement should keep all the snapshots. IsStaged() bool diff --git a/src/integration/resources/inprocess/cluster_test.go b/src/integration/resources/inprocess/cluster_test.go index 28f295e32e..fe9ab18c94 100644 --- a/src/integration/resources/inprocess/cluster_test.go +++ b/src/integration/resources/inprocess/cluster_test.go @@ -22,8 +22,10 @@ package inprocess import ( + "errors" "testing" + "github.com/m3db/m3/src/aggregator/aggregator" "github.com/m3db/m3/src/integration/resources" "github.com/stretchr/testify/require" ) @@ -73,6 +75,75 @@ func TestNewClusterWithAgg(t *testing.T) { require.NoError(t, m3.Cleanup()) } +func TestNewClusterWithMultiAggs(t *testing.T) { + configs, err := NewClusterConfigsFromYAML(clusterDBNodeConfig, aggregatorCoordConfig, defaultAggregatorConfig) + require.NoError(t, err) + + aggClusterOpts := &resources.AggregatorClusterOptions{ + RF: 2, + NumShards: 4, + NumInstances: 2, + NumIsolationGroups: 2, + } + m3, err := NewCluster(configs, resources.ClusterOptions{ + DBNode: resources.NewDBNodeClusterOptions(), + Aggregator: aggClusterOpts, + }) + require.NoError(t, err) + require.NoError(t, m3.Nodes().WaitForHealthy()) + require.NoError(t, m3.Aggregators().WaitForHealthy()) + + // wait for a leader aggregator + require.NoError(t, resources.Retry(func() error { + for _, agg := range m3.Aggregators() { + status, err := agg.Status() + if err != nil { + return err + } + if status.FlushStatus.ElectionState == aggregator.LeaderState { + return nil + } + } + return errors.New("no leader") + })) + + // the leader resigns + leaderIdx := -1 + for i, agg := range m3.Aggregators() { + status, err := agg.Status() + require.NoError(t, err) + if status.FlushStatus.ElectionState == aggregator.LeaderState { + verifyAggStatus(t, m3.Aggregators()[i], aggregator.LeaderState) + verifyAggStatus(t, m3.Aggregators()[1-i], aggregator.FollowerState) + require.NoError(t, agg.Resign()) + leaderIdx = i + break + } + } + + // wait for the other instance to lead + require.NoError(t, resources.Retry(func() error { + newStatus, err := m3.Aggregators()[leaderIdx].Status() + if err != nil { + return err + } + if newStatus.FlushStatus.ElectionState != aggregator.FollowerState { + return errors.New("follower state expected after resigning") + } + return nil + })) + verifyAggStatus(t, m3.Aggregators()[leaderIdx], aggregator.FollowerState) + verifyAggStatus(t, m3.Aggregators()[1-leaderIdx], aggregator.LeaderState) + + require.NoError(t, m3.Cleanup()) +} + +func verifyAggStatus(t *testing.T, agg resources.Aggregator, expectedState aggregator.ElectionState) { + status, err := agg.Status() + require.NoError(t, err) + require.Equal(t, expectedState, status.FlushStatus.ElectionState) +} + const clusterDBNodeConfig = ` db: writeNewSeriesAsync: false diff --git a/src/integration/resources/resources.go b/src/integration/resources/resources.go index d1ca8caa6a..216f6d562d 100644 --- a/src/integration/resources/resources.go +++ b/src/integration/resources/resources.go @@ -258,6 +258,9 @@ func setupPlacement( NumShards: opts.NumShards, ReplicationFactor: opts.RF, Instances: instances, + OptionOverride: &placementpb.Options{ + SkipPortMirroring: &protobuftypes.BoolValue{Value: true}, + }, }, ) if err != nil {