From 762e1178afb249b46a3a7a818b44f8be1c4170bd Mon Sep 17 00:00:00 2001 From: Adam Kocoloski Date: Wed, 20 Oct 2010 13:46:57 +0000 Subject: checkpoints reuse session_id. Patch by tilgovi. COUCHDB-704 git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.0.x@1025574 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_rep.erl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/couchdb/couch_rep.erl b/src/couchdb/couch_rep.erl index baf9c87e..28054f34 100644 --- a/src/couchdb/couch_rep.erl +++ b/src/couchdb/couch_rep.erl @@ -34,6 +34,7 @@ start_seq, history, + session_id, source_log, target_log, rep_starttime, @@ -189,6 +190,7 @@ do_init([RepId, {PostProps}, UserCtx] = InitArgs) -> start_seq = StartSeq, history = History, + session_id = couch_uuids:random(), source_log = SourceLog, target_log = TargetLog, rep_starttime = httpd_util:rfc1123_date(), @@ -567,6 +569,7 @@ do_checkpoint(State) -> committed_seq = NewSeqNum, start_seq = StartSeqNum, history = OldHistory, + session_id = SessionId, source_log = SourceLog, target_log = TargetLog, rep_starttime = ReplicationStartTime, @@ -578,7 +581,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