瀏覽代碼

Acquire exclusive lock when updating (#1025)

Dhruva Krishnamurthy 8 年之前
父節點
當前提交
d9815cdf0f
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      ring.go

+ 2 - 2
ring.go

@@ -142,8 +142,8 @@ type clusterMetadata struct {
 }
 
 func (c *clusterMetadata) setPartitioner(partitioner string) {
-	c.mu.RLock()
-	defer c.mu.RUnlock()
+	c.mu.Lock()
+	defer c.mu.Unlock()
 
 	if c.partitioner != partitioner {
 		// TODO: update other things now