diff --git a/gossip/keys.go b/gossip/keys.go index c2bd9ea62802..c74eac56933e 100644 --- a/gossip/keys.go +++ b/gossip/keys.go @@ -35,7 +35,7 @@ const ( KeyConfigZone = "zones" // KeyMaxAvailCapacityPrefix is the key prefix for gossiping available - // store capacity. The suffix is composed of: -. + // store capacity. The suffix is composed of: -. // The value is a storage.StoreDescriptor struct. KeyMaxAvailCapacityPrefix = "max-avail-capacity-" diff --git a/server/node.go b/server/node.go index 14f2562f97ec..bbad85a0413f 100644 --- a/server/node.go +++ b/server/node.go @@ -370,8 +370,8 @@ func (n *Node) gossipCapacities() { } // Unique gossip key per store. keyMaxCapacity := gossip.KeyMaxAvailCapacityPrefix + - strconv.FormatInt(int64(storeDesc.Node.NodeID), 16) + "-" + - strconv.FormatInt(int64(storeDesc.StoreID), 16) + strconv.FormatInt(int64(storeDesc.Node.NodeID), 10) + "-" + + strconv.FormatInt(int64(storeDesc.StoreID), 10) // Gossip store descriptor. n.gossip.AddInfo(keyMaxCapacity, *storeDesc, ttlCapacityGossip) return nil diff --git a/storage/store_finder.go b/storage/store_finder.go index 1524dd11013d..b7254243b4fa 100644 --- a/storage/store_finder.go +++ b/storage/store_finder.go @@ -54,6 +54,10 @@ func (s *Store) capacityGossipUpdate(key string, contentsChanged bool) { // // If it cannot retrieve a StoreDescriptor from the Store's gossip, it garbage // collects the failed key. +// +// TODO(embark, spencer): consider using a reverse index map from Attr->stores, +// for efficiency. Ensure that entries in this map still have an opportunity +// to be garbage collected. func (s *Store) findStores(required proto.Attributes) ([]*StoreDescriptor, error) { s.finderContext.Lock() defer s.finderContext.Unlock()