rnewson commented on code in PR #5709:
URL: https://github.com/apache/couchdb/pull/5709#discussion_r2454596193


##########
src/couch_mrview/src/couch_mrview_cleanup.erl:
##########
@@ -14,29 +14,37 @@
 
 -export([
     run/1,
-    cleanup_purges/3,
-    cleanup_indices/2
+    cleanup/2
 ]).
 
--include_lib("couch/include/couch_db.hrl").
-
 run(Db) ->
     Indices = couch_mrview_util:get_index_files(Db),
     Checkpoints = couch_mrview_util:get_purge_checkpoints(Db),
     {ok, Db1} = couch_db:reopen(Db),
     Sigs = couch_mrview_util:get_signatures(Db1),
-    ok = cleanup_purges(Db1, Sigs, Checkpoints),
+    ok = cleanup_purges(Db, Sigs, Checkpoints),

Review Comment:
   seem odd not to use Db1 after the reopen. explain?



##########
src/dreyfus/src/clouseau_rpc.erl:
##########
@@ -262,10 +262,11 @@ rename(DbName) ->
 %% and an analyzer represented in a Javascript function in a design document.
 %% `Sig` is used to check if an index description is changed,
 %% and the index needs to be reconstructed.
--spec cleanup(DbName :: string_as_binary(_), ActiveSigs :: [sig()]) ->
+-spec cleanup(DbName :: string_as_binary(_), SigMap :: #{sig() => true}) ->
     ok.
 
-cleanup(DbName, ActiveSigs) ->
+cleanup(DbName, #{} = SigMap) ->

Review Comment:
   a _search_cleanup during a cluster upgrade will crash then? I think that's 
fine as they are rare but might be worth noting somewhere.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to