Merge pull request #11163 from thalesmg/fix-rm-mongo-topology-pool-size
fix(mongodb): hide `topology.pool_size` and fix it at 1
This commit is contained in:
commit
7cf1dd7e86
|
@ -97,7 +97,14 @@ fields(sharded) ->
|
||||||
] ++ mongo_fields();
|
] ++ mongo_fields();
|
||||||
fields(topology) ->
|
fields(topology) ->
|
||||||
[
|
[
|
||||||
{pool_size, fun emqx_connector_schema_lib:pool_size/1},
|
{pool_size,
|
||||||
|
hoconsc:mk(
|
||||||
|
pos_integer(),
|
||||||
|
#{
|
||||||
|
deprecated => {since, "5.1.1"},
|
||||||
|
importance => ?IMPORTANCE_HIDDEN
|
||||||
|
}
|
||||||
|
)},
|
||||||
{max_overflow, fun max_overflow/1},
|
{max_overflow, fun max_overflow/1},
|
||||||
{overflow_ttl, duration("overflow_ttl")},
|
{overflow_ttl, duration("overflow_ttl")},
|
||||||
{overflow_check_period, duration("overflow_check_period")},
|
{overflow_check_period, duration("overflow_check_period")},
|
||||||
|
@ -174,7 +181,23 @@ on_start(
|
||||||
false ->
|
false ->
|
||||||
[{ssl, false}]
|
[{ssl, false}]
|
||||||
end,
|
end,
|
||||||
Topology = maps:get(topology, NConfig, #{}),
|
Topology0 = maps:get(topology, NConfig, #{}),
|
||||||
|
%% we fix this at 1 because we already have ecpool
|
||||||
|
case maps:get(pool_size, Topology0, 1) =:= 1 of
|
||||||
|
true ->
|
||||||
|
ok;
|
||||||
|
false ->
|
||||||
|
?SLOG(
|
||||||
|
info,
|
||||||
|
#{
|
||||||
|
msg => "mongodb_overriding_topology_pool_size",
|
||||||
|
connector => InstId,
|
||||||
|
reason => "this option is deprecated; please set `pool_size' for the connector",
|
||||||
|
value => 1
|
||||||
|
}
|
||||||
|
)
|
||||||
|
end,
|
||||||
|
Topology = Topology0#{pool_size => 1},
|
||||||
Opts = [
|
Opts = [
|
||||||
{mongo_type, init_type(NConfig)},
|
{mongo_type, init_type(NConfig)},
|
||||||
{hosts, Hosts},
|
{hosts, Hosts},
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Fixed `topology.pool_size = 1` and hid such option from users for MondoDB bridges to avoid confusion.
|
Loading…
Reference in New Issue