Commit Graph

5821 Commits

Author SHA1 Message Date
Shawn 50717a5567 fix: set the topic field of API /clients/:clientid/subscribe as requried 2023-01-09 17:57:39 +08:00
Shawn 7ed1384623 fix: missing default value for qos field of API /clients/:clientid/subscribe 2023-01-09 16:02:10 +08:00
JianBo He 6f5057b9dd
Merge pull request #9637 from HJianBo/fix-clients-api
fix(clients): fix expiry_interval unit error
2023-01-09 09:49:16 +08:00
Xinyu Liu 336b310d56
Merge pull request #9687 from emqx/function_clause_when_send_msg_to_bridges
fix: function_clause when sending messages to bridges
2023-01-09 09:23:17 +08:00
Zaiming (Stone) Shi 5653d113ac
Merge pull request #9663 from zmstone/0102-fix-stopped-nodes-detection
0102 fix stopped nodes detection
2023-01-08 10:03:48 +01:00
firest f7b50c56da feat(bridges): integrate PostgreSQL into bridges
support both simple and batch query
2023-01-06 11:47:22 +08:00
JianBo He 5d55e3a7b3 chore: updage mgmt app vsn 2023-01-06 10:31:27 +08:00
JianBo He 65729cd640 fix(clients): fix expiry_interval unit error
It should be second not millisecond
2023-01-06 10:31:27 +08:00
Shawn 13b2f45405 fix: function_clause when sending messages to bridges 2023-01-06 09:24:38 +08:00
Thales Macedo Garitezi 22707495ac
Merge pull request #9690 from thalesmg/fix-flaky-jwt-test
test(flaky): fix flaky jwt worker test
2023-01-05 14:00:39 -03:00
Thales Macedo Garitezi cf6996cbea test(flaky): fix flaky jwt worker test 2023-01-05 11:19:43 -03:00
Thales Macedo Garitezi 70eb5ffb58 refactor: remove unused function 2023-01-05 10:16:01 -03:00
Thales Macedo Garitezi 56437228dc docs: improve descriptions
Thanks to @qzhuyan for the corrections.
2023-01-05 10:16:01 -03:00
Thales Macedo Garitezi fd360ac6c0 feat(buffer_worker): refactor buffer/resource workers to always use queue
This makes the buffer/resource workers always use `replayq` for
queuing, along with collecting multiple requests in a single call.
This is done to avoid long message queues for the buffer workers and
rely on `replayq`'s capabilities of offloading to disk and detecting
overflow.

Also, this deprecates the `enable_batch` and `enable_queue` resource
creation options, as: i) queuing is now always enables; ii) batch_size
> 1 <=> batch_enabled.  The corresponding metric
`dropped.queue_not_enabled` is dropped, along with `batching`.  The
batching is too ephemeral, especially considering a default batch time
of 20 ms, and is not shown in the dashboard, so it was removed.
2023-01-05 10:15:09 -03:00
Thales Macedo Garitezi bf3983e7c4 feat(buffer_worker): use offload mode for `replayq`
To avoid confusion for the users as to what persistence guarantees we
offer when buffering bridges/resources, we will always enable offload
mode for `replayq`.  With this, when the buffer size is above the max
segment size, it'll flush the queue to disk, but on recovery after a
restart it'll clean the existing segments rather than resuming from
them.
2023-01-05 10:11:59 -03:00
Thales Macedo Garitezi fa4f90d43e
Merge pull request #9676 from thalesmg/fix-change-retainer-storage-type-v50
fix(retainer): change mnesia table storage types during update
2023-01-05 09:07:10 -03:00
ieQu1 93c205db7c fix(router_helper): Reduce log verbosity of expected events 2023-01-05 12:17:27 +01:00
Thales Macedo Garitezi 51ad27cb4b test(retainer): assert that retained messages are not lost when changing storage type 2023-01-04 13:52:52 -03:00
Thales Macedo Garitezi 2f13bfd452 fix(retainer): change mnesia table storage types during update
https://emqx.atlassian.net/browse/EMQX-8650
2023-01-04 13:52:52 -03:00
Thales Macedo Garitezi 86a4ac87a7
Merge pull request #9674 from thalesmg/reset-rule-metrics-on-disable-v50
chore(rule_engine): reset metrics when disabling a rule
2023-01-04 13:30:39 -03:00
Thales Macedo Garitezi 00b91d8a60
Merge pull request #9664 from thalesmg/fix-mongo-duration-field-descs-v50
docs(mongodb_connector): fix duration field descriptions
2023-01-04 10:03:38 -03:00
Thales Macedo Garitezi eb7dca3691 chore(rule_engine): reset metrics when disabling a rule
https://emqx.atlassian.net/browse/EMQX-8502

When a bridge is disabled, its metrics are reset.  With this change,
we make rule actions behave like that: disabling a rule will reset its
metrics.
2023-01-04 09:30:47 -03:00
Erik Timan f767db4d8f
Merge pull request #9660 from olcai/refactor-ingress-bridge-counter
refactor(emqx_resource): ingress bridge counter
2023-01-04 10:43:07 +01:00
Thales Macedo Garitezi c3cfbae3c2 docs: improve descriptions
Thanks to @qzhuyan for the corrections
2023-01-03 11:38:09 -03:00
firest b43be50a98 test: add the `redacted` test case for bridges api 2023-01-03 22:16:34 +08:00
firest b016695cb1 fix(bridges): obfuscate the password in bridges API responses 2023-01-03 22:09:29 +08:00
Thales Macedo Garitezi 7bbdc20993 docs(mongodb_connector): fix duration field descriptions
https://emqx.atlassian.net/browse/EMQX-8642

Adds different descriptions for the different fields of type duration
for MongoDB.

Based off: https://www.mongodb.com/docs/manual/reference/connection-string/
2023-01-03 10:01:56 -03:00
Zaiming (Stone) Shi ced5a27053 test: fix emqx_conf test cases 2023-01-02 21:30:40 +01:00
ieQu1 2f208c3ab9 fix(cluster_rpc): Detect stopped replicant nodes 2023-01-02 21:30:40 +01:00
lafirest 7985cd3536
Merge pull request #9638 from lafirest/fix/mysql_dup
fix(mysql): fix the problem of data loss and bad match when mysql is disconnected
2023-01-02 23:15:44 +08:00
Erik Timan b9d012e072 refactor(emqx_resource): ingress bridge counter
Unify code paths for resource metrics by removing
emqx_resource:inc_received/1 and adding
emqx_resource_metrics:received_inc/1 & friends.
2023-01-02 15:11:52 +01:00
Thales Macedo Garitezi 7e02eac3bc
Merge pull request #9619 from thalesmg/refactor-gauges-v50
refactor(metrics): use absolute gauge values rather than deltas (v5.0)
2023-01-02 10:56:47 -03:00
firest bc37556963 fix(mysql): fix the problem of data loss and bad match when mysql is disconnected 2023-01-02 21:46:24 +08:00
Zaiming (Stone) Shi dbc10c2eed chore: update copyright year 2023 2023-01-02 09:22:27 +01:00
Zaiming (Stone) Shi 231d6da4dc
Merge pull request #9644 from id/fix-kafka-bridge-connectivity-detection
fix(kafka): detect connectivity in on_get_status
2022-12-30 21:54:56 +01:00
Thales Macedo Garitezi 305ed68916 chore: bump app vsns 2022-12-30 16:51:24 -03:00
Thales Macedo Garitezi 8b060a75f1 refactor(metrics): use absolute gauge values rather than deltas
https://emqx.atlassian.net/browse/EMQX-8548

Currently, we face several issues trying to keep resource metrics
reasonable.  For example, when a resource is re-created and has its
metrics reset, but then its durable queue resumes its previous work
and leads to strange (often negative) metrics.

Instead using `counters` that are shared by more than one worker to
manage gauges, we introduce an ETS table whose key is not only scoped
by the Resource ID as before, but also by the worker ID.  This way,
when a worker starts/terminates, they should set their own gauges to
their values (often 0 or `replayq:count` when resuming off a queue).
With this scoping and initialization procedure, we'll hopefully avoid
hitting those strange metrics scenarios and have better control over
the gauges.
2022-12-30 16:51:24 -03:00
Zaiming (Stone) Shi b30f2ea58b fix(statsd schema): a field is not 'required' when it has 'default' 2022-12-30 14:20:24 +01:00
Zaiming (Stone) Shi 981f75dc73 test(emqx_modules): do not expect badmatch in test cases!!! 2022-12-30 14:20:24 +01:00
Zaiming (Stone) Shi 0ce1ca89b7 refactor: use string type for server and servers 2022-12-30 14:20:23 +01:00
Zaiming (Stone) Shi cac7e0c5f0 refactor: move version prefix string detection to a static fun
this is to make dialyzer happy
2022-12-30 14:19:03 +01:00
Thales Macedo Garitezi a612eacf3a
Merge pull request #9641 from thalesmg/fix-gcp-pubsub-jwt-refresh-v50
fix(gcp_pubsub): fix potential jwt accumulation and lack of refresh (v5.0)
2022-12-30 09:33:41 -03:00
Ivan Dyachkov f410201dc3 chore: fix flaky test case in emqx_connector_jwt_worker_SUITE 2022-12-30 11:45:13 +01:00
zhongwencool f92b1fb8f4
Merge pull request #9633 from zhongwencool/fix-json-fmt
fix: bad best fmt json []
2022-12-30 09:08:13 +08:00
Thales Macedo Garitezi 446a4c74d0 fix(gcp_pubsub): fix potential jwt accumulation and lack of refresh (v5.0)
https://emqx.atlassian.net/browse/EMQX-8653
Related:
- https://emqx.atlassian.net/browse/EEC-737
- https://emqx.atlassian.net/browse/EMQX-8652

Since the rule resource testing mechanism creates a new resource to
test the configuration, a new JWT associated with an unique temporary
resource was being created and left in the JWT table, leaking it.

Also, a wrong case clause when setting the new refresh timer for the
JWT worker was preventing it from refreshing from the 2nd refresh
onward.
2022-12-29 16:30:36 -03:00
Zaiming (Stone) Shi 0b43ae621d ci: dump docker-compose log if failed to run ct 2022-12-29 09:23:11 +01:00
Zhongwen Deng 4e62aff3ab fix: bad best fmt json [] 2022-12-29 14:53:00 +08:00
Zaiming (Stone) Shi 2790d5697d test: add a 2 seconds sleep between listener sotp and restart
to lower the chance of eaddrinuse
2022-12-28 18:48:53 +01:00
Thales Macedo Garitezi 4819794401 test(refactor): decrease test teardown noise 2022-12-27 10:30:14 -03:00
Thales Macedo Garitezi 6fdcba641e test(refactor): no need for monitor
the janitor is already linked to the parent
2022-12-27 10:30:14 -03:00