mtproto_proxy/test
Sergey Prokhorov 42d86517a4
Add split-mode: front/back nodes via Erlang distribution
Adds `node_role = front | back | both` (default `both` — no behaviour change).
In split mode the domestic front node runs Ranch listeners and session/policy
processes; the foreign back node runs mtp_config, DC pools, and downstream
connections.

The key implementation insight: Erlang's transparent distributed process
addressing means `gen_server:call({mtp_dc_pool_1, BackNode}, ...)` works
identically to a local call — zero changes to the hot-path message protocol.
Process monitors fire on node disconnection, so back-node restarts propagate
cleanly to front-node handlers without any watcher process.

Changes:
- mtproto_proxy_sup: role-parameterised children/1
- mtproto_proxy_app: role-gated start, config_changed, port management
- mtp_config: backend_node/0, remote-aware get_downstream_pool/1 and
  get_default_dc/0 using erpc:call; get_downstream_safe/2 dispatches
  remotely in front mode
- mtp_metric: passive_metrics/0 skips unavailable gauges per role
- split_dc_SUITE: two CT cases (echo, migration) on OTP peer nodes

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-11 23:33:09 +02:00
..
bench_codec_decode.erl Add option to disable crc32 check in mtp_full to save CPU 2019-10-24 23:28:24 +02:00
bench_codec_encode.erl Add benchmarks 2019-10-14 02:48:08 +02:00
mtp_prop_gen.erl Fix decoding of packets split to multiple TLS frames. Fixes gh-16 2019-08-12 19:02:37 +02:00
mtp_test_client.erl Modernisations 2026-02-17 01:11:32 +01:00
mtp_test_cmd_rpc.erl Add some statefull property-based integration tests 2019-03-13 02:12:21 +01:00
mtp_test_datacenter.erl Fix deprecated code:lib_dir/2 warning in mtp_test_datacenter 2026-04-07 13:48:07 +02:00
mtp_test_echo_rpc.erl Make it possible to change logick of test server RPC handling 2019-03-07 02:32:22 +01:00
mtp_test_metric.erl Replace Travis-CI with Github actions, add support for OTP-25 2022-11-23 00:58:53 +01:00
mtp_test_middle_server.erl feat: transparent client migration on DC connection death 2026-04-08 00:46:56 +02:00
mtp_test_reporter_rpc.erl feat: transparent client migration on DC connection death 2026-04-08 00:46:56 +02:00
prop_mtp_abridged.erl Refactor codecs 2019-07-25 13:17:37 +02:00
prop_mtp_aes_cbc.erl Refactor codecs 2019-07-25 13:17:37 +02:00
prop_mtp_codec.erl Add option to disable crc32 check in mtp_full to save CPU 2019-10-24 23:28:24 +02:00
prop_mtp_fake_tls.erl Add per-SNI derived secrets feature 2026-04-07 03:22:57 +02:00
prop_mtp_full.erl Add option to disable crc32 check in mtp_full to save CPU 2019-10-24 23:28:24 +02:00
prop_mtp_intermediate.erl Refactor codecs 2019-07-25 13:17:37 +02:00
prop_mtp_obfuscated.erl Cosmetic changes: README, docker, dialyzer fixes 2019-08-12 19:02:37 +02:00
prop_mtp_rpc.erl Fix RPC protocol flags and add RPC_PING/PONG response 2026-04-07 19:12:28 +02:00
prop_mtp_statefull.erl Use OTP logger instead of lager. 2026-02-17 01:50:54 +01:00
single_dc_SUITE.erl test: fix downstream_migration metric labels (add dc_id) 2026-04-11 18:35:02 +02:00
split_dc_SUITE.erl Add split-mode: front/back nodes via Erlang distribution 2026-04-11 23:33:09 +02:00
test-sys.config Use OTP logger instead of lager. 2026-02-17 01:50:54 +01:00