diff --git a/api.go b/api.go index 7c475b473..0b27d19a8 100644 --- a/api.go +++ b/api.go @@ -327,6 +327,38 @@ func (api *API) DeleteField(_ context.Context, indexName string, fieldName strin return nil } +// DeleteAvailableShard a shard ID from the available shard set cache. +func (api *API) DeleteAvailableShard(_ context.Context, indexName, fieldName string, shardID uint64) error { + if err := api.validate(apiDeleteAvailableShard); err != nil { + return errors.Wrap(err, "validating api method") + } + + // Find field. + field := api.holder.Field(indexName, fieldName) + if field == nil { + return newNotFoundError(ErrFieldNotFound) + } + + // Delete shard from the cache. + if err := field.RemoveAvailableShard(shardID); err != nil { + return errors.Wrap(err, "deleting available shard") + } + + // Send the delete shard message to all nodes. + err := api.server.SendSync( + &DeleteAvailableShardMessage{ + Index: indexName, + Field: fieldName, + ShardID: shardID, + }) + if err != nil { + api.server.logger.Printf("problem sending DeleteAvailableShard message: %s", err) + return errors.Wrap(err, "sending DeleteAvailableShard message") + } + api.holder.Stats.CountWithCustomTags("deleteAvailableShard", 1, 1.0, []string{fmt.Sprintf("index:%s", indexName), fmt.Sprintf("field:%s", fieldName)}) + return nil +} + // ExportCSV encodes the fragment designated by the index,field,shard as // CSV of the form , func (api *API) ExportCSV(_ context.Context, indexName string, fieldName string, shard uint64, w io.Writer) error { @@ -914,6 +946,7 @@ const ( apiCreateField apiCreateIndex apiDeleteField + apiDeleteAvailableShard apiDeleteIndex apiDeleteView apiExportCSV @@ -952,23 +985,24 @@ var methodsResizing = map[apiMethod]struct{}{ } var methodsNormal = map[apiMethod]struct{}{ - apiCreateField: {}, - apiCreateIndex: {}, - apiDeleteField: {}, - apiDeleteIndex: {}, - apiDeleteView: {}, - apiExportCSV: {}, - apiFragmentBlockData: {}, - apiFragmentBlocks: {}, - apiField: {}, - apiFieldAttrDiff: {}, - apiImport: {}, - apiImportValue: {}, - apiIndex: {}, - apiIndexAttrDiff: {}, - apiQuery: {}, - apiRecalculateCaches: {}, - apiRemoveNode: {}, - apiShardNodes: {}, - apiViews: {}, + apiCreateField: {}, + apiCreateIndex: {}, + apiDeleteField: {}, + apiDeleteAvailableShard: {}, + apiDeleteIndex: {}, + apiDeleteView: {}, + apiExportCSV: {}, + apiFragmentBlockData: {}, + apiFragmentBlocks: {}, + apiField: {}, + apiFieldAttrDiff: {}, + apiImport: {}, + apiImportValue: {}, + apiIndex: {}, + apiIndexAttrDiff: {}, + apiQuery: {}, + apiRecalculateCaches: {}, + apiRemoveNode: {}, + apiShardNodes: {}, + apiViews: {}, } diff --git a/cluster.go b/cluster.go index 868feceee..c3bc67b4d 100644 --- a/cluster.go +++ b/cluster.go @@ -1946,6 +1946,12 @@ type DeleteFieldMessage struct { Field string } +type DeleteAvailableShardMessage struct { + Index string + Field string + ShardID uint64 +} + type CreateViewMessage struct { Index string Field string diff --git a/encoding/proto/proto.go b/encoding/proto/proto.go index b49b97454..677f08ce0 100644 --- a/encoding/proto/proto.go +++ b/encoding/proto/proto.go @@ -81,6 +81,14 @@ func (Serializer) Unmarshal(buf []byte, m pilosa.Message) error { } decodeDeleteFieldMessage(msg, mt) return nil + case *pilosa.DeleteAvailableShardMessage: + msg := &internal.DeleteAvailableShardMessage{} + err := proto.Unmarshal(buf, msg) + if err != nil { + return errors.Wrap(err, "unmarshaling DeleteAvailableShardMessage") + } + decodeDeleteAvailableShardMessage(msg, mt) + return nil case *pilosa.CreateViewMessage: msg := &internal.CreateViewMessage{} err := proto.Unmarshal(buf, msg) @@ -250,6 +258,8 @@ func encodeToProto(m pilosa.Message) proto.Message { return encodeCreateFieldMessage(mt) case *pilosa.DeleteFieldMessage: return encodeDeleteFieldMessage(mt) + case *pilosa.DeleteAvailableShardMessage: + return encodeDeleteAvailableShardMessage(mt) case *pilosa.CreateViewMessage: return encodeCreateViewMessage(mt) case *pilosa.DeleteViewMessage: @@ -549,6 +559,14 @@ func encodeDeleteFieldMessage(m *pilosa.DeleteFieldMessage) *internal.DeleteFiel } } +func encodeDeleteAvailableShardMessage(m *pilosa.DeleteAvailableShardMessage) *internal.DeleteAvailableShardMessage { + return &internal.DeleteAvailableShardMessage{ + Index: m.Index, + Field: m.Field, + ShardID: m.ShardID, + } +} + func encodeCreateViewMessage(m *pilosa.CreateViewMessage) *internal.CreateViewMessage { return &internal.CreateViewMessage{ Index: m.Index, @@ -775,6 +793,12 @@ func decodeDeleteFieldMessage(pb *internal.DeleteFieldMessage, m *pilosa.DeleteF m.Field = pb.Field } +func decodeDeleteAvailableShardMessage(pb *internal.DeleteAvailableShardMessage, m *pilosa.DeleteAvailableShardMessage) { + m.Index = pb.Index + m.Field = pb.Field + m.ShardID = pb.ShardID +} + func decodeCreateViewMessage(pb *internal.CreateViewMessage, m *pilosa.CreateViewMessage) { m.Index = pb.Index m.Field = pb.Field diff --git a/field.go b/field.go index 27de57d8f..e484a691b 100644 --- a/field.go +++ b/field.go @@ -230,9 +230,9 @@ func (f *Field) AvailableShards() *roaring.Bitmap { return b } -// addRemoteAvailableShards merges the set of available shards into the current known set +// AddRemoteAvailableShards merges the set of available shards into the current known set // and saves the set to a file. -func (f *Field) addRemoteAvailableShards(b *roaring.Bitmap) error { +func (f *Field) AddRemoteAvailableShards(b *roaring.Bitmap) error { f.mergeRemoteAvailableShards(b) // Save the updated bitmap to the data store. @@ -246,6 +246,22 @@ func (f *Field) mergeRemoteAvailableShards(b *roaring.Bitmap) { f.remoteAvailableShards = f.remoteAvailableShards.Union(b) } +// RemoveAvailableShard removes a shard from the bitmap cache. +// +// NOTE: This can be overridden on the next sync so all nodes should be updated. +func (f *Field) RemoveAvailableShard(v uint64) error { + f.mu.RLock() + defer f.mu.RUnlock() + + b := f.remoteAvailableShards.Clone() + if _, err := b.Remove(v); err != nil { + return err + } + f.remoteAvailableShards = b + + return f.saveAvailableShards() +} + // Type returns the field type. func (f *Field) Type() string { f.mu.RLock() diff --git a/field_internal_test.go b/field_internal_test.go index d72a3fd6a..462f7c175 100644 --- a/field_internal_test.go +++ b/field_internal_test.go @@ -349,7 +349,7 @@ func TestField_PersistAvailableShards(t *testing.T) { // bm represents remote available shards. bm := roaring.NewBitmap(1, 2, 3) - if err := f.addRemoteAvailableShards(bm); err != nil { + if err := f.AddRemoteAvailableShards(bm); err != nil { t.Fatal(err) } diff --git a/field_test.go b/field_test.go index 520179f52..2a0efc0b9 100644 --- a/field_test.go +++ b/field_test.go @@ -18,7 +18,9 @@ import ( "io/ioutil" "testing" + "github.com/google/go-cmp/cmp" "github.com/pilosa/pilosa" + "github.com/pilosa/pilosa/roaring" "github.com/pilosa/pilosa/test" ) @@ -185,3 +187,39 @@ func TestField_NameValidation(t *testing.T) { } } } + +// Ensure can update and delete available shards. +func TestField_AvailableShards(t *testing.T) { + idx := test.MustOpenIndex() + defer idx.Close() + + f, err := idx.CreateField("f", pilosa.OptFieldTypeDefault()) + if err != nil { + t.Fatal(err) + } + + // Set values on shards 0 & 2, and verify. + if _, err := f.SetBit(0, 100, nil); err != nil { + t.Fatal(err) + } else if _, err := f.SetBit(0, ShardWidth*2, nil); err != nil { + t.Fatal(err) + } else if diff := cmp.Diff(f.AvailableShards().Slice(), []uint64{0, 2}); diff != "" { + t.Fatal(diff) + } + + // Set remote shards and verify. + f.AddRemoteAvailableShards(roaring.NewBitmap(1, 2, 4)) + if diff := cmp.Diff(f.AvailableShards().Slice(), []uint64{0, 1, 2, 4}); diff != "" { + t.Fatal(diff) + } + + // Delete shards; only local shards should remain. + f.RemoveAvailableShard(0) + f.RemoveAvailableShard(1) + f.RemoveAvailableShard(2) + f.RemoveAvailableShard(3) + f.RemoveAvailableShard(4) + if diff := cmp.Diff(f.AvailableShards().Slice(), []uint64{0, 2}); diff != "" { + t.Fatal(diff) + } +} diff --git a/holder_internal_test.go b/holder_internal_test.go index 0e61b87a5..1c4dfad88 100644 --- a/holder_internal_test.go +++ b/holder_internal_test.go @@ -209,8 +209,8 @@ func TestHolderCleaner_CleanHolder(t *testing.T) { hldr0.SetBit("y", "z", 10, (2*ShardWidth)+7) // Set highest shard. - hldr0.Field("i", "f").addRemoteAvailableShards(roaring.NewBitmap(0, 1)) - hldr0.Field("y", "z").addRemoteAvailableShards(roaring.NewBitmap(0, 1, 2)) + hldr0.Field("i", "f").AddRemoteAvailableShards(roaring.NewBitmap(0, 1)) + hldr0.Field("y", "z").AddRemoteAvailableShards(roaring.NewBitmap(0, 1, 2)) // Keep replication the same and ensure we get the expected results. cluster.ReplicaN = 2 diff --git a/http/handler.go b/http/handler.go index cb242475c..8b239ec2d 100644 --- a/http/handler.go +++ b/http/handler.go @@ -255,6 +255,7 @@ func newRouter(handler *Handler) *mux.Router { router.HandleFunc("/internal/fragment/nodes", handler.handleGetFragmentNodes).Methods("GET").Name("GetFragmentNodes") router.HandleFunc("/internal/index/{index}/attr/diff", handler.handlePostIndexAttrDiff).Methods("POST").Name("PostIndexAttrDiff") router.HandleFunc("/internal/index/{index}/field/{field}/attr/diff", handler.handlePostFieldAttrDiff).Methods("POST").Name("PostFieldAttrDiff") + router.HandleFunc("/internal/index/{index}/field/{field}/remote-available-shards/{shardID}", handler.handleDeleteRemoteAvailableShard).Methods("DELETE") router.HandleFunc("/internal/nodes", handler.handleGetNodes).Methods("GET").Name("GetNodes") router.HandleFunc("/internal/shards/max", handler.handleGetShardsMax).Methods("GET").Name("GetShardsMax") // TODO: deprecate, but it's being used by the client router.HandleFunc("/internal/translate/data", handler.handleGetTranslateData).Methods("GET").Name("GetTranslateData") @@ -846,6 +847,22 @@ func (h *Handler) handleDeleteField(w http.ResponseWriter, r *http.Request) { resp.write(w, err) } +// handleDeleteRemoteAvailableShard handles DELETE /field/{field}/available-shards/{shardID} request. +func (h *Handler) handleDeleteRemoteAvailableShard(w http.ResponseWriter, r *http.Request) { + if !validHeaderAcceptJSON(r.Header) { + http.Error(w, "JSON only acceptable response", http.StatusNotAcceptable) + return + } + + indexName := mux.Vars(r)["index"] + fieldName := mux.Vars(r)["field"] + shardID, _ := strconv.ParseUint(mux.Vars(r)["shardID"], 10, 64) + + resp := successResponse{} + err := h.api.DeleteAvailableShard(r.Context(), indexName, fieldName, shardID) + resp.write(w, err) +} + // handlePostFieldAttrDiff handles POST /internal/field/attr/diff requests. func (h *Handler) handlePostFieldAttrDiff(w http.ResponseWriter, r *http.Request) { if !validHeaderAcceptJSON(r.Header) { diff --git a/internal/private.pb.go b/internal/private.pb.go index c65049d51..be4719e2f 100644 --- a/internal/private.pb.go +++ b/internal/private.pb.go @@ -20,6 +20,7 @@ CreateIndexMessage CreateFieldMessage DeleteFieldMessage + DeleteAvailableShardMessage Field Schema Index @@ -397,6 +398,40 @@ func (m *DeleteFieldMessage) GetField() string { return "" } +type DeleteAvailableShardMessage struct { + Index string `protobuf:"bytes,1,opt,name=Index,proto3" json:"Index,omitempty"` + Field string `protobuf:"bytes,2,opt,name=Field,proto3" json:"Field,omitempty"` + ShardID uint64 `protobuf:"varint,3,opt,name=ShardID,proto3" json:"ShardID,omitempty"` +} + +func (m *DeleteAvailableShardMessage) Reset() { *m = DeleteAvailableShardMessage{} } +func (m *DeleteAvailableShardMessage) String() string { return proto.CompactTextString(m) } +func (*DeleteAvailableShardMessage) ProtoMessage() {} +func (*DeleteAvailableShardMessage) Descriptor() ([]byte, []int) { + return fileDescriptorPrivate, []int{12} +} + +func (m *DeleteAvailableShardMessage) GetIndex() string { + if m != nil { + return m.Index + } + return "" +} + +func (m *DeleteAvailableShardMessage) GetField() string { + if m != nil { + return m.Field + } + return "" +} + +func (m *DeleteAvailableShardMessage) GetShardID() uint64 { + if m != nil { + return m.ShardID + } + return 0 +} + type Field struct { Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"` Meta *FieldOptions `protobuf:"bytes,2,opt,name=Meta" json:"Meta,omitempty"` @@ -406,7 +441,7 @@ type Field struct { func (m *Field) Reset() { *m = Field{} } func (m *Field) String() string { return proto.CompactTextString(m) } func (*Field) ProtoMessage() {} -func (*Field) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{12} } +func (*Field) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{13} } func (m *Field) GetName() string { if m != nil { @@ -436,7 +471,7 @@ type Schema struct { func (m *Schema) Reset() { *m = Schema{} } func (m *Schema) String() string { return proto.CompactTextString(m) } func (*Schema) ProtoMessage() {} -func (*Schema) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{13} } +func (*Schema) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{14} } func (m *Schema) GetIndexes() []*Index { if m != nil { @@ -453,7 +488,7 @@ type Index struct { func (m *Index) Reset() { *m = Index{} } func (m *Index) String() string { return proto.CompactTextString(m) } func (*Index) ProtoMessage() {} -func (*Index) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{14} } +func (*Index) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{15} } func (m *Index) GetName() string { if m != nil { @@ -478,7 +513,7 @@ type URI struct { func (m *URI) Reset() { *m = URI{} } func (m *URI) String() string { return proto.CompactTextString(m) } func (*URI) ProtoMessage() {} -func (*URI) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{15} } +func (*URI) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{16} } func (m *URI) GetScheme() string { if m != nil { @@ -510,7 +545,7 @@ type Node struct { func (m *Node) Reset() { *m = Node{} } func (m *Node) String() string { return proto.CompactTextString(m) } func (*Node) ProtoMessage() {} -func (*Node) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{16} } +func (*Node) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{17} } func (m *Node) GetID() string { if m != nil { @@ -541,7 +576,7 @@ type NodeStateMessage struct { func (m *NodeStateMessage) Reset() { *m = NodeStateMessage{} } func (m *NodeStateMessage) String() string { return proto.CompactTextString(m) } func (*NodeStateMessage) ProtoMessage() {} -func (*NodeStateMessage) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{17} } +func (*NodeStateMessage) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{18} } func (m *NodeStateMessage) GetNodeID() string { if m != nil { @@ -565,7 +600,7 @@ type NodeEventMessage struct { func (m *NodeEventMessage) Reset() { *m = NodeEventMessage{} } func (m *NodeEventMessage) String() string { return proto.CompactTextString(m) } func (*NodeEventMessage) ProtoMessage() {} -func (*NodeEventMessage) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{18} } +func (*NodeEventMessage) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{19} } func (m *NodeEventMessage) GetEvent() uint32 { if m != nil { @@ -590,7 +625,7 @@ type NodeStatus struct { func (m *NodeStatus) Reset() { *m = NodeStatus{} } func (m *NodeStatus) String() string { return proto.CompactTextString(m) } func (*NodeStatus) ProtoMessage() {} -func (*NodeStatus) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{19} } +func (*NodeStatus) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{20} } func (m *NodeStatus) GetNode() *Node { if m != nil { @@ -621,7 +656,7 @@ type IndexStatus struct { func (m *IndexStatus) Reset() { *m = IndexStatus{} } func (m *IndexStatus) String() string { return proto.CompactTextString(m) } func (*IndexStatus) ProtoMessage() {} -func (*IndexStatus) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{20} } +func (*IndexStatus) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{21} } func (m *IndexStatus) GetName() string { if m != nil { @@ -645,7 +680,7 @@ type FieldStatus struct { func (m *FieldStatus) Reset() { *m = FieldStatus{} } func (m *FieldStatus) String() string { return proto.CompactTextString(m) } func (*FieldStatus) ProtoMessage() {} -func (*FieldStatus) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{21} } +func (*FieldStatus) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{22} } func (m *FieldStatus) GetName() string { if m != nil { @@ -670,7 +705,7 @@ type ClusterStatus struct { func (m *ClusterStatus) Reset() { *m = ClusterStatus{} } func (m *ClusterStatus) String() string { return proto.CompactTextString(m) } func (*ClusterStatus) ProtoMessage() {} -func (*ClusterStatus) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{22} } +func (*ClusterStatus) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{23} } func (m *ClusterStatus) GetClusterID() string { if m != nil { @@ -703,7 +738,7 @@ type BSIGroup struct { func (m *BSIGroup) Reset() { *m = BSIGroup{} } func (m *BSIGroup) String() string { return proto.CompactTextString(m) } func (*BSIGroup) ProtoMessage() {} -func (*BSIGroup) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{23} } +func (*BSIGroup) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{24} } func (m *BSIGroup) GetName() string { if m != nil { @@ -742,7 +777,7 @@ type CreateViewMessage struct { func (m *CreateViewMessage) Reset() { *m = CreateViewMessage{} } func (m *CreateViewMessage) String() string { return proto.CompactTextString(m) } func (*CreateViewMessage) ProtoMessage() {} -func (*CreateViewMessage) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{24} } +func (*CreateViewMessage) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{25} } func (m *CreateViewMessage) GetIndex() string { if m != nil { @@ -774,7 +809,7 @@ type DeleteViewMessage struct { func (m *DeleteViewMessage) Reset() { *m = DeleteViewMessage{} } func (m *DeleteViewMessage) String() string { return proto.CompactTextString(m) } func (*DeleteViewMessage) ProtoMessage() {} -func (*DeleteViewMessage) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{25} } +func (*DeleteViewMessage) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{26} } func (m *DeleteViewMessage) GetIndex() string { if m != nil { @@ -809,7 +844,7 @@ type ResizeInstruction struct { func (m *ResizeInstruction) Reset() { *m = ResizeInstruction{} } func (m *ResizeInstruction) String() string { return proto.CompactTextString(m) } func (*ResizeInstruction) ProtoMessage() {} -func (*ResizeInstruction) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{26} } +func (*ResizeInstruction) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{27} } func (m *ResizeInstruction) GetJobID() int64 { if m != nil { @@ -864,7 +899,7 @@ type ResizeSource struct { func (m *ResizeSource) Reset() { *m = ResizeSource{} } func (m *ResizeSource) String() string { return proto.CompactTextString(m) } func (*ResizeSource) ProtoMessage() {} -func (*ResizeSource) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{27} } +func (*ResizeSource) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{28} } func (m *ResizeSource) GetNode() *Node { if m != nil { @@ -911,7 +946,7 @@ func (m *ResizeInstructionComplete) Reset() { *m = ResizeInstructionComp func (m *ResizeInstructionComplete) String() string { return proto.CompactTextString(m) } func (*ResizeInstructionComplete) ProtoMessage() {} func (*ResizeInstructionComplete) Descriptor() ([]byte, []int) { - return fileDescriptorPrivate, []int{28} + return fileDescriptorPrivate, []int{29} } func (m *ResizeInstructionComplete) GetJobID() int64 { @@ -942,7 +977,7 @@ type SetCoordinatorMessage struct { func (m *SetCoordinatorMessage) Reset() { *m = SetCoordinatorMessage{} } func (m *SetCoordinatorMessage) String() string { return proto.CompactTextString(m) } func (*SetCoordinatorMessage) ProtoMessage() {} -func (*SetCoordinatorMessage) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{29} } +func (*SetCoordinatorMessage) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{30} } func (m *SetCoordinatorMessage) GetNew() *Node { if m != nil { @@ -958,7 +993,7 @@ type UpdateCoordinatorMessage struct { func (m *UpdateCoordinatorMessage) Reset() { *m = UpdateCoordinatorMessage{} } func (m *UpdateCoordinatorMessage) String() string { return proto.CompactTextString(m) } func (*UpdateCoordinatorMessage) ProtoMessage() {} -func (*UpdateCoordinatorMessage) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{30} } +func (*UpdateCoordinatorMessage) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{31} } func (m *UpdateCoordinatorMessage) GetNew() *Node { if m != nil { @@ -975,7 +1010,7 @@ type Topology struct { func (m *Topology) Reset() { *m = Topology{} } func (m *Topology) String() string { return proto.CompactTextString(m) } func (*Topology) ProtoMessage() {} -func (*Topology) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{31} } +func (*Topology) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{32} } func (m *Topology) GetClusterID() string { if m != nil { @@ -997,7 +1032,7 @@ type RecalculateCaches struct { func (m *RecalculateCaches) Reset() { *m = RecalculateCaches{} } func (m *RecalculateCaches) String() string { return proto.CompactTextString(m) } func (*RecalculateCaches) ProtoMessage() {} -func (*RecalculateCaches) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{32} } +func (*RecalculateCaches) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{33} } func init() { proto.RegisterType((*IndexMeta)(nil), "internal.IndexMeta") @@ -1012,6 +1047,7 @@ func init() { proto.RegisterType((*CreateIndexMessage)(nil), "internal.CreateIndexMessage") proto.RegisterType((*CreateFieldMessage)(nil), "internal.CreateFieldMessage") proto.RegisterType((*DeleteFieldMessage)(nil), "internal.DeleteFieldMessage") + proto.RegisterType((*DeleteAvailableShardMessage)(nil), "internal.DeleteAvailableShardMessage") proto.RegisterType((*Field)(nil), "internal.Field") proto.RegisterType((*Schema)(nil), "internal.Schema") proto.RegisterType((*Index)(nil), "internal.Index") @@ -1487,6 +1523,41 @@ func (m *DeleteFieldMessage) MarshalTo(dAtA []byte) (int, error) { return i, nil } +func (m *DeleteAvailableShardMessage) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DeleteAvailableShardMessage) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Index) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintPrivate(dAtA, i, uint64(len(m.Index))) + i += copy(dAtA[i:], m.Index) + } + if len(m.Field) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintPrivate(dAtA, i, uint64(len(m.Field))) + i += copy(dAtA[i:], m.Field) + } + if m.ShardID != 0 { + dAtA[i] = 0x18 + i++ + i = encodeVarintPrivate(dAtA, i, uint64(m.ShardID)) + } + return i, nil +} + func (m *Field) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2508,6 +2579,23 @@ func (m *DeleteFieldMessage) Size() (n int) { return n } +func (m *DeleteAvailableShardMessage) Size() (n int) { + var l int + _ = l + l = len(m.Index) + if l > 0 { + n += 1 + l + sovPrivate(uint64(l)) + } + l = len(m.Field) + if l > 0 { + n += 1 + l + sovPrivate(uint64(l)) + } + if m.ShardID != 0 { + n += 1 + sovPrivate(uint64(m.ShardID)) + } + return n +} + func (m *Field) Size() (n int) { var l int _ = l @@ -4442,6 +4530,133 @@ func (m *DeleteFieldMessage) Unmarshal(dAtA []byte) error { } return nil } +func (m *DeleteAvailableShardMessage) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrivate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeleteAvailableShardMessage: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeleteAvailableShardMessage: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrivate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPrivate + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Index = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Field", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrivate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPrivate + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Field = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ShardID", wireType) + } + m.ShardID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrivate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ShardID |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipPrivate(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthPrivate + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *Field) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -7184,74 +7399,75 @@ var ( func init() { proto.RegisterFile("private.proto", fileDescriptorPrivate) } var fileDescriptorPrivate = []byte{ - // 1095 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xdd, 0x6e, 0xdc, 0x44, - 0x14, 0xc6, 0x3f, 0xbb, 0xd9, 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 0x3c, 0xd5, 0x4a, 0x7e, 0x1b, 0x2f, 0xbc, 0x53, 0x5f, 0xb8, 0xa0, 0xa6, 0x17, 0xad, 0xc9, - 0x2f, 0x16, 0xdc, 0x68, 0x52, 0x78, 0xad, 0xc1, 0xad, 0x2a, 0x62, 0xcf, 0xac, 0x88, 0x33, 0xab, - 0x22, 0x6e, 0x5d, 0x91, 0xfa, 0xc3, 0xdc, 0x6a, 0x7c, 0x98, 0xc9, 0x31, 0xdc, 0xb9, 0x54, 0xa6, - 0x2d, 0x31, 0x4e, 0x55, 0x3f, 0xfc, 0x8f, 0x72, 0xa9, 0x95, 0x96, 0x65, 0xa6, 0x50, 0x5d, 0xaa, - 0x05, 0xf2, 0x19, 0xdc, 0x0e, 0xb9, 0x6c, 0x14, 0xa9, 0xec, 0xb6, 0x35, 0x70, 0x76, 0xf9, 0xe9, - 0x15, 0xcf, 0x57, 0x2a, 0xf2, 0x25, 0xf8, 0xfb, 0xe9, 0x88, 0x49, 0x7e, 0xad, 0xdb, 0x9b, 0xd0, - 0xd9, 0x13, 0xa9, 0x88, 0xc5, 0xcb, 0xc9, 0x9c, 0xa9, 0xf7, 0x61, 0x41, 0xef, 0x6f, 0xbd, 0x46, - 0xba, 0xb4, 0x14, 0xc9, 0x2d, 0xd5, 0xd0, 0x43, 0x16, 0x0f, 0x8b, 0x58, 0xd1, 0x50, 0x3f, 0x6d, - 0xf9, 0xe6, 0xd2, 0x9f, 0xe7, 0xab, 0xd6, 0x5f, 0xe7, 0xab, 0xd6, 0xdf, 0xe7, 0xab, 0xd6, 0x6f, - 0xff, 0xac, 0xbe, 0x75, 0xd8, 0xc6, 0x9f, 0xfa, 0x47, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0x31, - 0x07, 0xf3, 0xac, 0xe5, 0x0b, 0x00, 0x00, + // 1113 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57,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x24, 0x63, 0xfe, 0x7d, 0xc9, 0x32, 0x59, 0x8e, 0xc3, 0x16, 0x6a, 0x37, 0x21, + 0x15, 0x2a, 0x1a, 0xee, 0x20, 0x0b, 0xdf, 0xc1, 0x12, 0x78, 0xdb, 0x49, 0x16, 0x76, 0x57, 0x9d, + 0x35, 0x8f, 0xaa, 0x27, 0x22, 0xec, 0x38, 0x04, 0x83, 0xb0, 0xe3, 0x2a, 0xc5, 0x5e, 0x9d, 0x22, + 0x21, 0xb0, 0x18, 0x8d, 0x27, 0x22, 0x97, 0x94, 0x17, 0x13, 0x91, 0x15, 0x68, 0x69, 0x2b, 0xcf, + 0x43, 0x07, 0x8d, 0xab, 0x27, 0xf9, 0x11, 0x96, 0x36, 0x52, 0x31, 0x3c, 0x18, 0x30, 0xc9, 0x28, + 0xff, 0xa1, 0xe4, 0x85, 0x0c, 0xde, 0x84, 0x16, 0xd6, 0xce, 0xc8, 0x69, 0x42, 0xa1, 0x58, 0x87, + 0xd0, 0xd5, 0x28, 0x12, 0x0a, 0x45, 0x7d, 0xac, 0x84, 0x4f, 0x35, 0xa1, 0xd0, 0x78, 0x9f, 0xe5, + 0x23, 0xac, 0x80, 0x4f, 0x35, 0xa1, 0x62, 0xdc, 0x4d, 0xf8, 0x91, 0x49, 0x1b, 0xdf, 0x24, 0x82, + 0xe5, 0x86, 0x7f, 0x13, 0xe6, 0x2d, 0x68, 0x53, 0x71, 0x14, 0x0d, 0x8a, 0xd0, 0x59, 0xf5, 0xd6, + 0x7c, 0x6a, 0x28, 0x2c, 0xae, 0x48, 0xcb, 0x71, 0xa6, 0x58, 0x2e, 0xb2, 0x6a, 0x80, 0xdc, 0x86, + 0x16, 0x56, 0x5a, 0x65, 0x59, 0xeb, 0xaa, 0x27, 0xf9, 0xc9, 0x81, 0xee, 0x36, 0x3b, 0xc6, 0x30, + 0x8a, 0xe0, 0x11, 0x74, 0x62, 0xc9, 0xb2, 0x91, 0x0a, 0x50, 0x09, 0xf5, 0x1e, 0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0x68, 0x4a, 0x0c, 0x00, 0x00, } diff --git a/internal/private.proto b/internal/private.proto index 88d16363f..57b98f62c 100644 --- a/internal/private.proto +++ b/internal/private.proto @@ -68,6 +68,12 @@ message DeleteFieldMessage { string Field = 2; } +message DeleteAvailableShardMessage { + string Index = 1; + string Field = 2; + uint64 ShardID = 3; +} + message Field { string Name = 1; FieldOptions Meta = 2; diff --git a/server.go b/server.go index 3815f1bf4..9a11a8025 100644 --- a/server.go +++ b/server.go @@ -484,7 +484,7 @@ func (s *Server) receiveMessage(m Message) error { if f == nil { return fmt.Errorf("Local field not found: %s/%s", obj.Index, obj.Field) } - if err := f.addRemoteAvailableShards(roaring.NewBitmap(obj.Shard)); err != nil { + if err := f.AddRemoteAvailableShards(roaring.NewBitmap(obj.Shard)); err != nil { return errors.Wrap(err, "adding remote available shards") } case *CreateIndexMessage: @@ -512,6 +512,11 @@ func (s *Server) receiveMessage(m Message) error { if err := idx.DeleteField(obj.Field); err != nil { return err } + case *DeleteAvailableShardMessage: + f := s.holder.Field(obj.Index, obj.Field) + if err := f.RemoveAvailableShard(obj.ShardID); err != nil { + return err + } case *CreateViewMessage: f := s.holder.Field(obj.Index, obj.Field) if f == nil { @@ -651,7 +656,7 @@ func (s *Server) mergeRemoteStatus(ns *NodeStatus) error { s.logger.Printf("Local Field not found: %s/%s", is.Name, fs.Name) continue } - if err := f.addRemoteAvailableShards(fs.AvailableShards); err != nil { + if err := f.AddRemoteAvailableShards(fs.AvailableShards); err != nil { return errors.Wrap(err, "adding remote available shards") } }