better handling of MDB_KEYEXIST in Put

This commit is contained in:
vyzo
2021-03-05 14:46:17 +02:00
parent 3f8da19a34
commit 6e51e6db9a
+1 -6
View File
@@ -143,12 +143,7 @@ func (s *SplitStore) Put(blk blocks.Block) error {
s.mx.Unlock()
err := s.snoop.Put(blk.Cid(), epoch)
if err != nil {
if lmdb.IsErrno(err, lmdb.KeyExist) {
// duplicate write, ignore
return nil
}
if err != nil && !lmdb.IsErrno(err, lmdb.KeyExist) {
log.Errorf("error tracking CID in hotstore: %s; falling back to coldstore", err)
return s.cold.Put(blk)
}