فهرست منبع

fix(exclusive): fix xref error && change exclusive default value

firest 3 سال پیش
والد
کامیت
b1b1d40528
3فایلهای تغییر یافته به همراه4 افزوده شده و 4 حذف شده
  1. 2 2
      apps/emqx/src/emqx_exclusive_subscription.erl
  2. 1 1
      apps/emqx/src/emqx_mqtt_caps.erl
  3. 1 1
      apps/emqx/src/emqx_schema.erl

+ 2 - 2
apps/emqx/src/emqx_exclusive_subscription.erl

@@ -70,7 +70,7 @@ check_subscribe(#{clientid := ClientId}, Topic) ->
     Fun = fun() ->
     Fun = fun() ->
         try_subscribe(ClientId, Topic)
         try_subscribe(ClientId, Topic)
     end,
     end,
-    case mnesia:transaction(Fun) of
+    case mria:transaction(?EXCLUSIVE_SHARD, Fun) of
         {atomic, Res} ->
         {atomic, Res} ->
             Res;
             Res;
         {aborted, Reason} ->
         {aborted, Reason} ->
@@ -81,7 +81,7 @@ check_subscribe(#{clientid := ClientId}, Topic) ->
     end.
     end.
 
 
 unsubscribe(Topic, #{is_exclusive := true}) ->
 unsubscribe(Topic, #{is_exclusive := true}) ->
-    _ = mnesia:transaction(fun() -> mnesia:delete({?TAB, Topic}) end),
+    _ = mria:transaction(?EXCLUSIVE_SHARD, fun() -> mnesia:delete({?TAB, Topic}) end),
     ok;
     ok;
 unsubscribe(_Topic, _SubOpts) ->
 unsubscribe(_Topic, _SubOpts) ->
     ok.
     ok.

+ 1 - 1
apps/emqx/src/emqx_mqtt_caps.erl

@@ -68,7 +68,7 @@
     wildcard_subscription => true,
     wildcard_subscription => true,
     subscription_identifiers => true,
     subscription_identifiers => true,
     shared_subscription => true,
     shared_subscription => true,
-    exclusive_subscription => true
+    exclusive_subscription => false
 }).
 }).
 
 
 -spec check_pub(
 -spec check_pub(

+ 1 - 1
apps/emqx/src/emqx_schema.erl

@@ -443,7 +443,7 @@ fields("mqtt") ->
             sc(
             sc(
                 boolean(),
                 boolean(),
                 #{
                 #{
-                    default => true,
+                    default => false,
                     desc => ?DESC(mqtt_exclusive_subscription)
                     desc => ?DESC(mqtt_exclusive_subscription)
                 }
                 }
             )},
             )},