mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-09 23:00:58 +00:00
d1d967f0cf
This keeps the data we need about sequence numbers and object counts persistently in the database. The sizeTracker is expanded into a metadataTracker than handled multiple folders, and the Counts struct is made protobuf serializable. It gains a Sequence field to assist in tracking that as well, and a collection of Counts become a CountsSet (for serialization purposes). The initial database scan is also a consistency check of the global entries. This shouldn't strictly be necessary. Nonetheless I added a created timestamp to the metadata and set a variable to compare against that. When the time since the metadata creation is old enough, we drop the metadata and rebuild from scratch like we used to, while also consistency checking. A new environment variable STCHECKDBEVERY can override this interval, and for example be set to zero to force the check immediately. GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4547 LGTM: imsodin |
||
---|---|---|
.. | ||
testdata | ||
.gitignore | ||
benchmark_test.go | ||
blockmap_test.go | ||
blockmap.go | ||
concurrency_test.go | ||
debug.go | ||
leveldb_dbinstance.go | ||
leveldb_test.go | ||
leveldb_transactions.go | ||
leveldb.go | ||
meta.go | ||
namespaced_test.go | ||
namespaced.go | ||
set_test.go | ||
set.go | ||
structs.go | ||
structs.pb.go | ||
structs.proto |