couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject couch-replicator commit: updated refs/heads/master to 9ee3e19
Date Thu, 31 Mar 2016 19:09:02 GMT
Repository: couchdb-couch-replicator
Updated Branches:
  refs/heads/master fb004ea6f -> 9ee3e19b9


Reduce checkpoint frequency from 5 to 30 seconds

Use a macro to avoid hard-coding magic number
in two places.

COUCHDB-2979


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/commit/9ee3e19b
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/tree/9ee3e19b
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/diff/9ee3e19b

Branch: refs/heads/master
Commit: 9ee3e19b997258a7d57b993afec34bcbbf4772c5
Parents: fb004ea
Author: Nick Vatamaniuc <vatamane@gmail.com>
Authored: Thu Mar 31 11:50:53 2016 -0400
Committer: Nick Vatamaniuc <vatamane@gmail.com>
Committed: Thu Mar 31 14:48:37 2016 -0400

----------------------------------------------------------------------
 src/couch_replicator.erl       | 6 ++++--
 src/couch_replicator_utils.erl | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/blob/9ee3e19b/src/couch_replicator.erl
----------------------------------------------------------------------
diff --git a/src/couch_replicator.erl b/src/couch_replicator.erl
index b838d17..4e25e14 100644
--- a/src/couch_replicator.erl
+++ b/src/couch_replicator.erl
@@ -34,6 +34,8 @@
 
 -define(LOWEST_SEQ, 0).
 
+-define(DEFAULT_CHECKPOINT_INTERVAL, 30000).
+
 -import(couch_util, [
     get_value/2,
     get_value/3,
@@ -76,7 +78,7 @@
     target_monitor = nil,
     source_seq = nil,
     use_checkpoints = true,
-    checkpoint_interval = 5000,
+    checkpoint_interval = ?DEFAULT_CHECKPOINT_INTERVAL,
     type = db,
     view = nil
 }).
@@ -683,7 +685,7 @@ init_state(Rep) ->
         source_seq = SourceSeq,
         use_checkpoints = get_value(use_checkpoints, Options, true),
         checkpoint_interval = get_value(checkpoint_interval, Options,
-                                        5000),
+                                        ?DEFAULT_CHECKPOINT_INTERVAL),
         type = Type,
         view = View
     },

http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/blob/9ee3e19b/src/couch_replicator_utils.erl
----------------------------------------------------------------------
diff --git a/src/couch_replicator_utils.erl b/src/couch_replicator_utils.erl
index c10a4e5..dde30f6 100644
--- a/src/couch_replicator_utils.erl
+++ b/src/couch_replicator_utils.erl
@@ -255,7 +255,7 @@ make_options(Props) ->
     DefTimeout = config:get("replicator", "connection_timeout", "30000"),
     DefRetries = config:get("replicator", "retries_per_request", "10"),
     UseCheckpoints = config:get("replicator", "use_checkpoints", "true"),
-    DefCheckpointInterval = config:get("replicator", "checkpoint_interval", "5000"),
+    DefCheckpointInterval = config:get("replicator", "checkpoint_interval", "30000"),
     {ok, DefSocketOptions} = couch_util:parse_term(
         config:get("replicator", "socket_options",
             "[{keepalive, true}, {nodelay, false}]")),


Mime
View raw message