nickva commented on a change in pull request #3711:
URL: https://github.com/apache/couchdb/pull/3711#discussion_r696904428



##########
File path: src/fabric/src/fabric_view_changes.erl
##########
@@ -495,6 +497,59 @@ get_old_seq(#shard{range=R}=Shard, SinceSeqs) ->
     end.
 
 
+get_db_uuids(DbName) ->
+    % Need to use an isolated process as we are performing a fabric call from
+    % another fabric call and there is a good chance we'd polute the mailbox
+    % with returned messages
+    Timeout = fabric_util:request_timeout(),
+    IsolatedFun = fun() -> fabric:db_uuids(DbName) end,
+    try fabric_util:isolate(IsolatedFun, Timeout) of
+        {ok, Uuids} ->
+            % Trim uuids so we match exactly based on the currently configured
+            % uuid_prefix_len. The assumption is that we are getting an older
+            % sequence from the same cluster and we didn't tweak that
+            % relatively obscure config option in the meantime.
+            PrefixLen = config:get_integer("fabric", "uuid_prefix_len", 7),

Review comment:
       We are reusing the same config defaults from the fabric_rpc. Perhaps it 
might be better to move them to fabric_util so to they both can call 
fabric_util:get_uuid_prefix().
   
   The reason to re-use the config is because we can then do exact matching in 
the map. We could do a prefix match, with a filter loop, but I figured since 
this config value is almost never changed just rely assuming it didn't change 
since previous changes sequence was generated until after the shard moved




-- 
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