aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2016-09-08 09:50:27 -0700
committerChris Lu <chris.lu@gmail.com>2016-09-08 09:50:31 -0700
commit01cbd5cb589f27ba4ffc5db3ca868c91f0d2c8a9 (patch)
tree4cc36030fa9acb7db7260b45ae3395c1dfd5d665
parent99e47fc5fcd5743324feda9498a699717761924d (diff)
downloadseaweedfs-01cbd5cb589f27ba4ffc5db3ca868c91f0d2c8a9.tar.xz
seaweedfs-01cbd5cb589f27ba4ffc5db3ca868c91f0d2c8a9.zip
lock
fix https://github.com/chrislusf/seaweedfs/issues/367
-rw-r--r--weed/storage/compact_map.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/weed/storage/compact_map.go b/weed/storage/compact_map.go
index 6afaf7df8..721be2ec7 100644
--- a/weed/storage/compact_map.go
+++ b/weed/storage/compact_map.go
@@ -41,10 +41,10 @@ func NewCompactSection(start Key) *CompactSection {
//return old entry size
func (cs *CompactSection) Set(key Key, offset uint32, size uint32) uint32 {
ret := uint32(0)
+ cs.Lock()
if key > cs.end {
cs.end = key
}
- cs.Lock()
if i := cs.binarySearchValues(key); i >= 0 {
ret = cs.values[i].Size
//println("key", key, "old size", ret)