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 <[email protected]>
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}) ->

Reply via email to