syncthing/lib/db
Jakob Borg d7d45d8092 lib/db: Refactor away the large genericReplace thing
This removes a significant, complex chunk of database code. The
"replace" operation walked both the old and new in lockstep and made the
relevant changes to make the new situation correct. But since delta
indexes we pretty much never need this - we just used replace to drop
the existing data and start over.

This makes that explicit and removes the complexity.

(This is one of those things that would be annoying to make case
insensitive, while the actual "drop and then insert" that we do is
easier.)

This is fairly well unit tested...

The one change to the tests is to cover the fact that previously replace
with something identical didn't bump the sequence number, while
obviously removing everything and re-inserting does. This is not
behavior we depend on anywhere.

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4500
LGTM: imsodin, AudriusButkevicius
2017-11-12 20:20:34 +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 all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
blockmap_test.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
blockmap.go lib/db, lib/model: Always use reasonable sized batches (fixes #2250, fixes #4112) 2017-04-22 14:23:33 +00:00
concurrency_test.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
debug.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
leveldb_dbinstance.go lib/db: Refactor away the large genericReplace thing 2017-11-12 20:20:34 +00:00
leveldb_test.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
leveldb_transactions.go all: Add invalid/ignored files to global list, announce to peers (fixes #623) 2017-11-11 19:18:17 +00:00
leveldb.go lib/db: Don't panic 2017-04-25 22:52:37 +00: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 all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
set_test.go lib/db: Refactor away the large genericReplace thing 2017-11-12 20:20:34 +00:00
set.go lib/db: Refactor away the large genericReplace thing 2017-11-12 20:20:34 +00:00
structs.go all: Add invalid/ignored files to global list, announce to peers (fixes #623) 2017-11-11 19:18:17 +00:00
structs.pb.go all: Add invalid/ignored files to global list, announce to peers (fixes #623) 2017-11-11 19:18:17 +00:00
structs.proto all: Add invalid/ignored files to global list, announce to peers (fixes #623) 2017-11-11 19:18:17 +00:00