lib/db, lib/model: Always use reasonable sized batches (fixes #2250, fixes #4112)

Harmonize how we use batches in the model, using ProtoSize() to judge
the actual weight of the entire batch instead of estimating. Use smaller
batches in the block map - I think we might have though that batch.Len()
in the leveldb was the batch size in bytes, but it's actually number of
operations.

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4114
This commit is contained in:
Jakob Borg authored and Audrius Butkevicius committed 2017-04-22 14:23:33 +00:00
1 parent 10894695c6
commit e9f05d138f
2 files changed
+26 -22

No files matched your search

+1 -1
View File
@@ -19,7 +19,7 @@ import (
var blockFinder *BlockFinder
const maxBatchSize = 256 << 10
const maxBatchSize = 1000
type BlockMap struct {
db *Instance