Github user brkolla commented on a diff in the pull request:

    https://github.com/apache/couchdb-fabric/pull/70#discussion_r80054599
  
    --- Diff: src/fabric_view.erl ---
    @@ -308,6 +308,23 @@ get_shards(DbName, #mrargs{stale=Stale})
     get_shards(DbName, #mrargs{stale=false}) ->
         mem3:shards(DbName).
     
    +maybe_update_others(DbName, DDoc, ShardsInvolved, ViewName,
    +                    #mrargs{stale=update_after} = Args) ->
    +    ShardsNeedUpdated = mem3:shards(DbName) -- ShardsInvolved,
    +    lists:foreach(fun(#shard{node=Node, name=ShardName}) ->
    +        rpc:cast(Node, fabric_view, maybe_update, [ShardName, DDoc, 
ViewName, Args])
    +    end, ShardsNeedUpdated).
    +
    +maybe_update(DbName, {DDocId, Rev}, ViewName, Args0) ->
    +    {ok, Db} = couch_db:open_int(DbName, []),
    +    DbUpdateSeq = couch_util:with_db(Db, fun(WDb) ->
    +        couch_db:get_update_seq(WDb)
    +    end),
    +    {ok, DDoc} = ddoc_cache:open_doc(mem3:dbname(DbName), DDocId, Rev),
    +    {ok, Pid, _} = couch_mrview_util:get_view_index_pid(Db, DDoc, 
ViewName, Args0),
    +    spawn(fun() -> catch couch_index:get_state(Pid, DbUpdateSeq) end),
    --- End diff --
    
    Good point. Started with the idea of using call, but later changed to cast 
as we want to trigger an update and not really care about the result. Will take 
out the spawn and change that code to `couch_index:get_state(Pid, DbUpdateSeq)`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to