You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by va...@apache.org on 2019/01/08 20:26:51 UTC

[couchdb] branch fix-replication-end-time created (now 429864b)

This is an automated email from the ASF dual-hosted git repository.

vatamane pushed a change to branch fix-replication-end-time
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


      at 429864b  Fix end_time field in /_replicate response

This branch includes the following new commits:

     new 429864b  Fix end_time field in /_replicate response

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[couchdb] 01/01: Fix end_time field in /_replicate response

Posted by va...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

vatamane pushed a commit to branch fix-replication-end-time
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 429864b84c1582f216eefcdee3a773f8f212b952
Author: Nick Vatamaniuc <va...@apache.org>
AuthorDate: Tue Jan 8 15:17:06 2019 -0500

    Fix end_time field in /_replicate response
    
    Previously `end_time` was generated converting the start_time to universal,
    then passing that to `httpd_util:rfc1123_date/1`. However, `rfc1123_date/1`
    also transates its argument from local to UTC time, that is it accepts input to
    be in local time format.
    
    Fixes #1841
---
 src/couch_replicator/src/couch_replicator_scheduler_job.erl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/couch_replicator/src/couch_replicator_scheduler_job.erl b/src/couch_replicator/src/couch_replicator_scheduler_job.erl
index f669d46..412ff7d 100644
--- a/src/couch_replicator/src/couch_replicator_scheduler_job.erl
+++ b/src/couch_replicator/src/couch_replicator_scheduler_job.erl
@@ -735,8 +735,8 @@ do_checkpoint(State) ->
     {SrcInstanceStartTime, TgtInstanceStartTime} ->
         couch_log:notice("recording a checkpoint for `~s` -> `~s` at source update_seq ~p",
             [SourceName, TargetName, NewSeq]),
-        UniversalStartTime = calendar:now_to_universal_time(ReplicationStartTime),
-        StartTime = ?l2b(httpd_util:rfc1123_date(UniversalStartTime)),
+        LocalStartTime = calendar:now_to_local_time(ReplicationStartTime),
+        StartTime = ?l2b(httpd_util:rfc1123_date(LocalStartTime)),
         EndTime = ?l2b(httpd_util:rfc1123_date()),
         NewHistoryEntry = {[
             {<<"session_id">>, SessionId},