syncthing/lib/db
Jakob Borg 5b37d0356c lib/model, gui: Correct completion percentages when there are lots of deletes (fixes #3496)
We used to consider deleted files & directories 128 bytes large. After
the delta indexes change a bug slipped in where deleted files would be
weighted according to their old non-deleted size. Both ways are
incorrect (but the latest change made it worse), as if there are more
files deleted than remaining data in the repo the needSize can be
greater than the globalSize, resulting in a negative completion
percentage.

This change makes it so that deleted items are zero bytes large, which
makes more sense. Instead we expose the number of files that we need to
delete as a separate field in the Completion() result, and hack the
percentage down to 95% complete if it was 100% complete but we need to
delete files. This latter part is sort of ugly, but necessary to give
the user some sort of feedback.

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3556
2016-09-02 06:45:46 +00:00
..
testdata lib/protocol, lib/discover, lib/db: Use protocol buffer serialization (fixes #3080) 2016-07-04 10:40:29 +00:00
.gitignore Change DB label format (index folders, devices) 2016-01-03 19:32:40 +01:00
benchmark_test.go Benchmark must use *db.Instance 2015-11-05 17:46:53 +00:00
blockmap_test.go lib/protocol, lib/discover, lib/db: Use protocol buffer serialization (fixes #3080) 2016-07-04 10:40:29 +00:00
blockmap.go Change DB label format (index folders, devices) 2016-01-03 19:32:40 +01:00
concurrency_test.go mv internal lib 2015-08-09 09:35:26 +02:00
debug.go Implement facility based logger, debugging via REST API 2015-10-03 18:09:53 +02:00
leveldb_dbinstance.go lib/db, lib/fs, lib/model: Introduce fs.MtimeFS, remove VirtualMtimeRepo 2016-08-05 17:45:45 +00:00
leveldb_test.go lib: Use bytes.Equal instead of bytes.Compare where possible 2016-03-31 15:12:46 +00:00
leveldb_transactions.go cmd/syncthing, lib/db, lib/model, lib/protocol: Implement delta indexes (fixes #438) 2016-07-23 12:46:31 +00:00
leveldb.go cmd/syncthing, lib/db, lib/model, lib/protocol: Implement delta indexes (fixes #438) 2016-07-23 12:46:31 +00:00
namespaced_test.go We should pass around db.Instance instead of leveldb.DB 2015-10-31 12:35:30 +01:00
namespaced.go We should pass around db.Instance instead of leveldb.DB 2015-10-31 12:35:30 +01:00
set_test.go all: Rename LocalVersion to Sequence (fixes #3461) 2016-07-29 19:54:24 +00:00
set.go lib/model, lib/config: Support "live" device removal, folder unsharing and folder configuration changes 2016-08-07 16:21:59 +00:00
structs.go lib/model, gui: Correct completion percentages when there are lots of deletes (fixes #3496) 2016-09-02 06:45:46 +00:00
structs.pb.go lib/protocol, lib/model: Implement high precision time stamps (fixes #3305) 2016-08-06 13:05:59 +00:00
structs.proto lib/protocol, lib/model: Implement high precision time stamps (fixes #3305) 2016-08-06 13:05:59 +00:00