mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-06 19:07:50 +00:00
return 0 values for errors. panic on unmarshal node meta data
This commit is contained in:
parent
86dbbbf393
commit
346e92a91d
2 changed files with 4 additions and 5 deletions
|
|
@ -633,12 +633,12 @@ func (c *Cluster) diff(other *Cluster) (action string, nodeID string, err error)
|
|||
lenTo := len(other.Nodes)
|
||||
// Determine if a node is being added or removed.
|
||||
if lenFrom == lenTo {
|
||||
return action, nodeID, errors.New("clusters are the same size")
|
||||
return "", "", errors.New("clusters are the same size")
|
||||
}
|
||||
if lenFrom < lenTo {
|
||||
// Adding a node.
|
||||
if lenTo-lenFrom > 1 {
|
||||
return action, nodeID, errors.New("adding more than one node at a time is not supported")
|
||||
return "", "", errors.New("adding more than one node at a time is not supported")
|
||||
}
|
||||
action = ResizeJobActionAdd
|
||||
// Determine the node ID that is being added.
|
||||
|
|
@ -651,7 +651,7 @@ func (c *Cluster) diff(other *Cluster) (action string, nodeID string, err error)
|
|||
} else if lenFrom > lenTo {
|
||||
// Removing a node.
|
||||
if lenFrom-lenTo > 1 {
|
||||
return action, nodeID, errors.New("removing more than one node at a time is not supported")
|
||||
return "", "", errors.New("removing more than one node at a time is not supported")
|
||||
}
|
||||
action = ResizeJobActionRemove
|
||||
// Determine the node ID that is being removed.
|
||||
|
|
|
|||
|
|
@ -384,8 +384,7 @@ func (g *GossipEventReceiver) listen() {
|
|||
// Get the node from the event.Node meta data.
|
||||
var n internal.Node
|
||||
if err := proto.Unmarshal(e.Node.Meta, &n); err != nil {
|
||||
// TODO: consider logging error
|
||||
continue
|
||||
panic("failed to unmarshal event node meta data")
|
||||
}
|
||||
node := pilosa.DecodeNode(&n)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue