File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -248,6 +248,15 @@ func (a *AtomicCache) releaseShard(shardSectionID uint8, shard uint32) bool {
248248
249249 if shardSection .shards [shard ].IsEmpty () == true {
250250 shardSection .shards [shard ] = nil
251+
252+ shardSection .shardsAvail = append (shardSection .shardsAvail , shard )
253+ for k , v := range shardSection .shardsActive {
254+ if v == shard {
255+ shardSection .shardsActive = append (shardSection .shardsActive [:k ], shardSection .shardsActive [k + 1 :]... )
256+ break
257+ }
258+ }
259+
251260 return true
252261 }
253262
@@ -291,6 +300,7 @@ func (a *AtomicCache) getEmptyShard(shardSectionID uint8) (uint32, bool) {
291300
292301 var shardIndex uint32
293302 shardIndex , shardSection .shardsAvail = shardSection .shardsAvail [0 ], shardSection .shardsAvail [1 :]
303+ shardSection .shardsActive = append (shardSection .shardsActive , shardIndex )
294304
295305 return shardIndex , true
296306}
You can’t perform that action at this time.
0 commit comments