You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ji...@apache.org on 2018/10/25 09:18:40 UTC

[couchdb] branch COUCHDB-3326-get_minimum_purge_seq created (now 7cc94b1)

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

jiangphcn pushed a change to branch COUCHDB-3326-get_minimum_purge_seq
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


      at 7cc94b1  Fix get_minimum_purge_seq/1

This branch includes the following new commits:

     new 7cc94b1  Fix get_minimum_purge_seq/1

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 get_minimum_purge_seq/1

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

jiangphcn pushed a commit to branch COUCHDB-3326-get_minimum_purge_seq
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 7cc94b16ba06873947ff6f18a688e2774c5c24e4
Author: jiangph <ji...@cn.ibm.com>
AuthorDate: Thu Oct 25 17:17:54 2018 +0800

    Fix get_minimum_purge_seq/1
    
    COUCHDB_3326
---
 src/couch/src/couch_db.erl | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/couch/src/couch_db.erl b/src/couch/src/couch_db.erl
index 57e3951..ecac782 100644
--- a/src/couch/src/couch_db.erl
+++ b/src/couch/src/couch_db.erl
@@ -425,11 +425,12 @@ get_minimum_purge_seq(#db{} = Db) ->
         case DocId of
             <<?LOCAL_DOC_PREFIX, "purge-", _/binary>> ->
                 ClientSeq = couch_util:get_value(<<"purge_seq">>, Props),
+                DbName = couch_db:name(Db),
                 case ClientSeq of
                     CS when is_integer(CS), CS >= PurgeSeq - PurgeInfosLimit ->
                         {ok, SeqAcc};
                     CS when is_integer(CS) ->
-                        case purge_client_exists(Db, DocId, Props) of
+                        case purge_client_exists(DbName, DocId, Props) of
                             true -> {ok, erlang:min(CS, SeqAcc)};
                             false -> {ok, SeqAcc}
                         end;
@@ -438,7 +439,7 @@ get_minimum_purge_seq(#db{} = Db) ->
                         % purge info until the doc is fixed or removed.
                         Fmt = "Invalid purge doc '~s' on database ~p
                             with purge_seq '~w'",
-                        DbName = couch_db:name(Db),
+
                         couch_log:error(Fmt, [DocId, DbName, ClientSeq]),
                         {ok, erlang:min(OldestPurgeSeq, SeqAcc)}
                 end;
@@ -491,7 +492,7 @@ purge_client_exists(DbName, DocId, Props) ->
         % it exists.
         Fmt2 = "Failed to check purge checkpoint using
             document '~p' in database ~p",
-        couch_log:error(Fmt2, [DbName, DocId]),
+        couch_log:error(Fmt2, [DocId, DbName]),
         true
     end.
 
@@ -605,9 +606,8 @@ get_db_info(Db) ->
     ],
     {ok, InfoList}.
 
-get_design_docs(#db{name = <<"shards/", _:18/binary, DbFullName/binary>>}) ->
-    DbName = ?l2b(filename:rootname(filename:basename(?b2l(DbFullName)))),
-    {_, Ref} = spawn_monitor(fun() -> exit(fabric:design_docs(DbName)) end),
+get_design_docs(#db{name = <<"shards/", _:18/binary, DbFullName/binary>> = DbName}) ->
+    {_, Ref} = spawn_monitor(fun() -> exit(fabric:design_docs(mem3:dbname(DbName))) end),
     receive {'DOWN', Ref, _, _, Response} ->
         Response
     end;