move write log back to flush so that we don't crawl to a halt

This commit is contained in:
vyzo 2021-07-02 12:38:27 +03:00
parent b3ddaa5f02
commit 4de0cd9fcb

View File

@ -610,8 +610,6 @@ func (s *SplitStore) trackWrite(c cid.Cid) {
defer s.mx.Unlock() defer s.mx.Unlock()
s.pendingWrites[c] = struct{}{} s.pendingWrites[c] = struct{}{}
s.debug.LogWrite(s.curTs, c, s.writeEpoch)
} }
// and also combine batch writes into them // and also combine batch writes into them
@ -622,8 +620,6 @@ func (s *SplitStore) trackWrites(cids []cid.Cid) {
for _, c := range cids { for _, c := range cids {
s.pendingWrites[c] = struct{}{} s.pendingWrites[c] = struct{}{}
} }
s.debug.LogWriteMany(s.curTs, cids, s.writeEpoch)
} }
func (s *SplitStore) flushPendingWrites(locked bool) { func (s *SplitStore) flushPendingWrites(locked bool) {
@ -647,6 +643,8 @@ func (s *SplitStore) flushPendingWrites(locked bool) {
if err != nil { if err != nil {
log.Errorf("error putting implicit write batch to tracker: %s", err) log.Errorf("error putting implicit write batch to tracker: %s", err)
} }
s.debug.LogWriteMany(s.curTs, cids, epoch)
} }
func (s *SplitStore) background() { func (s *SplitStore) background() {