Repository navigation
all: Transactionalize db.FileSet (fixes #5952) - #6239
Merged
Merged
Conversation
golangcibot
reviewed
Dec 27, 2019
| if f, ok := s.Get(protocol.LocalDeviceID, file); !ok { | ||
| snap := s.Snapshot() | ||
| defer snap.Release() | ||
| if f, ok := snap.Get(protocol.LocalDeviceID, file); !ok { |
There was a problem hiding this comment.
ifElseChain: rewrite if-else to switch statement (from gocritic)
golangcibot
reviewed
Jan 3, 2020
Member
|
This sounds like a good change and I’m not ignoring it; I’ve been traveling with limited internet but I’m back in business for real on Monday. |
calmh
previously approved these changes
Jan 21, 2020
* master: lib/model: Handle progress emitter zero interval (fixes syncthing#6281) (syncthing#6282) build(deps): bump github.com/pkg/errors from 0.9.0 to 0.9.1 (syncthing#6279) cmd/syncthing: Always use monitor process (fixes syncthing#4774, fixes syncthing#5786) (syncthing#6278) lib/syncthing: Wait for actual termination on Stop() (syncthing#6277) lib/model: Remove legacy handling of symlinks (syncthing#6276) lib/model: Return paused summary instead of error on paused folders (syncthing#6272) lib/config: Add some info to the folder marker missing (ref syncthing#5207) (syncthing#6270)
calmh
approved these changes
Jan 21, 2020
calmh
added a commit
to calmh/syncthing
that referenced
this pull request
Jan 21, 2020
* master: all: Transactionalize db.FileSet (fixes syncthing#5952) (syncthing#6239)
calmh
added a commit
to calmh/syncthing
that referenced
this pull request
Jan 30, 2020
* master: (28 commits) gui, man, authors: Update docs, translations, and contributors lib/config, lib/model: Limit concurrent pulls (fixes syncthing#5914) (syncthing#6290) lib/db: Fixup last commit with better key name lib/db: Configurable block GC time (syncthing#6295) lib/db: Deduplicate block lists in database (fixes syncthing#5898) (syncthing#6283) lib/relays: Fix incorrect timeout, bring back logging (ref syncthing#6289) (syncthing#6291) gui, man, authors: Update docs, translations, and contributors all: Transactionalize db.FileSet (fixes syncthing#5952) (syncthing#6239) lib/model: Handle progress emitter zero interval (fixes syncthing#6281) (syncthing#6282) build(deps): bump github.com/pkg/errors from 0.9.0 to 0.9.1 (syncthing#6279) cmd/syncthing: Always use monitor process (fixes syncthing#4774, fixes syncthing#5786) (syncthing#6278) lib/syncthing: Wait for actual termination on Stop() (syncthing#6277) lib/model: Remove legacy handling of symlinks (syncthing#6276) lib/model: Return paused summary instead of error on paused folders (syncthing#6272) lib/config: Add some info to the folder marker missing (ref syncthing#5207) (syncthing#6270) assets, gui: Losslessly compress all JPG, PNG, and PDF images (syncthing#6265) cmd/strelaypoolsrv: Serve gzip compressed responses gui, man, authors: Update docs, translations, and contributors gui, man, authors: Update docs, translations, and contributors build: go mod tidy ...
calmh
added a commit
to calmh/syncthing
that referenced
this pull request
Jan 30, 2020
* master: (32 commits) gui, man, authors: Update docs, translations, and contributors lib/config, lib/model: Limit concurrent pulls (fixes syncthing#5914) (syncthing#6290) lib/db: Fixup last commit with better key name lib/db: Configurable block GC time (syncthing#6295) lib/db: Deduplicate block lists in database (fixes syncthing#5898) (syncthing#6283) lib/relays: Fix incorrect timeout, bring back logging (ref syncthing#6289) (syncthing#6291) gui, man, authors: Update docs, translations, and contributors all: Transactionalize db.FileSet (fixes syncthing#5952) (syncthing#6239) lib/model: Handle progress emitter zero interval (fixes syncthing#6281) (syncthing#6282) build(deps): bump github.com/pkg/errors from 0.9.0 to 0.9.1 (syncthing#6279) cmd/syncthing: Always use monitor process (fixes syncthing#4774, fixes syncthing#5786) (syncthing#6278) lib/syncthing: Wait for actual termination on Stop() (syncthing#6277) lib/model: Remove legacy handling of symlinks (syncthing#6276) lib/model: Return paused summary instead of error on paused folders (syncthing#6272) lib/config: Add some info to the folder marker missing (ref syncthing#5207) (syncthing#6270) assets, gui: Losslessly compress all JPG, PNG, and PDF images (syncthing#6265) cmd/strelaypoolsrv: Serve gzip compressed responses gui, man, authors: Update docs, translations, and contributors gui, man, authors: Update docs, translations, and contributors build: go mod tidy ...
imsodin
added a commit
to imsodin/syncthing
that referenced
this pull request
Feb 11, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When pulling we go once over all needed files in the db, and then at various later points do lookups in the db. In the meantime changes may happen (e.g. that's the only explanation I have for #5952). This PR moves db access through
db.FileSettodb.Snapshotwhich can be obtained fromdb.FileSet.The huge diff on lowlevel.go and transaction.go is just copying over the methods that created a transaction at the beginning to actually be methods on transactions themselves.
Maybe it would be worth keeping utility functions on
db.FileSetthat allow access without taking a snapshot. I would definitely make especially some testing code shorter, then again I think it has some merit being force to think about snapshots (potential concurrent db changes) when dealing with the db.