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 05:16:13 UTC

(couchdb) branch account-for-possible-design-docs-in-shardmap created (now 6dff638ad)

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

vatamane pushed a change to branch account-for-possible-design-docs-in-shardmap
in repository https://gitbox.apache.org/repos/asf/couchdb.git


      at 6dff638ad Ignore design docs in shards db in couch scanner

This branch includes the following new commits:

     new 581f419ec Cleanup shards db after the mem3 bdu test
     new 6dff638ad 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.



(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 account-for-possible-design-docs-in-shardmap
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 6dff638adfa4331ba861d852a05e8765673d6a38
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 account-for-possible-design-docs-in-shardmap
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 581f419ecd4a208b987b5605c5e9f95741ea294e
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_() ->