From 84fddbc67f245d4dc95a3ad823f65c293b87684d Mon Sep 17 00:00:00 2001 From: Travis Turner Date: Wed, 12 Dec 2018 12:03:57 -0600 Subject: [PATCH 1/3] Replace the /fragment/data endpoint to support cluster resizing --- api.go | 21 ++++++++++++++++++++- client.go | 4 ++-- cluster.go | 4 ++-- http/client.go | 11 +++-------- http/handler.go | 23 +++++++++++++++++++++++ 5 files changed, 50 insertions(+), 13 deletions(-) diff --git a/api.go b/api.go index ce4fbd0ca..c6a1f3725 100644 --- a/api.go +++ b/api.go @@ -559,6 +559,23 @@ func (api *API) FragmentBlocks(ctx context.Context, indexName, fieldName, viewNa return blocks, nil } +// FragmentData returns all data in the specified fragment. +func (api *API) FragmentData(ctx context.Context, indexName, fieldName, viewName string, shard uint64) (io.WriterTo, error) { + span, _ := tracing.StartSpanFromContext(ctx, "API.FragmentBlocks") + defer span.Finish() + + if err := api.validate(apiFragmentData); err != nil { + return nil, errors.Wrap(err, "validating api method") + } + + // Retrieve fragment from holder. + f := api.holder.fragment(indexName, fieldName, viewName, shard) + if f == nil { + return nil, ErrFragmentNotFound + } + return f, nil +} + // Hosts returns a list of the hosts in the cluster including their ID, // URL, and which is the coordinator. func (api *API) Hosts(ctx context.Context) []*Node { @@ -1203,6 +1220,7 @@ const ( apiExportCSV apiFragmentBlockData apiFragmentBlocks + apiFragmentData apiField apiFieldAttrDiff //apiHosts // not implemented @@ -1232,7 +1250,8 @@ var methodsCommon = map[apiMethod]struct{}{ } var methodsResizing = map[apiMethod]struct{}{ - apiResizeAbort: {}, + apiFragmentData: {}, + apiResizeAbort: {}, } var methodsNormal = map[apiMethod]struct{}{ diff --git a/client.go b/client.go index b16222b7a..3762a27b9 100644 --- a/client.go +++ b/client.go @@ -52,7 +52,7 @@ type InternalClient interface { ColumnAttrDiff(ctx context.Context, uri *URI, index string, blks []AttrBlock) (map[uint64]map[string]interface{}, error) RowAttrDiff(ctx context.Context, uri *URI, index, field string, blks []AttrBlock) (map[uint64]map[string]interface{}, error) SendMessage(ctx context.Context, uri *URI, msg []byte) error - RetrieveShardFromURI(ctx context.Context, index, field string, shard uint64, uri URI) (io.ReadCloser, error) + RetrieveShardFromURI(ctx context.Context, index, field, view string, shard uint64, uri URI) (io.ReadCloser, error) ImportRoaring(ctx context.Context, uri *URI, index, field string, shard uint64, remote bool, req *ImportRoaringRequest) error } @@ -149,6 +149,6 @@ func (n nopInternalClient) RowAttrDiff(ctx context.Context, uri *URI, index, fie func (n nopInternalClient) SendMessage(ctx context.Context, uri *URI, msg []byte) error { return nil } -func (n nopInternalClient) RetrieveShardFromURI(ctx context.Context, index, field string, shard uint64, uri URI) (io.ReadCloser, error) { +func (n nopInternalClient) RetrieveShardFromURI(ctx context.Context, index, field, view string, shard uint64, uri URI) (io.ReadCloser, error) { return nil, nil } diff --git a/cluster.go b/cluster.go index ad6cdbe6a..4c1c0853a 100644 --- a/cluster.go +++ b/cluster.go @@ -1309,7 +1309,7 @@ func (c *cluster) followResizeInstruction(instr *ResizeInstruction) error { // Stream shard from remote node. c.logger.Printf("retrieve shard %d for index %s from host %s", src.Shard, src.Index, src.Node.URI) - rd, err := c.InternalClient.RetrieveShardFromURI(ctx, src.Index, src.Field, src.Shard, srcURI) + rd, err := c.InternalClient.RetrieveShardFromURI(ctx, src.Index, src.Field, src.View, src.Shard, srcURI) if err != nil { // For now it is an acceptable error if the fragment is not found // on the remote node. This occurs when a shard has been skipped and @@ -1318,7 +1318,7 @@ func (c *cluster) followResizeInstruction(instr *ResizeInstruction) error { // TODO: figure out a way to distinguish from "fragment not found" errors // which are true errors and which simply mean the fragment doesn't have data. if err == ErrFragmentNotFound { - return nil + continue } return errors.Wrap(err, "retrieving shard") } else if rd == nil { diff --git a/http/client.go b/http/client.go index b18757a46..46800fd70 100644 --- a/http/client.go +++ b/http/client.go @@ -705,24 +705,19 @@ func (c *InternalClient) exportNodeCSV(ctx context.Context, node *pilosa.Node, i return nil } -func (c *InternalClient) RetrieveShardFromURI(ctx context.Context, index, field string, shard uint64, uri pilosa.URI) (io.ReadCloser, error) { +func (c *InternalClient) RetrieveShardFromURI(ctx context.Context, index, field, view string, shard uint64, uri pilosa.URI) (io.ReadCloser, error) { span, ctx := tracing.StartSpanFromContext(ctx, "InternalClient.RetrieveShardFromURI") defer span.Finish() node := &pilosa.Node{ URI: uri, } - return c.backupShardNode(ctx, index, field, shard, node) -} -func (c *InternalClient) backupShardNode(ctx context.Context, index, field string, shard uint64, node *pilosa.Node) (io.ReadCloser, error) { - span, ctx := tracing.StartSpanFromContext(ctx, "InternalClient.backupShardNode") - defer span.Finish() - - u := nodePathToURL(node, "/fragment/data") + u := nodePathToURL(node, "/internal/fragment/data") u.RawQuery = url.Values{ "index": {index}, "field": {field}, + "view": {view}, "shard": {strconv.FormatUint(shard, 10)}, }.Encode() diff --git a/http/handler.go b/http/handler.go index 68719fdfe..c370656fa 100644 --- a/http/handler.go +++ b/http/handler.go @@ -192,6 +192,7 @@ func (h *Handler) populateValidators() { h.validators["PostClusterMessage"] = queryValidationSpecRequired() h.validators["GetFragmentBlockData"] = queryValidationSpecRequired() h.validators["GetFragmentBlocks"] = queryValidationSpecRequired("index", "field", "view", "shard") + h.validators["GetFragmentData"] = queryValidationSpecRequired("index", "field", "view", "shard") h.validators["GetFragmentNodes"] = queryValidationSpecRequired("shard", "index") h.validators["PostIndexAttrDiff"] = queryValidationSpecRequired() h.validators["PostFieldAttrDiff"] = queryValidationSpecRequired() @@ -262,6 +263,7 @@ func newRouter(handler *Handler) *mux.Router { router.HandleFunc("/internal/cluster/message", handler.handlePostClusterMessage).Methods("POST").Name("PostClusterMessage") router.HandleFunc("/internal/fragment/block/data", handler.handleGetFragmentBlockData).Methods("GET").Name("GetFragmentBlockData") router.HandleFunc("/internal/fragment/blocks", handler.handleGetFragmentBlocks).Methods("GET").Name("GetFragmentBlocks") + router.HandleFunc("/internal/fragment/data", handler.handleGetFragmentData).Methods("GET").Name("GetFragmentData") 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") @@ -1214,6 +1216,27 @@ type getFragmentBlocksResponse struct { Blocks []pilosa.FragmentBlock `json:"blocks"` } +// handleGetFragmentData handles GET /internal/fragment/data requests. +func (h *Handler) handleGetFragmentData(w http.ResponseWriter, r *http.Request) { + // Read shard parameter. + q := r.URL.Query() + shard, err := strconv.ParseUint(q.Get("shard"), 10, 64) + if err != nil { + http.Error(w, "shard required", http.StatusBadRequest) + return + } + // Retrieve fragment data from holder. + f, err := h.api.FragmentData(r.Context(), q.Get("index"), q.Get("field"), q.Get("view"), shard) + if err != nil { + http.Error(w, err.Error(), http.StatusNotFound) + return + } + // Stream fragment to response body. + if _, err := f.WriteTo(w); err != nil { + h.logger.Printf("error streaming fragment data: %s", err) + } +} + // handleGetVersion handles /version requests. func (h *Handler) handleGetVersion(w http.ResponseWriter, r *http.Request) { if !validHeaderAcceptJSON(r.Header) { From d28170ddc65f6d869b38963124a5b493da16b0e6 Mon Sep 17 00:00:00 2001 From: Travis Turner Date: Wed, 12 Dec 2018 15:12:49 -0600 Subject: [PATCH 2/3] Syncs AvailableShards when handling a ResizeInstruction. There was a situation where availableShards on a new node were not in sync with the cluster, so queries following a resize were incorrect. - Start a one-node cluster. - Write data to shards 0 and 1 - Start a second node. In the case where the hash algo was moving shard 0 to node1, then node1 only knew about shard 0, so queries to node1 would be incomplete. This PR modifies the ResizeInstruction message to replace `Schema` with `NodeStatus` (which contains both `Schema` and `AvailableShards`). So now when a resize instruction is received, the receiving node is able to sync its schema and availableShards. --- cluster.go | 48 +++++- encoding/proto/proto.go | 6 +- internal/private.pb.go | 313 ++++++++++++++++++++-------------------- internal/private.proto | 2 +- server/cluster_test.go | 44 ++++++ utils_internal_test.go | 19 ++- 6 files changed, 267 insertions(+), 165 deletions(-) diff --git a/cluster.go b/cluster.go index 4c1c0853a..c3a6b2f69 100644 --- a/cluster.go +++ b/cluster.go @@ -1218,7 +1218,7 @@ func (c *cluster) unprotectedGenerateResizeJobByAction(nodeAction nodeAction) (* Node: toCluster.unprotectedNodeByID(id), Coordinator: c.unprotectedCoordinatorNode(), Sources: sources, - Schema: &Schema{Indexes: c.holder.Schema()}, // Include the schema to ensure it's in sync on the receiving node. + NodeStatus: c.nodeStatus(), // Include the NodeStatus in order to ensure that schema and availableShards are in sync on the receiving node. ClusterStatus: c.unprotectedStatus(), } j.Instructions = append(j.Instructions, instr) @@ -1277,12 +1277,30 @@ func (c *cluster) followResizeInstruction(instr *ResizeInstruction) error { span, ctx := tracing.StartSpanFromContext(context.Background(), "Cluster.followResizeInstruction") defer span.Finish() - // Sync the schema received in the resize instruction. + // Sync the NodeStatus received in the resize instruction. + // Sync schema. c.logger.Debugf("holder applySchema") - if err := c.holder.applySchema(instr.Schema); err != nil { + if err := c.holder.applySchema(instr.NodeStatus.Schema); err != nil { return errors.Wrap(err, "applying schema") } + // Sync available shards. + for _, is := range instr.NodeStatus.Indexes { + for _, fs := range is.Fields { + f := c.holder.Field(is.Name, fs.Name) + + // if we don't know about a field locally, log an error because + // fields should be created and synced prior to shard creation + if f == nil { + c.logger.Printf("local field not found: %s/%s", is.Name, fs.Name) + continue + } + if err := f.AddRemoteAvailableShards(fs.AvailableShards); err != nil { + return errors.Wrap(err, "adding remote available shards") + } + } + } + // Request each source file in ResizeSources. for _, src := range instr.Sources { c.logger.Printf("get shard %d for index %s from host %s", src.Shard, src.Index, src.Node.URI) @@ -1817,6 +1835,28 @@ func (c *cluster) nodeLeave(nodeID string) error { return nil } +func (c *cluster) nodeStatus() *NodeStatus { + ns := &NodeStatus{ + Node: c.Node, + Schema: &Schema{Indexes: c.holder.Schema()}, + } + for _, idx := range ns.Schema.Indexes { + is := &IndexStatus{Name: idx.Name} + for _, f := range idx.Fields { + availableShards := roaring.NewBitmap() + if field := c.holder.Field(idx.Name, f.Name); field != nil { + availableShards = field.AvailableShards() + } + is.Fields = append(is.Fields, &FieldStatus{ + Name: f.Name, + AvailableShards: availableShards, + }) + } + ns.Indexes = append(ns.Indexes, is) + } + return ns +} + func (c *cluster) mergeClusterStatus(cs *ClusterStatus) error { c.mu.Lock() defer c.mu.Unlock() @@ -1918,7 +1958,7 @@ type ResizeInstruction struct { Node *Node Coordinator *Node Sources []*ResizeSource - Schema *Schema + NodeStatus *NodeStatus ClusterStatus *ClusterStatus } diff --git a/encoding/proto/proto.go b/encoding/proto/proto.go index 25e95ebac..f796f2f3e 100644 --- a/encoding/proto/proto.go +++ b/encoding/proto/proto.go @@ -457,7 +457,7 @@ func encodeResizeInstruction(m *pilosa.ResizeInstruction) *internal.ResizeInstru Node: encodeNode(m.Node), Coordinator: encodeNode(m.Coordinator), Sources: encodeResizeSources(m.Sources), - Schema: encodeSchema(m.Schema), + NodeStatus: encodeNodeStatus(m.NodeStatus), ClusterStatus: encodeClusterStatus(m.ClusterStatus), } } @@ -737,8 +737,8 @@ func decodeResizeInstruction(ri *internal.ResizeInstruction, m *pilosa.ResizeIns decodeNode(ri.Coordinator, m.Coordinator) m.Sources = make([]*pilosa.ResizeSource, len(ri.Sources)) decodeResizeSources(ri.Sources, m.Sources) - m.Schema = &pilosa.Schema{} - decodeSchema(ri.Schema, m.Schema) + m.NodeStatus = &pilosa.NodeStatus{} + decodeNodeStatus(ri.NodeStatus, m.NodeStatus) m.ClusterStatus = &pilosa.ClusterStatus{} decodeClusterStatus(ri.ClusterStatus, m.ClusterStatus) } diff --git a/internal/private.pb.go b/internal/private.pb.go index 0c5862b13..c5a51741b 100644 --- a/internal/private.pb.go +++ b/internal/private.pb.go @@ -32,7 +32,7 @@ func (m *IndexMeta) Reset() { *m = IndexMeta{} } func (m *IndexMeta) String() string { return proto.CompactTextString(m) } func (*IndexMeta) ProtoMessage() {} func (*IndexMeta) Descriptor() ([]byte, []int) { - return fileDescriptor_private_08d4c0c27f7a355f, []int{0} + return fileDescriptor_private_8095a89af06a70de, []int{0} } func (m *IndexMeta) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -93,7 +93,7 @@ func (m *FieldOptions) Reset() { *m = FieldOptions{} } func (m *FieldOptions) String() string { return proto.CompactTextString(m) } func (*FieldOptions) ProtoMessage() {} func (*FieldOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_private_08d4c0c27f7a355f, []int{1} + return fileDescriptor_private_8095a89af06a70de, []int{1} } func (m *FieldOptions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -189,7 +189,7 @@ func (m *ImportResponse) Reset() { *m = ImportResponse{} } func (m *ImportResponse) String() string { return proto.CompactTextString(m) } func (*ImportResponse) ProtoMessage() {} func (*ImportResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_private_08d4c0c27f7a355f, []int{2} + return fileDescriptor_private_8095a89af06a70de, []int{2} } func (m *ImportResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -240,7 +240,7 @@ func (m *BlockDataRequest) Reset() { *m = BlockDataRequest{} } func (m *BlockDataRequest) String() string { return proto.CompactTextString(m) } func (*BlockDataRequest) ProtoMessage() {} func (*BlockDataRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_private_08d4c0c27f7a355f, []int{3} + return fileDescriptor_private_8095a89af06a70de, []int{3} } func (m *BlockDataRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -316,7 +316,7 @@ func (m *BlockDataResponse) Reset() { *m = BlockDataResponse{} } func (m *BlockDataResponse) String() string { return proto.CompactTextString(m) } func (*BlockDataResponse) ProtoMessage() {} func (*BlockDataResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_private_08d4c0c27f7a355f, []int{4} + return fileDescriptor_private_8095a89af06a70de, []int{4} } func (m *BlockDataResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -370,7 +370,7 @@ func (m *Cache) Reset() { *m = Cache{} } func (m *Cache) String() string { return proto.CompactTextString(m) } func (*Cache) ProtoMessage() {} func (*Cache) Descriptor() ([]byte, []int) { - return fileDescriptor_private_08d4c0c27f7a355f, []int{5} + return fileDescriptor_private_8095a89af06a70de, []int{5} } func (m *Cache) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -417,7 +417,7 @@ func (m *MaxShards) Reset() { *m = MaxShards{} } func (m *MaxShards) String() string { return proto.CompactTextString(m) } func (*MaxShards) ProtoMessage() {} func (*MaxShards) Descriptor() ([]byte, []int) { - return fileDescriptor_private_08d4c0c27f7a355f, []int{6} + return fileDescriptor_private_8095a89af06a70de, []int{6} } func (m *MaxShards) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -466,7 +466,7 @@ func (m *CreateShardMessage) Reset() { *m = CreateShardMessage{} } func (m *CreateShardMessage) String() string { return proto.CompactTextString(m) } func (*CreateShardMessage) ProtoMessage() {} func (*CreateShardMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_private_08d4c0c27f7a355f, []int{7} + return fileDescriptor_private_8095a89af06a70de, []int{7} } func (m *CreateShardMessage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -527,7 +527,7 @@ func (m *DeleteIndexMessage) Reset() { *m = DeleteIndexMessage{} } func (m *DeleteIndexMessage) String() string { return proto.CompactTextString(m) } func (*DeleteIndexMessage) ProtoMessage() {} func (*DeleteIndexMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_private_08d4c0c27f7a355f, []int{8} + return fileDescriptor_private_8095a89af06a70de, []int{8} } func (m *DeleteIndexMessage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -575,7 +575,7 @@ func (m *CreateIndexMessage) Reset() { *m = CreateIndexMessage{} } func (m *CreateIndexMessage) String() string { return proto.CompactTextString(m) } func (*CreateIndexMessage) ProtoMessage() {} func (*CreateIndexMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_private_08d4c0c27f7a355f, []int{9} + return fileDescriptor_private_8095a89af06a70de, []int{9} } func (m *CreateIndexMessage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -631,7 +631,7 @@ func (m *CreateFieldMessage) Reset() { *m = CreateFieldMessage{} } func (m *CreateFieldMessage) String() string { return proto.CompactTextString(m) } func (*CreateFieldMessage) ProtoMessage() {} func (*CreateFieldMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_private_08d4c0c27f7a355f, []int{10} + return fileDescriptor_private_8095a89af06a70de, []int{10} } func (m *CreateFieldMessage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -693,7 +693,7 @@ func (m *DeleteFieldMessage) Reset() { *m = DeleteFieldMessage{} } func (m *DeleteFieldMessage) String() string { return proto.CompactTextString(m) } func (*DeleteFieldMessage) ProtoMessage() {} func (*DeleteFieldMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_private_08d4c0c27f7a355f, []int{11} + return fileDescriptor_private_8095a89af06a70de, []int{11} } func (m *DeleteFieldMessage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -749,7 +749,7 @@ func (m *DeleteAvailableShardMessage) Reset() { *m = DeleteAvailableShar func (m *DeleteAvailableShardMessage) String() string { return proto.CompactTextString(m) } func (*DeleteAvailableShardMessage) ProtoMessage() {} func (*DeleteAvailableShardMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_private_08d4c0c27f7a355f, []int{12} + return fileDescriptor_private_8095a89af06a70de, []int{12} } func (m *DeleteAvailableShardMessage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -812,7 +812,7 @@ func (m *Field) Reset() { *m = Field{} } func (m *Field) String() string { return proto.CompactTextString(m) } func (*Field) ProtoMessage() {} func (*Field) Descriptor() ([]byte, []int) { - return fileDescriptor_private_08d4c0c27f7a355f, []int{13} + return fileDescriptor_private_8095a89af06a70de, []int{13} } func (m *Field) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -873,7 +873,7 @@ func (m *Schema) Reset() { *m = Schema{} } func (m *Schema) String() string { return proto.CompactTextString(m) } func (*Schema) ProtoMessage() {} func (*Schema) Descriptor() ([]byte, []int) { - return fileDescriptor_private_08d4c0c27f7a355f, []int{14} + return fileDescriptor_private_8095a89af06a70de, []int{14} } func (m *Schema) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -921,7 +921,7 @@ func (m *Index) Reset() { *m = Index{} } func (m *Index) String() string { return proto.CompactTextString(m) } func (*Index) ProtoMessage() {} func (*Index) Descriptor() ([]byte, []int) { - return fileDescriptor_private_08d4c0c27f7a355f, []int{15} + return fileDescriptor_private_8095a89af06a70de, []int{15} } func (m *Index) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -977,7 +977,7 @@ func (m *URI) Reset() { *m = URI{} } func (m *URI) String() string { return proto.CompactTextString(m) } func (*URI) ProtoMessage() {} func (*URI) Descriptor() ([]byte, []int) { - return fileDescriptor_private_08d4c0c27f7a355f, []int{16} + return fileDescriptor_private_8095a89af06a70de, []int{16} } func (m *URI) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1041,7 +1041,7 @@ func (m *Node) Reset() { *m = Node{} } func (m *Node) String() string { return proto.CompactTextString(m) } func (*Node) ProtoMessage() {} func (*Node) Descriptor() ([]byte, []int) { - return fileDescriptor_private_08d4c0c27f7a355f, []int{17} + return fileDescriptor_private_8095a89af06a70de, []int{17} } func (m *Node) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1110,7 +1110,7 @@ func (m *NodeStateMessage) Reset() { *m = NodeStateMessage{} } func (m *NodeStateMessage) String() string { return proto.CompactTextString(m) } func (*NodeStateMessage) ProtoMessage() {} func (*NodeStateMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_private_08d4c0c27f7a355f, []int{18} + return fileDescriptor_private_8095a89af06a70de, []int{18} } func (m *NodeStateMessage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1165,7 +1165,7 @@ func (m *NodeEventMessage) Reset() { *m = NodeEventMessage{} } func (m *NodeEventMessage) String() string { return proto.CompactTextString(m) } func (*NodeEventMessage) ProtoMessage() {} func (*NodeEventMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_private_08d4c0c27f7a355f, []int{19} + return fileDescriptor_private_8095a89af06a70de, []int{19} } func (m *NodeEventMessage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1221,7 +1221,7 @@ func (m *NodeStatus) Reset() { *m = NodeStatus{} } func (m *NodeStatus) String() string { return proto.CompactTextString(m) } func (*NodeStatus) ProtoMessage() {} func (*NodeStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_private_08d4c0c27f7a355f, []int{20} + return fileDescriptor_private_8095a89af06a70de, []int{20} } func (m *NodeStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1283,7 +1283,7 @@ func (m *IndexStatus) Reset() { *m = IndexStatus{} } func (m *IndexStatus) String() string { return proto.CompactTextString(m) } func (*IndexStatus) ProtoMessage() {} func (*IndexStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_private_08d4c0c27f7a355f, []int{21} + return fileDescriptor_private_8095a89af06a70de, []int{21} } func (m *IndexStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1338,7 +1338,7 @@ func (m *FieldStatus) Reset() { *m = FieldStatus{} } func (m *FieldStatus) String() string { return proto.CompactTextString(m) } func (*FieldStatus) ProtoMessage() {} func (*FieldStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_private_08d4c0c27f7a355f, []int{22} + return fileDescriptor_private_8095a89af06a70de, []int{22} } func (m *FieldStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1394,7 +1394,7 @@ func (m *ClusterStatus) Reset() { *m = ClusterStatus{} } func (m *ClusterStatus) String() string { return proto.CompactTextString(m) } func (*ClusterStatus) ProtoMessage() {} func (*ClusterStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_private_08d4c0c27f7a355f, []int{23} + return fileDescriptor_private_8095a89af06a70de, []int{23} } func (m *ClusterStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1458,7 +1458,7 @@ func (m *BSIGroup) Reset() { *m = BSIGroup{} } func (m *BSIGroup) String() string { return proto.CompactTextString(m) } func (*BSIGroup) ProtoMessage() {} func (*BSIGroup) Descriptor() ([]byte, []int) { - return fileDescriptor_private_08d4c0c27f7a355f, []int{24} + return fileDescriptor_private_8095a89af06a70de, []int{24} } func (m *BSIGroup) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1528,7 +1528,7 @@ func (m *CreateViewMessage) Reset() { *m = CreateViewMessage{} } func (m *CreateViewMessage) String() string { return proto.CompactTextString(m) } func (*CreateViewMessage) ProtoMessage() {} func (*CreateViewMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_private_08d4c0c27f7a355f, []int{25} + return fileDescriptor_private_8095a89af06a70de, []int{25} } func (m *CreateViewMessage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1591,7 +1591,7 @@ func (m *DeleteViewMessage) Reset() { *m = DeleteViewMessage{} } func (m *DeleteViewMessage) String() string { return proto.CompactTextString(m) } func (*DeleteViewMessage) ProtoMessage() {} func (*DeleteViewMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_private_08d4c0c27f7a355f, []int{26} + return fileDescriptor_private_8095a89af06a70de, []int{26} } func (m *DeleteViewMessage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1646,7 +1646,7 @@ type ResizeInstruction struct { Node *Node `protobuf:"bytes,2,opt,name=Node" json:"Node,omitempty"` Coordinator *Node `protobuf:"bytes,3,opt,name=Coordinator" json:"Coordinator,omitempty"` Sources []*ResizeSource `protobuf:"bytes,4,rep,name=Sources" json:"Sources,omitempty"` - Schema *Schema `protobuf:"bytes,5,opt,name=Schema" json:"Schema,omitempty"` + NodeStatus *NodeStatus `protobuf:"bytes,7,opt,name=NodeStatus" json:"NodeStatus,omitempty"` ClusterStatus *ClusterStatus `protobuf:"bytes,6,opt,name=ClusterStatus" json:"ClusterStatus,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -1657,7 +1657,7 @@ func (m *ResizeInstruction) Reset() { *m = ResizeInstruction{} } func (m *ResizeInstruction) String() string { return proto.CompactTextString(m) } func (*ResizeInstruction) ProtoMessage() {} func (*ResizeInstruction) Descriptor() ([]byte, []int) { - return fileDescriptor_private_08d4c0c27f7a355f, []int{27} + return fileDescriptor_private_8095a89af06a70de, []int{27} } func (m *ResizeInstruction) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1714,9 +1714,9 @@ func (m *ResizeInstruction) GetSources() []*ResizeSource { return nil } -func (m *ResizeInstruction) GetSchema() *Schema { +func (m *ResizeInstruction) GetNodeStatus() *NodeStatus { if m != nil { - return m.Schema + return m.NodeStatus } return nil } @@ -1743,7 +1743,7 @@ func (m *ResizeSource) Reset() { *m = ResizeSource{} } func (m *ResizeSource) String() string { return proto.CompactTextString(m) } func (*ResizeSource) ProtoMessage() {} func (*ResizeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_private_08d4c0c27f7a355f, []int{28} + return fileDescriptor_private_8095a89af06a70de, []int{28} } func (m *ResizeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1820,7 +1820,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 fileDescriptor_private_08d4c0c27f7a355f, []int{29} + return fileDescriptor_private_8095a89af06a70de, []int{29} } func (m *ResizeInstructionComplete) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1881,7 +1881,7 @@ func (m *SetCoordinatorMessage) Reset() { *m = SetCoordinatorMessage{} } func (m *SetCoordinatorMessage) String() string { return proto.CompactTextString(m) } func (*SetCoordinatorMessage) ProtoMessage() {} func (*SetCoordinatorMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_private_08d4c0c27f7a355f, []int{30} + return fileDescriptor_private_8095a89af06a70de, []int{30} } func (m *SetCoordinatorMessage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1928,7 +1928,7 @@ func (m *UpdateCoordinatorMessage) Reset() { *m = UpdateCoordinatorMessa func (m *UpdateCoordinatorMessage) String() string { return proto.CompactTextString(m) } func (*UpdateCoordinatorMessage) ProtoMessage() {} func (*UpdateCoordinatorMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_private_08d4c0c27f7a355f, []int{31} + return fileDescriptor_private_8095a89af06a70de, []int{31} } func (m *UpdateCoordinatorMessage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1976,7 +1976,7 @@ func (m *Topology) Reset() { *m = Topology{} } func (m *Topology) String() string { return proto.CompactTextString(m) } func (*Topology) ProtoMessage() {} func (*Topology) Descriptor() ([]byte, []int) { - return fileDescriptor_private_08d4c0c27f7a355f, []int{32} + return fileDescriptor_private_8095a89af06a70de, []int{32} } func (m *Topology) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2029,7 +2029,7 @@ func (m *RecalculateCaches) Reset() { *m = RecalculateCaches{} } func (m *RecalculateCaches) String() string { return proto.CompactTextString(m) } func (*RecalculateCaches) ProtoMessage() {} func (*RecalculateCaches) Descriptor() ([]byte, []int) { - return fileDescriptor_private_08d4c0c27f7a355f, []int{33} + return fileDescriptor_private_8095a89af06a70de, []int{33} } func (m *RecalculateCaches) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3270,21 +3270,21 @@ func (m *ResizeInstruction) MarshalTo(dAtA []byte) (int, error) { i += n } } - if m.Schema != nil { - dAtA[i] = 0x2a + if m.ClusterStatus != nil { + dAtA[i] = 0x32 i++ - i = encodeVarintPrivate(dAtA, i, uint64(m.Schema.Size())) - n18, err := m.Schema.MarshalTo(dAtA[i:]) + i = encodeVarintPrivate(dAtA, i, uint64(m.ClusterStatus.Size())) + n18, err := m.ClusterStatus.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n18 } - if m.ClusterStatus != nil { - dAtA[i] = 0x32 + if m.NodeStatus != nil { + dAtA[i] = 0x3a i++ - i = encodeVarintPrivate(dAtA, i, uint64(m.ClusterStatus.Size())) - n19, err := m.ClusterStatus.MarshalTo(dAtA[i:]) + i = encodeVarintPrivate(dAtA, i, uint64(m.NodeStatus.Size())) + n19, err := m.NodeStatus.MarshalTo(dAtA[i:]) if err != nil { return 0, err } @@ -4169,14 +4169,14 @@ func (m *ResizeInstruction) Size() (n int) { n += 1 + l + sovPrivate(uint64(l)) } } - if m.Schema != nil { - l = m.Schema.Size() - n += 1 + l + sovPrivate(uint64(l)) - } if m.ClusterStatus != nil { l = m.ClusterStatus.Size() n += 1 + l + sovPrivate(uint64(l)) } + if m.NodeStatus != nil { + l = m.NodeStatus.Size() + n += 1 + l + sovPrivate(uint64(l)) + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -8034,39 +8034,6 @@ func (m *ResizeInstruction) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Schema", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPrivate - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthPrivate - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Schema == nil { - m.Schema = &Schema{} - } - if err := m.Schema.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ClusterStatus", wireType) @@ -8100,6 +8067,39 @@ func (m *ResizeInstruction) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NodeStatus", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrivate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthPrivate + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NodeStatus == nil { + m.NodeStatus = &NodeStatus{} + } + if err := m.NodeStatus.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipPrivate(dAtA[iNdEx:]) @@ -8877,79 +8877,80 @@ var ( ErrIntOverflowPrivate = fmt.Errorf("proto: integer overflow") ) -func init() { proto.RegisterFile("private.proto", fileDescriptor_private_08d4c0c27f7a355f) } +func init() { proto.RegisterFile("private.proto", fileDescriptor_private_8095a89af06a70de) } -var fileDescriptor_private_08d4c0c27f7a355f = []byte{ - // 1131 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xdd, 0x6e, 0x1b, 0xc5, - 0x17, 0xff, 0xef, 0x87, 0x1d, 0xfb, 0xb8, 0x4e, 0x93, 0xed, 0xbf, 0x61, 0x0b, 0x28, 0x84, 0x51, - 0x45, 0x43, 0x25, 0x42, 0xd5, 0xde, 0xf0, 0x55, 0xa9, 0x24, 0x0e, 0x65, 0x29, 0x09, 0x65, 0x9c, - 0xe4, 0x8e, 0x8b, 0x89, 0x3d, 0x6a, 0x56, 0x59, 0xef, 0x98, 0xdd, 0xd9, 0x24, 0xee, 0x05, 0xb7, - 0x20, 0xf1, 0x02, 0x88, 0x27, 0xe2, 0x92, 0x47, 0xa8, 0xc2, 0x8b,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64, 0x1b, - 0xbc, 0x7d, 0x1a, 0xa9, 0x49, 0x45, 0x0f, 0xac, 0x16, 0x43, 0x29, 0xdd, 0x5f, 0x8b, 0x5c, 0x9a, - 0x3c, 0xe1, 0x59, 0x61, 0x2f, 0x45, 0x26, 0x31, 0x47, 0x5d, 0x8a, 0x67, 0x92, 0x83, 0xbf, 0x2b, - 0x86, 0x3c, 0x58, 0x04, 0x37, 0xea, 0x19, 0x1d, 0x6e, 0xd4, 0x0b, 0xde, 0x43, 0xf5, 0x26, 0x35, - 0xdd, 0xca, 0x89, 0x7d, 0x1a, 0x51, 0x34, 0x7c, 0x1f, 0xba, 0x51, 0xbe, 0x25, 0x44, 0x36, 0x8c, - 0x53, 0x26, 0x45, 0x66, 0xde, 0x80, 0x69, 0x10, 0x27, 0x48, 0x32, 0xa9, 0x37, 0x76, 0x9b, 0x6a, - 0x82, 0x3c, 0x83, 0x25, 0x65, 0x14, 0x09, 0x5b, 0xef, 0x15, 0x68, 0x2a, 0xac, 0x74, 0xc2, 0x50, - 0x95, 0x06, 0xb7, 0xae, 0xe1, 0x5b, 0xad, 0x61, 0xfb, 0x84, 0xa7, 0xb2, 0xd6, 0x31, 0x48, 0xa3, - 0x82, 0x2e, 0xd5, 0x44, 0x40, 0x74, 0x80, 0x26, 0x92, 0xc5, 0x2a, 0x12, 0x85, 0x52, 0xe4, 0x91, - 0x5f, 0x1d, 0x00, 0xeb, 0x50, 0x91, 0x97, 0x57, 0x9c, 0xcb, 0xaf, 0x04, 0xeb, 0xb6, 0xf2, 0x66, - 0x5a, 0x96, 0x2a, 0x29, 0x8d, 0x53, 0xdb, 0x19, 0x1f, 0x57, 0x9d, 0xa1, 0x4b, 0x7a, 0x77, 0xa6, - 0x33, 0xb4, 0xd5, 0xaa, 0x3f, 0x5e, 0x42, 0xa7, 0x86, 0xcf, 0xed, 0x92, 0x8f, 0xca, 0x2e, 0x71, - 0x67, 0x55, 0x22, 0x6e, 0x54, 0xda, 0x5e, 0x79, 0x01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, 0xe2, 0xce, 0xad, - 0x88, 0x37, 0xaf, 0x22, 0x7e, 0x55, 0x91, 0xea, 0x9b, 0xa0, 0x51, 0xfb, 0x26, 0x20, 0xc7, 0x70, - 0xef, 0x42, 0x99, 0xb6, 0xc4, 0x68, 0xac, 0xfa, 0xe1, 0x5f, 0x94, 0x4b, 0xad, 0xb4, 0x2c, 0x33, - 0x85, 0x6a, 0x53, 0x4d, 0x90, 0x4f, 0xe1, 0x6e, 0x9f, 0xcb, 0x5a, 0x91, 0x6c, 0xb7, 0xad, 0x81, - 0xb7, 0xcb, 0x4f, 0x2f, 0x09, 0x5f, 0xb1, 0xc8, 0x17, 0x10, 0xee, 0x8f, 0x87, 0x4c, 0xf2, 0x1b, - 0xdd, 0xde, 0x84, 0xd6, 0x9e, 0x18, 0x8b, 0x44, 0xbc, 0x9a, 0x5c, 0x31, 0xf5, 0x21, 0x2c, 0xe8, - 0xfd, 0xad, 0xd7, 0x48, 0x9b, 0x5a, 0x92, 0xdc, 0x51, 0x0d, 0x3d, 0x60, 0xc9, 0xa0, 0x48, 0x94, - 0x1b, 0xea, 0x7b, 0x31, 0xdf, 0x5c, 0xfa, 0xe3, 0x7c, 0xd5, 0xf9, 0xf3, 0x7c, 0xd5, 0x79, 0x73, - 0xbe, 0xea, 0xfc, 0xf6, 0xd7, 0xea, 0xff, 0x0e, 0x9b, 0xf8, 0xdf, 0xf1, 0xe4, 0xef, 0x00, 0x00, - 0x00, 0xff, 0xff, 0x61, 0x80, 0xe4, 0xef, 0x88, 0x0c, 0x00, 0x00, +var fileDescriptor_private_8095a89af06a70de = []byte{ + // 1139 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xdb, 0x6e, 0x1b, 0xc5, + 0x1b, 0xff, 0xef, 0x21, 0x8e, 0xfd, 0x39, 0x4e, 0x93, 0x6d, 0x9b, 0xff, 0x16, 0x50, 0x08, 0xa3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xdf, + 0x61, 0x03, 0xff, 0x83, 0x3c, 0xf9, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x1b, 0xd8, 0x6d, 0x1f, 0x94, + 0x0c, 0x00, 0x00, } diff --git a/internal/private.proto b/internal/private.proto index 1cd88c82c..971bb5f69 100644 --- a/internal/private.proto +++ b/internal/private.proto @@ -159,7 +159,7 @@ message ResizeInstruction { Node Node = 2; Node Coordinator = 3; repeated ResizeSource Sources = 4; - Schema Schema = 5; + NodeStatus NodeStatus = 7; ClusterStatus ClusterStatus = 6; } diff --git a/server/cluster_test.go b/server/cluster_test.go index 9227a2b53..90467f4b2 100644 --- a/server/cluster_test.go +++ b/server/cluster_test.go @@ -206,6 +206,16 @@ func TestClusterResize_AddNode(t *testing.T) { t.Fatal(err) } + // exp is the expected result for the Row queries that follow. + exp := `{"results":[{"attrs":{},"columns":[1,1300000]}]}` + "\n" + + // Verify the data exists on the single node. + if res, err := m0.Query("i", "", `Row(f=1)`); err != nil { + t.Fatal(err) + } else if res != exp { + t.Fatalf("unexpected result: %s", res) + } + // Configure node1 m1 := test.NewCommandNode(false) m1.Config.Gossip.Port = "0" @@ -221,6 +231,18 @@ func TestClusterResize_AddNode(t *testing.T) { } else if !checkClusterState(m1, pilosa.ClusterStateNormal, 1000) { t.Fatalf("unexpected node1 cluster state: %s", m1.API.State()) } + + // Verify the data exists on both nodes. + if res, err := m0.Query("i", "", `Row(f=1)`); err != nil { + t.Fatal(err) + } else if res != exp { + t.Fatalf("unexpected result: %s", res) + } + if res, err := m1.Query("i", "", `Row(f=1)`); err != nil { + t.Fatal(err) + } else if res != exp { + t.Fatalf("unexpected result: %s", res) + } }) t.Run("SkippedShard", func(t *testing.T) { // Configure node0 @@ -247,6 +269,16 @@ func TestClusterResize_AddNode(t *testing.T) { t.Fatal(err) } + // exp is the expected result for the Row queries that follow. + exp := `{"results":[{"attrs":{},"columns":[1,2400000]}]}` + "\n" + + // Verify the data exists on the single node. + if res, err := m0.Query("i", "", `Row(f=1)`); err != nil { + t.Fatal(err) + } else if res != exp { + t.Fatalf("unexpected result: %s", res) + } + // Configure node1 m1 := test.NewCommandNode(false) m1.Config.Gossip.Port = "0" @@ -262,6 +294,18 @@ func TestClusterResize_AddNode(t *testing.T) { } else if !checkClusterState(m1, pilosa.ClusterStateNormal, 1000) { t.Fatalf("unexpected node1 cluster state: %s", m1.API.State()) } + + // Verify the data exists on both nodes. + if res, err := m0.Query("i", "", `Row(f=1)`); err != nil { + t.Fatal(err) + } else if res != exp { + t.Fatalf("unexpected result: %s", res) + } + if res, err := m1.Query("i", "", `Row(f=1)`); err != nil { + t.Fatal(err) + } else if res != exp { + t.Fatalf("unexpected result: %s", res) + } }) } diff --git a/utils_internal_test.go b/utils_internal_test.go index ff149e8cf..21d8d0780 100644 --- a/utils_internal_test.go +++ b/utils_internal_test.go @@ -24,6 +24,7 @@ import ( "time" "github.com/gogo/protobuf/proto" + "github.com/pkg/errors" ) // NewTestCluster returns a cluster with n nodes and uses a mod-based hasher. @@ -371,10 +372,26 @@ func (t *ClusterCluster) FollowResizeInstruction(instr *ResizeInstruction) error destCluster := t.clusterByID(instrNode.ID) // Sync the schema received in the resize instruction. - if err := destCluster.holder.applySchema(instr.Schema); err != nil { + if err := destCluster.holder.applySchema(instr.NodeStatus.Schema); err != nil { return err } + // Sync available shards. + for _, is := range instr.NodeStatus.Indexes { + for _, fs := range is.Fields { + f := destCluster.holder.Field(is.Name, fs.Name) + + // if we don't know about a field locally, log an error because + // fields should be created and synced prior to shard creation + if f == nil { + continue + } + if err := f.AddRemoteAvailableShards(fs.AvailableShards); err != nil { + return errors.Wrap(err, "adding remote available shards") + } + } + } + for _, src := range instr.Sources { srcCluster := t.clusterByID(src.Node.ID) From ca2241731d20eceebb0b7176c1571f8a18a1e37a Mon Sep 17 00:00:00 2001 From: Travis Turner Date: Fri, 14 Dec 2018 17:29:48 -0600 Subject: [PATCH 3/3] fix tracing message. prevent reallocation of availableShards --- api.go | 2 +- cluster.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/api.go b/api.go index c6a1f3725..d3fb03615 100644 --- a/api.go +++ b/api.go @@ -561,7 +561,7 @@ func (api *API) FragmentBlocks(ctx context.Context, indexName, fieldName, viewNa // FragmentData returns all data in the specified fragment. func (api *API) FragmentData(ctx context.Context, indexName, fieldName, viewName string, shard uint64) (io.WriterTo, error) { - span, _ := tracing.StartSpanFromContext(ctx, "API.FragmentBlocks") + span, _ := tracing.StartSpanFromContext(ctx, "API.FragmentData") defer span.Finish() if err := api.validate(apiFragmentData); err != nil { diff --git a/cluster.go b/cluster.go index c3a6b2f69..e966c57a1 100644 --- a/cluster.go +++ b/cluster.go @@ -1840,12 +1840,14 @@ func (c *cluster) nodeStatus() *NodeStatus { Node: c.Node, Schema: &Schema{Indexes: c.holder.Schema()}, } + var availableShards *roaring.Bitmap for _, idx := range ns.Schema.Indexes { is := &IndexStatus{Name: idx.Name} for _, f := range idx.Fields { - availableShards := roaring.NewBitmap() if field := c.holder.Field(idx.Name, f.Name); field != nil { availableShards = field.AvailableShards() + } else { + availableShards = roaring.NewBitmap() } is.Fields = append(is.Fields, &FieldStatus{ Name: f.Name,