syncthing/lib/db
Jakob Borg 1e69997ecd
lib/db: Fix iterating sequence index (fixes #5340) (#5462)
There was a problem in iterating the sequence index that could result
in missing updates. The issue is that while the index was (correctly)
iterated in a snapshot, the actual file infos were read dirty outside of
the snapshot. This fixes this by doing the reads inside the snapshot,
and also updates a couple of other places that did the same thing more
or less harmfully (I didn't investigate).

To avoid similar issues in the future I did some renaming of the
getFile* methods - the ones in a transaction are just getFile, while the
ones directly on the database are variants of getFileDirty to highlight
what's going on.
2019-01-18 11:34:18 +01:00
..
testdata lib/db: Add index to track locally needed files (#4958) 2018-06-02 15:08:32 +02:00
.gitignore Change DB label format (index folders, devices) 2016-01-03 19:32:40 +01:00
benchmark_test.go all: Become a Go module (fixes #5148) (#5384) 2018-12-18 12:36:38 +01:00
blockmap_test.go lib/db: Refactor: use a Lowlevel type underneath Instance (ref #5198) (#5212) 2018-10-10 11:34:24 +02:00
blockmap.go lib/db: Fix sequence updating for remote invalid items (#5420) 2019-01-04 20:19:10 +01:00
concurrency_test.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
db_test.go lib/db: Fix iterating sequence index (fixes #5340) (#5462) 2019-01-18 11:34:18 +01:00
debug.go lib/db: Fix inconsistency in sequence index (fixes #5149) (#5158) 2018-09-02 20:58:32 +02:00
instance.go lib/db: Fix iterating sequence index (fixes #5340) (#5462) 2019-01-18 11:34:18 +01:00
keyer_test.go lib/db: Refactor: use a Lowlevel type underneath Instance (ref #5198) (#5212) 2018-10-10 11:34:24 +02:00
keyer.go lib/db: Document current keyspace 2018-12-10 09:55:21 +01:00
lowlevel.go cmd/stindex: Add index checking mode ("idxck") (#5262) 2018-10-11 20:48:39 +01:00
meta_test.go lib/db: Fix sequence updating for remote invalid items (#5420) 2019-01-04 20:19:10 +01:00
meta.go lib/db: Fix sequence updating for remote invalid items (#5420) 2019-01-04 20:19:10 +01:00
namespaced_test.go lib/db: Fix test for Go 1.9's smarter time.Time values 2017-06-28 14:36:04 +02:00
namespaced.go lib/db: Refactor: use a Lowlevel type underneath Instance (ref #5198) (#5212) 2018-10-10 11:34:24 +02:00
schemaupdater.go lib/db: Fix iterating sequence index (fixes #5340) (#5462) 2019-01-18 11:34:18 +01:00
set_test.go lib/db: Fix iterating sequence index (fixes #5340) (#5462) 2019-01-18 11:34:18 +01:00
set.go lib/db: Fix iterating sequence index (fixes #5340) (#5462) 2019-01-18 11:34:18 +01:00
smallindex_test.go lib/db: Refactor: use a Lowlevel type underneath Instance (ref #5198) (#5212) 2018-10-10 11:34:24 +02:00
smallindex.go lib/db: Refactor: use a Lowlevel type underneath Instance (ref #5198) (#5212) 2018-10-10 11:34:24 +02:00
structs.go lib/db: Fix iterating sequence index (fixes #5340) (#5462) 2019-01-18 11:34:18 +01:00
structs.pb.go all: Update protobuf package 1.0.0 -> 1.2.0 (#5452) 2019-01-14 11:53:36 +01:00
structs.proto all: Update protobuf package 1.0.0 -> 1.2.0 (#5452) 2019-01-14 11:53:36 +01:00
transactions.go lib/db: Fix iterating sequence index (fixes #5340) (#5462) 2019-01-18 11:34:18 +01:00
util_test.go lib/db: Add index to track locally needed files (#4958) 2018-06-02 15:08:32 +02:00