diff --git a/apps/leo_manager/include/leo_manager.hrl b/apps/leo_manager/include/leo_manager.hrl index a961f4d6..c5c78bcd 100644 --- a/apps/leo_manager/include/leo_manager.hrl +++ b/apps/leo_manager/include/leo_manager.hrl @@ -320,6 +320,7 @@ -define(ERROR_FAIL_TO_UPDATE_ACL, "Fail to update acl of a bucket"). -define(ERROR_FAIL_ACCESS_MNESIA, "Fail to access mnesia"). -define(ERROR_ALREADY_HAS_SAME_CLUSTER, "Already has a same neme of cluster"). +-define(ERROR_INCOMPATIBLE_VERSION, "Incompatible Version"). -define(ERROR_COULD_NOT_GET_CLUSTER_INFO,"Could not get cluster info"). -define(ERROR_OVER_MAX_CLUSTERS, "Over max number of clusters"). -define(ERROR_CLUSTER_NOT_FOUND, "Cluster not found"). diff --git a/apps/leo_manager/src/leo_manager_api.erl b/apps/leo_manager/src/leo_manager_api.erl index 32bf2ff4..d6a3c196 100644 --- a/apps/leo_manager/src/leo_manager_api.erl +++ b/apps/leo_manager/src/leo_manager_api.erl @@ -2408,6 +2408,9 @@ call_gateway_api(Method, Args) -> %% @doc Join a cluster (MDC-Replication) -spec(join_cluster([atom()], #?SYSTEM_CONF{}) -> {ok, #?SYSTEM_CONF{}} | {error, any()}). +%% @doc Convert System Conf from ~1.3.2 cluster +join_cluster(RemoteManagerNodes, #system_conf_2{} = SystemConf) -> + join_cluster(RemoteManagerNodes, leo_cluster_tbl_conf:transform(SystemConf)); join_cluster(RemoteManagerNodes, #?SYSTEM_CONF{cluster_id = ClusterId, dc_id = DCId, @@ -2439,7 +2442,11 @@ join_cluster(RemoteManagerNodes, {error, ?ERROR_ALREADY_HAS_SAME_CLUSTER}; Error -> Error - end. + end; +join_cluster(RemoteManagerNodes, _) -> + ?error("join_cluster/2", [{cause, ?ERROR_INCOMPATIBLE_VERSION}, + {nodes, RemoteManagerNodes}]), + {error, ?ERROR_INCOMPATIBLE_VERSION}. %% @doc Synchronize mdc-related tables