Commit 3b34895a authored by Jakob Borg's avatar Jakob Borg

LocalVersion can move backwards as well as forwards

parent 91cc84c4
......@@ -58,9 +58,7 @@ func (s *Set) Replace(node protocol.NodeID, fs []protocol.FileInfo) {
}
s.mutex.Lock()
defer s.mutex.Unlock()
if lv := ldbReplace(s.db, []byte(s.repo), node[:], fs); lv > s.localVersion[node] {
s.localVersion[node] = lv
}
s.localVersion[node] = ldbReplace(s.db, []byte(s.repo), node[:], fs)
}
func (s *Set) ReplaceWithDelete(node protocol.NodeID, fs []protocol.FileInfo) {
......
......@@ -3,5 +3,5 @@
./test-http.sh || exit
./test-merge.sh || exit
./test-delupd.sh || exit
./test-folders.sh || exit
# ./test-folders.sh || exit
./test-reconnect.sh || exit
......@@ -83,3 +83,5 @@ setup
start
testConvergence 8082
stop
exit 0
......@@ -192,9 +192,15 @@ func (p *puller) run() {
lastscan = time.Now()
}
if v := p.model.LocalVersion(p.repoCfg.ID); v > prevVer {
if v := p.model.LocalVersion(p.repoCfg.ID); v != prevVer {
if debug {
l.Debugf("%q: checking for more needed blocks", p.repoCfg.ID)
}
// Queue more blocks to fetch, if any
if p.queueNeededBlocks() == 0 {
if debug {
l.Debugf("%q: no more needed blocks", p.repoCfg.ID)
}
// We've fetched all blocks we need
prevVer = v
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment