Skip to content

Commit

Permalink
fixed after rollup del
Browse files Browse the repository at this point in the history
  • Loading branch information
harshil-goel committed Oct 6, 2024
1 parent 172fdc4 commit f1b87d5
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions posting/mvcc.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,16 +436,16 @@ func (sm *shardedMap) deleteOldItems(ts uint64) {
defer func() {
fmt.Println("Done deleting old items")
}()
for i := 0; i < numShards; i++ {
sm.shards[i].Lock()
defer sm.shards[i].Unlock()
//for i := 0; i < numShards; i++ {
// sm.shards[i].Lock()
// defer sm.shards[i].Unlock()

for keyHash, pl := range sm.shards[i].data {
if pl.lastUpdate < ts-10 {
delete(sm.shards[i].data, keyHash)
}
}
}
// for keyHash, pl := range sm.shards[i].data {
// if pl.lastUpdate < ts-100 {
// delete(sm.shards[i].data, keyHash)
// }
// }
//}
}

type lockedMap struct {
Expand Down Expand Up @@ -492,7 +492,9 @@ func (m *lockedMap) del(key uint64) {

func (m *lockedMap) Del(key uint64) {
m.Lock()
delete(m.data, key)
if l, ok := m.data[key]; ok && l != nil {
l.list = nil
}
m.Unlock()
}

Expand Down

0 comments on commit f1b87d5

Please sign in to comment.