Merge pull request #13086 from qzhuyan/dev/william/quic-lb

feat: quic-lb support
This commit is contained in:
William Yang 2024-05-23 15:31:14 +02:00 committed by GitHub
commit bb3f858db2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 27 additions and 5 deletions

View File

@ -24,7 +24,8 @@ IsQuicSupp = fun() ->
end, end,
Bcrypt = {bcrypt, {git, "https://github.com/emqx/erlang-bcrypt.git", {tag, "0.6.0"}}}, Bcrypt = {bcrypt, {git, "https://github.com/emqx/erlang-bcrypt.git", {tag, "0.6.0"}}},
Quicer = {quicer, {git, "https://github.com/emqx/quic.git", {tag, "0.0.313"}}}. Quicer =
{quicer, {git, "https://github.com/emqx/quic.git", {tag, "0.0.500"}}}.
Dialyzer = fun(Config) -> Dialyzer = fun(Config) ->
{dialyzer, OldDialyzerConfig} = lists:keyfind(dialyzer, 1, Config), {dialyzer, OldDialyzerConfig} = lists:keyfind(dialyzer, 1, Config),

View File

@ -841,7 +841,7 @@ t_conn_change_client_addr(Config) ->
NewPort = select_port(), NewPort = select_port(),
{ok, OldAddr} = quicer:sockname(Conn), {ok, OldAddr} = quicer:sockname(Conn),
?assertEqual( ?assertEqual(
ok, quicer:setopt(Conn, param_conn_local_address, "127.0.0.1:" ++ integer_to_list(NewPort)) ok, quicer:setopt(Conn, local_address, "127.0.0.1:" ++ integer_to_list(NewPort))
), ),
{ok, NewAddr} = quicer:sockname(Conn), {ok, NewAddr} = quicer:sockname(Conn),
ct:pal("NewAddr: ~p, Old Addr: ~p", [NewAddr, OldAddr]), ct:pal("NewAddr: ~p, Old Addr: ~p", [NewAddr, OldAddr]),
@ -1681,7 +1681,7 @@ t_client_conn_bump_streams(Config) ->
]), ]),
{ok, _} = emqtt:quic_connect(C), {ok, _} = emqtt:quic_connect(C),
{quic, Conn, _Stream} = proplists:get_value(socket, emqtt:info(C)), {quic, Conn, _Stream} = proplists:get_value(socket, emqtt:info(C)),
ok = quicer:setopt(Conn, param_conn_settings, #{peer_unidi_stream_count => 20}). ok = quicer:setopt(Conn, settings, #{peer_unidi_stream_count => 20}).
t_olp_true(Config) -> t_olp_true(Config) ->
meck:new(emqx_olp, [passthrough, no_history]), meck:new(emqx_olp, [passthrough, no_history]),

View File

@ -218,6 +218,16 @@ fields("cluster") ->
desc => ?DESC(cluster_proto_dist) desc => ?DESC(cluster_proto_dist)
} }
)}, )},
{"quic_lb_mode",
sc(
integer(),
#{
mapping => "quicer.lb_mode",
default => 0,
'readOnly' => true,
desc => ?DESC(cluster_quic_lb_mode)
}
)},
{"static", {"static",
sc( sc(
?R_REF(cluster_static), ?R_REF(cluster_static),

View File

@ -815,7 +815,9 @@ defmodule EMQXUmbrella.MixProject do
defp quicer_dep() do defp quicer_dep() do
if enable_quicer?(), if enable_quicer?(),
# in conflict with emqx and emqtt # in conflict with emqx and emqtt
do: [{:quicer, github: "emqx/quic", tag: "0.0.313", override: true}], do: [
{:quicer, github: "emqx/quic", tag: "0.0.500", override: true}
],
else: [] else: []
end end

View File

@ -36,7 +36,7 @@ assert_otp() ->
end. end.
quicer() -> quicer() ->
{quicer, {git, "https://github.com/emqx/quic.git", {tag, "0.0.313"}}}. {quicer, {git, "https://github.com/emqx/quic.git", {tag, "0.0.500"}}}.
jq() -> jq() ->
{jq, {git, "https://github.com/emqx/jq", {tag, "v0.3.12"}}}. {jq, {git, "https://github.com/emqx/jq", {tag, "v0.3.12"}}}.

View File

@ -68,6 +68,15 @@ cluster_proto_dist.desc:
cluster_proto_dist.label: cluster_proto_dist.label:
"""Cluster Protocol Distribution""" """Cluster Protocol Distribution"""
cluster_quic_lb_mode.desc:
"""QUIC stack LB Mode
- 0: disabled (Default)
- 1: server_ip
- 2: server_id_fixed"""
cluster_quic_lb_mode.label:
""" QUIC stack LB Mode """
log_burst_limit_enable.desc: log_burst_limit_enable.desc:
"""Enable log burst control feature.""" """Enable log burst control feature."""