Commit 189ce9a1 authored by acud's avatar acud Committed by GitHub

fix: least authority gcSizeChange bug (#2296)

parent 86e05a42
...@@ -137,8 +137,8 @@ func (db *DB) put(mode storage.ModePut, chs ...swarm.Chunk) (exist []bool, err e ...@@ -137,8 +137,8 @@ func (db *DB) put(mode storage.ModePut, chs ...swarm.Chunk) (exist []bool, err e
if err != nil { if err != nil {
return nil, err return nil, err
} }
gcSizeChange += c
} }
gcSizeChange += c
} }
case storage.ModePutSync: case storage.ModePutSync:
......
...@@ -260,6 +260,7 @@ func TestModePutUpload(t *testing.T) { ...@@ -260,6 +260,7 @@ func TestModePutUpload(t *testing.T) {
newPinIndexTest(db, ch, leveldb.ErrNotFound)(t) newPinIndexTest(db, ch, leveldb.ErrNotFound)(t)
} }
newItemsCountTest(db.postageIndexIndex, tc.count)(t) newItemsCountTest(db.postageIndexIndex, tc.count)(t)
newIndexGCSizeTest(db)(t)
}) })
} }
} }
...@@ -298,6 +299,7 @@ func TestModePutUploadPin(t *testing.T) { ...@@ -298,6 +299,7 @@ func TestModePutUploadPin(t *testing.T) {
newPinIndexTest(db, ch, nil)(t) newPinIndexTest(db, ch, nil)(t)
} }
newItemsCountTest(db.postageIndexIndex, tc.count)(t) newItemsCountTest(db.postageIndexIndex, tc.count)(t)
newIndexGCSizeTest(db)(t)
}) })
} }
} }
...@@ -484,6 +486,7 @@ func TestModePut_sameChunk(t *testing.T) { ...@@ -484,6 +486,7 @@ func TestModePut_sameChunk(t *testing.T) {
newItemsCountTest(db.retrievalDataIndex, tc.count)(t) newItemsCountTest(db.retrievalDataIndex, tc.count)(t)
newItemsCountTest(db.pullIndex, count(tcn.pullIndex))(t) newItemsCountTest(db.pullIndex, count(tcn.pullIndex))(t)
newItemsCountTest(db.pushIndex, count(tcn.pushIndex))(t) newItemsCountTest(db.pushIndex, count(tcn.pushIndex))(t)
newIndexGCSizeTest(db)(t)
} }
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment