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 2024/04/17 06:03:28 UTC

(couchdb) branch main updated (ceb227720 -> 947f46842)

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

vatamane pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/couchdb.git


    from ceb227720 Couch Scanner
     new 1fa4f6ee8 Cleanup shards db after the mem3 bdu test
     new 947f46842 Ignore design docs in shards db in couch scanner

The 2 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.


Summary of changes:
 src/couch_scanner/src/couch_scanner_plugin.erl | 3 +++
 src/mem3/test/eunit/mem3_bdu_test.erl          | 4 ++++
 2 files changed, 7 insertions(+)


(couchdb) 02/02: Ignore design docs in shards db in couch scanner

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

vatamane pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 947f468421d9a2f33b0c855b50677b5ca6b28289
Author: Nick Vatamaniuc <va...@gmail.com>
AuthorDate: Wed Apr 17 01:01:29 2024 -0400

    Ignore design docs in shards db in couch scanner
    
    Sometimes eunit tests leave design docs behind and the scanner would crash with
    a case clause error. Test cleanup was fixed in another commit, however it's
    possible for users to have their own design documents, so we should handle that
    case anyway.
---
 src/couch_scanner/src/couch_scanner_plugin.erl | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/couch_scanner/src/couch_scanner_plugin.erl b/src/couch_scanner/src/couch_scanner_plugin.erl
index e2791d357..34141a241 100644
--- a/src/couch_scanner/src/couch_scanner_plugin.erl
+++ b/src/couch_scanner/src/couch_scanner_plugin.erl
@@ -595,6 +595,9 @@ is_exported(Mod, F, A) ->
 
 % Shard selection
 
+shards(<<?DESIGN_DOC_PREFIX, _/binary>>, {Props}) when is_list(Props) ->
+    % In case the shard map has a design document in it
+    [];
 shards(DbName, {Props = [_ | _]}) ->
     Shards = lists:sort(mem3_util:build_shards(DbName, Props)),
     Fun = fun({R, SList}) ->


(couchdb) 01/02: Cleanup shards db after the mem3 bdu test

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

vatamane pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 1fa4f6ee873bbedf93b8af78951fd788b2797a74
Author: Nick Vatamaniuc <va...@gmail.com>
AuthorDate: Wed Apr 17 00:50:31 2024 -0400

    Cleanup shards db after the mem3 bdu test
    
    We added and deleted the _design doc but it was still sometimes affecting
    subsequent unit tests.
---
 src/mem3/test/eunit/mem3_bdu_test.erl | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/mem3/test/eunit/mem3_bdu_test.erl b/src/mem3/test/eunit/mem3_bdu_test.erl
index a0ed0004a..8ee08e1ce 100644
--- a/src/mem3/test/eunit/mem3_bdu_test.erl
+++ b/src/mem3/test/eunit/mem3_bdu_test.erl
@@ -38,6 +38,10 @@ start_couch() ->
     test_util:start_couch([mem3, chttpd]).
 
 stop_couch(Ctx) ->
+    % Clear the shards db since we added a design doc
+    % to it and we don't want it to affect other tests
+    ShardsDb = ?l2b(config:get("mem3", "shards_db", "_dbs")),
+    ok = couch_server:delete(ShardsDb, [?ADMIN_CTX]),
     test_util:stop_couch(Ctx).
 
 mem3_bdu_shard_doc_test_() ->