From 87f45e73df3e37fbb631bcb14871c621ee77489b Mon Sep 17 00:00:00 2001 From: "Damien F. Katz" Date: Fri, 9 Jan 2009 22:20:48 +0000 Subject: Added support so clients can detect if a server has potentially lost commits after multiple updates, like during bulk imports and so the replicator can detect lost commits on remote replications. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@733174 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_db_updater.erl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/couchdb/couch_db_updater.erl') diff --git a/src/couchdb/couch_db_updater.erl b/src/couchdb/couch_db_updater.erl index 94605a3c..cbeda223 100644 --- a/src/couchdb/couch_db_updater.erl +++ b/src/couchdb/couch_db_updater.erl @@ -279,6 +279,12 @@ init_db(DbName, Filepath, Fd, Header0) -> AdminsPtr -> {ok, Admins} = couch_file:pread_term(Fd, AdminsPtr) end, + + % convert start time tuple to microsecs and store as a binary string + {MegaSecs, Secs, MicroSecs} = now(), + StartTime = ?l2b(io_lib:format("~p", + [(MegaSecs*1000000*1000000) + (Secs*1000000) + MicroSecs])), + #db{ update_pid=self(), fd=Fd, @@ -291,7 +297,9 @@ init_db(DbName, Filepath, Fd, Header0) -> name = DbName, filepath = Filepath, admins = Admins, - admins_ptr = AdminsPtr}. + admins_ptr = AdminsPtr, + instance_start_time = StartTime + }. close_db(#db{fd=Fd,summary_stream=Ss}) -> -- cgit v1.2.3