emqx/apps
Thales Macedo Garitezi 7a16ff4f04 fix(postgres_bridge): fix table existence check and handle sync_required
Fixes https://emqx.atlassian.net/browse/EMQX-10629

During health checking, we check whether tables in the SQL statement
exist.  Such check was done by asking the backend to parse the
statement using a named prepared statements.  Concurrent health checks
could then result in the error:

```erlang
{error,{error,error,<<"42P05">>,duplicate_prepared_statement,<<"prepared statement \"get_status\" already exists">>,[{file,<<"prepare.c">>},{line,<<"451">>},{routine,<<"StorePreparedStatement">>},{severity,<<"ERROR">>}]}}
```

This could lead to an inconsistent state in the driver process, which
would crash later when a message from the backend (`READY_FOR_QUERY`, "idle"):

```
  2023-07-24T13:05:58.892043+00:00 [error] Generic server <0.2134.0> terminating. Reason: {'module could not be loaded',[{undefined,handle_message,[90,<<"I">>,...
```

Added calls to `epgsql:sync/1` for functions that could return
`{error, sync_required}`.

Also, redundant calls to `parse2` were removed to reduce the number of requests.
2023-07-25 09:15:14 -03:00
..
emqx refactor: module move to app emqx_rule_engine 2023-07-24 09:33:28 +08:00
emqx_authn refactor: HTTP connector into emqx_bridge_http app 2023-07-12 14:46:43 +02:00
emqx_authz refactor: HTTP connector into emqx_bridge_http app 2023-07-12 14:46:43 +02:00
emqx_auto_subscribe feat: implement configuration and user data export/import CLI 2023-06-09 14:11:47 +03:00
emqx_bridge Merge pull request #11260 from thalesmg/fix-rule-maps-nested-put-r51 2023-07-14 15:02:24 -03:00
emqx_bridge_cassandra fix(machine_boot): ensure emqx_bridge starts after its companion apps 2023-07-20 13:11:44 -03:00
emqx_bridge_clickhouse fix(machine_boot): ensure emqx_bridge starts after its companion apps 2023-07-20 13:11:44 -03:00
emqx_bridge_dynamo fix(machine_boot): ensure emqx_bridge starts after its companion apps 2023-07-20 13:11:44 -03:00
emqx_bridge_gcp_pubsub fix(machine_boot): ensure emqx_bridge starts after its companion apps 2023-07-20 13:11:44 -03:00
emqx_bridge_hstreamdb fix(machine_boot): ensure emqx_bridge starts after its companion apps 2023-07-20 13:11:44 -03:00
emqx_bridge_http Merge pull request #11306 from thalesmg/rule-actions-reply-dropped-r51-20230719 2023-07-21 16:51:14 -03:00
emqx_bridge_influxdb fix(machine_boot): ensure emqx_bridge starts after its companion apps 2023-07-20 13:11:44 -03:00
emqx_bridge_iotdb fix(machine_boot): ensure emqx_bridge starts after its companion apps 2023-07-20 13:11:44 -03:00
emqx_bridge_kafka fix(machine_boot): ensure emqx_bridge starts after its companion apps 2023-07-20 13:11:44 -03:00
emqx_bridge_matrix fix(machine_boot): ensure emqx_bridge starts after its companion apps 2023-07-20 13:11:44 -03:00
emqx_bridge_mongodb fix(machine_boot): ensure emqx_bridge starts after its companion apps 2023-07-20 13:11:44 -03:00
emqx_bridge_mqtt fix(machine_boot): ensure emqx_bridge starts after its companion apps 2023-07-20 13:11:44 -03:00
emqx_bridge_mysql fix(machine_boot): ensure emqx_bridge starts after its companion apps 2023-07-20 13:11:44 -03:00
emqx_bridge_opents fix(machine_boot): ensure emqx_bridge starts after its companion apps 2023-07-20 13:11:44 -03:00
emqx_bridge_oracle Merge pull request #11316 from paulozulato/fix-oracle-pool-size 2023-07-21 17:51:21 -03:00
emqx_bridge_pgsql fix(postgres_bridge): fix table existence check and handle sync_required 2023-07-25 09:15:14 -03:00
emqx_bridge_pulsar fix(machine_boot): ensure emqx_bridge starts after its companion apps 2023-07-20 13:11:44 -03:00
emqx_bridge_rabbitmq fix(machine_boot): ensure emqx_bridge starts after its companion apps 2023-07-20 13:11:44 -03:00
emqx_bridge_redis fix(machine_boot): ensure emqx_bridge starts after its companion apps 2023-07-20 13:11:44 -03:00
emqx_bridge_rocketmq fix(machine_boot): ensure emqx_bridge starts after its companion apps 2023-07-20 13:11:44 -03:00
emqx_bridge_sqlserver fix(machine_boot): ensure emqx_bridge starts after its companion apps 2023-07-20 13:11:44 -03:00
emqx_bridge_tdengine fix(machine_boot): ensure emqx_bridge starts after its companion apps 2023-07-20 13:11:44 -03:00
emqx_bridge_timescale fix(machine_boot): ensure emqx_bridge starts after its companion apps 2023-07-20 13:11:44 -03:00
emqx_conf chore: pretty the cli output style 2023-07-20 21:01:28 +08:00
emqx_connector fix(postgres_bridge): fix table existence check and handle sync_required 2023-07-25 09:15:14 -03:00
emqx_ctl feat: add conf reload cli 2023-06-11 09:11:17 +08:00
emqx_dashboard refactor: HTTP connector into emqx_bridge_http app 2023-07-12 14:46:43 +02:00
emqx_durable_storage docs(ds): Apply suggestions from code review 2023-06-28 10:04:07 +02:00
emqx_enterprise refactor(schema_registry): refactor schema registry app and modules 2023-07-12 09:24:15 -03:00
emqx_eviction_agent fix: emqx CI failed 2023-07-10 10:34:36 +08:00
emqx_exhook feat(authz): use extensible map format for actions in authz rules 2023-07-07 19:40:34 +03:00
emqx_ft Merge pull request #10986 from savonarola/ft/EMQX-9523/config-api 2023-07-10 15:32:30 +03:00
emqx_gateway Merge pull request #11211 from sstrigler/EMQX-9963-refactor-all-http-ap-is-to-respond-404-on-the-deletion-of-the-resource-is-non-exist 2023-07-10 16:25:31 +02:00
emqx_gateway_coap feat(authz): add tests for authz extended actions 2023-07-07 19:40:34 +03:00
emqx_gateway_exproto feat(authz): use extensible map format for actions in authz rules 2023-07-07 19:40:34 +03:00
emqx_gateway_lwm2m feat(authz): use extensible map format for actions in authz rules 2023-07-07 19:40:34 +03:00
emqx_gateway_mqttsn feat(authz): use extensible map format for actions in authz rules 2023-07-07 19:40:34 +03:00
emqx_gateway_stomp feat(authz): use extensible map format for actions in authz rules 2023-07-07 19:40:34 +03:00
emqx_machine fix(machine_boot): ensure emqx_bridge starts after its companion apps 2023-07-20 13:11:44 -03:00
emqx_management feat: add topic_metrics and slow_subs configuration to data import/export 2023-07-21 10:41:22 +03:00
emqx_modules fix(emqx_modules): ignore already_existed/not_found errors for added/removed topic metrics 2023-07-21 12:17:47 +03:00
emqx_mongodb chore: bump app versions 2023-07-07 11:17:54 +08:00
emqx_mysql feat(authz): bump app versions 2023-07-07 19:41:34 +03:00
emqx_node_rebalance chore: add more detail msg for merging failed 2023-07-20 17:48:26 +08:00
emqx_oracle Merge pull request #11316 from paulozulato/fix-oracle-pool-size 2023-07-21 17:51:21 -03:00
emqx_plugins fix(plugins): start/stop plugins when loading config from CLI 2023-07-07 13:37:51 -03:00
emqx_prometheus fix: delete bad link in emqx_prometheus 2023-07-10 16:48:13 +08:00
emqx_psk fix: psk_authentication is updated failed 2023-07-07 20:02:06 +08:00
emqx_redis fix(redis): validate database number 2023-07-03 22:44:54 +03:00
emqx_resource refactor: use emqx_pool:async_submit to avoid excessive spawning 2023-07-20 10:17:43 -03:00
emqx_retainer fix(emqx_retainer): return 404 in delete if topic not found 2023-07-08 14:43:43 +02:00
emqx_rule_engine fix(nested_put): fix a data loss bug introduced by #11172 2023-07-24 16:39:37 +08:00
emqx_s3 test: fix mocking and application start 2023-07-12 14:47:52 +02:00
emqx_schema_registry fix(machine_boot): use shared list of reboot apps and add bridges to reboot list 2023-07-19 20:15:42 -03:00
emqx_slow_subs chore: bump app vsns 2023-06-21 16:36:51 +02:00
emqx_telemetry test: fix mocking and application start 2023-07-12 14:47:52 +02:00
emqx_utils feat(ft-api): bump app versions 2023-07-07 19:17:22 +03:00