From 3880ad954c47e8f05224f768159822b453a35e1f Mon Sep 17 00:00:00 2001 From: Adam Kocoloski Date: Wed, 20 Oct 2010 13:45:31 +0000 Subject: checkpoints reuse session_id. Patch by tilgovi. COUCHDB-704 git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1025573 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_rep.erl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/couchdb/couch_rep.erl') diff --git a/src/couchdb/couch_rep.erl b/src/couchdb/couch_rep.erl index a507f81e..ea9a3301 100644 --- a/src/couchdb/couch_rep.erl +++ b/src/couchdb/couch_rep.erl @@ -40,6 +40,7 @@ start_seq, history, + session_id, source_log, target_log, rep_starttime, @@ -206,6 +207,7 @@ do_init([RepId, {PostProps} = RepDoc, UserCtx] = InitArgs) -> start_seq = StartSeq, history = History, + session_id = couch_uuids:random(), source_log = SourceLog, target_log = TargetLog, rep_starttime = httpd_util:rfc1123_date(), @@ -651,6 +653,7 @@ do_checkpoint(State) -> committed_seq = NewSeqNum, start_seq = StartSeqNum, history = OldHistory, + session_id = SessionId, source_log = SourceLog, target_log = TargetLog, rep_starttime = ReplicationStartTime, @@ -662,7 +665,6 @@ do_checkpoint(State) -> {SrcInstanceStartTime, TgtInstanceStartTime} -> ?LOG_INFO("recording a checkpoint for ~s -> ~s at source update_seq ~p", [dbname(Source), dbname(Target), NewSeqNum]), - SessionId = couch_uuids:random(), NewHistoryEntry = {[ {<<"session_id">>, SessionId}, {<<"start_time">>, list_to_binary(ReplicationStartTime)}, -- cgit v1.2.3