Remove watcher's flushing of K/V DBs.
For now Sync does not flush its K/V DBs to disk. A future enhancement
will introduce flushes with a configured batching level. Also reduce
the initiator's sync and retry time intervals.
Change-Id: I0c08c7821213371a333c7646482ec4604402ea92
diff --git a/runtimes/google/vsync/initiator.go b/runtimes/google/vsync/initiator.go
index e0e84b7..af7ece9 100644
--- a/runtimes/google/vsync/initiator.go
+++ b/runtimes/google/vsync/initiator.go
@@ -44,7 +44,7 @@
// peerSyncInterval is the duration between two consecutive
// sync events. In every sync event, the initiator contacts
// one of its peers to obtain any pending updates.
- peerSyncInterval = 100 * time.Millisecond
+ peerSyncInterval = 50 * time.Millisecond
// peerSelectionPolicy is the policy used to select a peer when
// the initiator gets a chance to sync.
@@ -395,7 +395,7 @@
// solution. Next iteration will have coordination
// with watch thread to intelligently retry. Hence
// this value is not a config param.
- time.Sleep(10 * time.Second)
+ time.Sleep(1 * time.Second)
}
// Remove any pending state.
diff --git a/runtimes/google/vsync/watcher.go b/runtimes/google/vsync/watcher.go
index a0801a7..43b2238 100644
--- a/runtimes/google/vsync/watcher.go
+++ b/runtimes/google/vsync/watcher.go
@@ -183,18 +183,9 @@
}
}
- // Flush the DAG and Log DBs. If the resume marker changed, update the device table and flush it.
- // TODO(rdaoud): this should be conditional, e.g. don't flush if Initiator is in-progress.
- // TODO(rdaoud): flushes can also be batched across multiple change-batches.
- w.syncd.dag.flush()
- if err := w.syncd.log.flush(); err != nil {
- return fmt.Errorf("cannot flush log DB: %s", err)
- }
+ // If the resume marker changed, update the device table.
if lastResmark != nil {
w.syncd.devtab.head.Resmark = lastResmark
- if err := w.syncd.devtab.flush(); err != nil {
- return fmt.Errorf("cannot flush device table DB: %s", err)
- }
}
return nil