couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vatam...@apache.org
Subject [couchdb] branch master updated: Fix upgrade clause for mem3_rpc:load_checkpoint/4, 5
Date Thu, 11 Apr 2019 18:50:59 GMT
This is an automated email from the ASF dual-hosted git repository.

vatamane pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/couchdb.git


The following commit(s) were added to refs/heads/master by this push:
     new bb30e98  Fix upgrade clause for mem3_rpc:load_checkpoint/4,5
bb30e98 is described below

commit bb30e984c653640b5ef9b80d3e5a2801bad14efe
Author: Nick Vatamaniuc <vatamane@apache.org>
AuthorDate: Thu Apr 11 12:10:40 2019 -0400

    Fix upgrade clause for mem3_rpc:load_checkpoint/4,5
    
    When upgrading, the new mem3_rpc:load_checkpoint with a filter hash arg won't
    be available on older nodes.
    
    Filter hashes are not currently used anyway, so to avoid crashes on mixed
    cluster call the older version without the filter hash part when the filter has
    the default <<>> value.
---
 src/mem3/src/mem3_rpc.erl | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/mem3/src/mem3_rpc.erl b/src/mem3/src/mem3_rpc.erl
index 59dbbe8..0991aa7 100644
--- a/src/mem3/src/mem3_rpc.erl
+++ b/src/mem3/src/mem3_rpc.erl
@@ -68,7 +68,11 @@ get_missing_revs(Node, DbName, IdsRevs, Options) ->
 update_docs(Node, DbName, Docs, Options) ->
     rexi_call(Node, {fabric_rpc, update_docs, [DbName, Docs, Options]}).
 
-
+load_checkpoint(Node, DbName, SourceNode, SourceUUID, <<>>) ->
+    % Upgrade clause for a mixed cluster for old nodes that don't have
+    % load_checkpoint_rpc/4 yet. FilterHash is currently not
+    % used and so defaults to <<>> everywhere
+    load_checkpoint(Node, DbName, SourceNode, SourceUUID);
 load_checkpoint(Node, DbName, SourceNode, SourceUUID, FilterHash) ->
     Args = [DbName, SourceNode, SourceUUID, FilterHash],
     rexi_call(Node, {mem3_rpc, load_checkpoint_rpc, Args}).


Mime
View raw message