Procházet zdrojové kódy

chore: replace with dirty operation

JianBo He před 1 rokem
rodič
revize
e23be5ea98
1 změnil soubory, kde provedl 4 přidání a 2 odebrání
  1. 4 2
      apps/emqx_conf/src/emqx_cluster_rpc.erl

+ 4 - 2
apps/emqx_conf/src/emqx_cluster_rpc.erl

@@ -488,8 +488,10 @@ get_cluster_tnx_id() ->
     end.
     end.
 
 
 get_current_tnx_id() ->
 get_current_tnx_id() ->
-    {atomic, TxId} = transaction(fun ?MODULE:get_node_tnx_id/1, [node()]),
-    TxId.
+    case mnesia:dirty_read(?CLUSTER_COMMIT, node()) of
+        [] -> ?DEFAULT_INIT_TXN_ID;
+        [#cluster_rpc_commit{tnx_id = TnxId}] -> TnxId
+    end.
 
 
 get_oldest_mfa_id() ->
 get_oldest_mfa_id() ->
     case mnesia:first(?CLUSTER_MFA) of
     case mnesia:first(?CLUSTER_MFA) of