-
Notifications
You must be signed in to change notification settings - Fork 428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove dynamically compiled modules #3394
Conversation
Also, made mod_private_backend module
Move new code into mongoose_backend, just to keep it away from the old backend_module Align args correctly
mod_private without dynamic modules
Add `mod_auth_token_backend`
It returns the atom describing the backend, like `mssql`, `pgsql`, etc. This is analogous to `backend_name` function that was exposed by the dynamically compiled modules in `backend_module.erl`. It is used by some tests and `mongoose_rdbms`.
Because backends can be running per host type. This also fixes an issue of suites logging that they finished dirty, after having dynamically compiled backends removed. The old interface is called for the time being, but will be removed when all modules will have dynamic backends converted.
Add `mod_event_pusher_push_backend`
Add mongoose_backend:get_backend_name
With the changes done in #3386, this turned out to be really easy. Before that, I tried to make mongoose_rdbms_backend expose its API with HostTypes, but it was a bit messy. I think it's better to do it in a separate PR (after the whole without-dynamic-backend-modules branch is merged), to keep this already big diff smaller and more focused. Other issue is that mongoose_rdbms has many functions exported, which seem to be not used, mainly for escaping different types. This could be revisited, but, in similar fashion, I left this as is for now. What's left to do is remove dynamic mongoose_rdbms_type, but it will be done in a separate PR.
Get rid of ejabberd_rdbms because all it did was compile mongoose_rdbms_type. In turn, all it did was get an option from the config. The functionality is left as it was. From what I understand, one can (in theory) use ODBC with different databases, so maybe the rdbms_server_type option is needed, but it could at least be moved from the general section to the RDBMS pool options. This could be done after dynamically compiled modules are merged.
Codecov Report
@@ Coverage Diff @@
## master #3394 +/- ##
==========================================
+ Coverage 79.00% 80.90% +1.90%
==========================================
Files 397 414 +17
Lines 32199 32422 +223
==========================================
+ Hits 25438 26232 +794
+ Misses 6761 6190 -571
Continue to review full report at Codecov.
|
94b2e30
to
5543482
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
5543482
to
5e3aa4c
Compare
This comment has been minimized.
This comment has been minimized.
small_tests_24 / small_tests / f71b7f0 internal_mnesia_24 / internal_mnesia / f71b7f0 small_tests_23 / small_tests / f71b7f0 ldap_mnesia_23 / ldap_mnesia / f71b7f0 ldap_mnesia_24 / ldap_mnesia / f71b7f0 dynamic_domains_pgsql_mnesia_23 / pgsql_mnesia / f71b7f0 service_domain_db_SUITE:db:db_keeps_syncing_after_cluster_join{error,{test_case_failed,{[<<"example1.com">>,<<"example2.com">>,
<<"example3.com">>],
[<<"example1.com">>,<<"example2.com">>,
<<"example3.com">>,<<"example4.com">>]}}} dynamic_domains_mssql_mnesia_24 / odbc_mssql_mnesia / f71b7f0 dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / f71b7f0 dynamic_domains_mysql_redis_24 / mysql_redis / f71b7f0 elasticsearch_and_cassandra_24 / elasticsearch_and_cassandra_mnesia / f71b7f0 sm_SUITE:unacknowledged_message_hook:unacknowledged_message_hook_offline{error,{{badmatch,false},
[{escalus_session,stream_resumption,2,
[{file,"/home/circleci/app/big_tests/_build/default/lib/escalus/src/escalus_session.erl"},
{line,259}]},
{escalus_connection,connection_step,2,
[{file,"/home/circleci/app/big_tests/_build/default/lib/escalus/src/escalus_connection.erl"},
{line,160}]},
{lists,foldl,3,[{file,"lists.erl"},{line,1267}]},
{escalus_connection,start,2,
[{file,"/home/circleci/app/big_tests/_build/default/lib/escalus/src/escalus_connection.erl"},
{line,144}]},
{sm_SUITE,unacknowledged_message_hook_offline,4,
[{file,"/home/circleci/app/big_tests/tests/sm_SUITE.erl"},
{line,826}]},
{sm_SUITE,unacknowledged_message_hook_common,2,
[{file,"/home/circleci/app/big_tests/tests/sm_SUITE.erl"},
{line,878}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1783}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1292}]}]}} mysql_redis_24 / mysql_redis / f71b7f0 mam_SUITE:rdbms_prefs_cases:prefs_set_request{error,{test_case_failed,"ASSERT EQUAL\n\tExpected {prefs_result_iq,<<\"roster\">>,\n [<<\"romeo@montague.net\">>],\n [<<\"montague@montague.net\">>]}\n\tValue {prefs_result_iq,<<\"always\">>,\n [<<\"romeo@montague.net\">>],\n [<<\"montague@montague.net\">>]}\n"}} mam_SUITE:rdbms_async_pool_prefs_cases:messages_filtered_when_prefs_default_policy_is_never{error,{test_case_failed,"ASSERT EQUAL\n\tExpected []\n\tValue [ok]\n"}} domain_removal_SUITE:last_removal:last_removal{error,{{assertion_failed,assert,is_last_result,
{xmlel,<<"presence">>,
[{<<"from">>,
<<"alicE_last_removal_7.524044@localhost/res1">>},
{<<"to">>,
<<"alice_last_removal_7.524044@localhost/res1">>},
{<<"xml:lang">>,<<"en">>}],
[]},
"<presence from='alicE_last_removal_7.524044@localhost/res1' to='alice_last_removal_7.524044@localhost/res1' xml:lang='en'/>"},
[{escalus_new_assert,assert_true,2,
[{file,"/home/circleci/app/big_tests/_build/default/lib/escalus/src/escalus_new_assert.erl"},
{line,84}]},
{domain_removal_SUITE,'-last_removal/1-fun-0-',2,
[{file,"/home/circleci/app/big_tests/tests/domain_removal_SUITE.erl"},
{line,379}]},
{escalus_story,story,4,
[{file,"/home/circleci/app/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1783}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1292}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1224}]}]}} pgsql_mnesia_23 / pgsql_mnesia / f71b7f0 sm_SUITE:parallel_manual_ack_freq_1:resume_session_state_send_message{error,
{{assertion_failed,assert_many,true,
[#Fun<sm_SUITE.22.80356403>,#Fun<sm_SUITE.22.80356403>,
#Fun<sm_SUITE.22.80356403>],
[{xmlel,<<"presence">>,
[{<<"from">>,
<<"alicE_resume_session_state_send_message_14.413469@localhost/escalus-default-resource">>},
{<<"to">>,
<<"alice_resume_session_state_send_message_14.413469@localhost/escalus-default-resource">>},
{<<"xml:lang">>,<<"en">>}],
[]},
{xmlel,<<"message">>,
[{<<"from">>,
<<"bOb_resume_session_state_send_message_14.328052@localhost/escalus-default-resource">>},
{<<"to">>,
<<"alicE_resume_session_state_send_message_14.413469@localhost">>},
{<<"xml:lang">>,<<"en">>},
{<<"type">>,<<"chat">>}],
[{xmlel,<<"body">>,[],[{xmlcdata,<<"msg-1">>}]},
{xmlel,<<"delay">>,
[{<<"xmlns">>,<<"urn:xmpp:delay">>},
{<<"stamp">>,<<"2021-11-09T16:38:34.492418Z">>},
{<<"from">>,<<"localhost">>}],
[{xmlcdata,<<"SM Storage">>}]}]},
{xmlel,<<"message">>,
[{<<"from">>,
<<"bOb_resume_session_state_send_message_14.328052@localhost/escalus-default-resource">>},
{<<"to">>,
<<"alicE_resume_session_state_send_message_14.413469@localhost">>},
{<<"xml:lang">>,<<"en">>},
{<<"type">>,<<"chat">>}],
[{xmlel,<<"body">>,[],[{xmlcdata,<<"msg-2">>}]},
{xmlel,<<"delay">>,
[{<<"xmlns">>,<<"urn:xmpp:... mssql_mnesia_24 / odbc_mssql_mnesia / f71b7f0 jingle_SUITE:all:resp_4xx_from_sip_proxy_results_in_session_terminate{error,
{{assertion_failed,assert,is_iq_result,
{xmlel,<<"iq">>,
[{<<"from">>,<<"error.480@localhost">>},
{<<"to">>,
<<"alice_resp_4xx_from_sip_proxy_results_in_session_terminate_45.806081@localhost/res1">>},
{<<"id">>,<<"cad6bb9f-6eee-47a7-90a1-5e1eceb0290f">>},
{<<"type">>,<<"set">>}],
[{xmlel,<<"jingle">>,
[{<<"xmlns">>,<<"urn:xmpp:jingle:1">>},
{<<"action">>,<<"session-terminate">>},
{<<"sid">>,<<"3c3b9aef-ba74-4e7a-bd2e-c593309c6021">>}],
[{xmlel,<<"reason">>,[],
[{xmlel,<<"general-error">>,[],[]},
{xmlel,<<"sip-error">>,
[{<<"code">>,<<"480">>}],
[{xmlcdata,<<"Temporarily Unavailable">>}]}]}]}]},
"<iq from='error.480@localhost' to='alice_resp_4xx_from_sip_proxy_results_in_session_terminate_45.806081@localhost/res1' id='cad6bb9f-6eee-47a7-90a1-5e1eceb0290f' type='set'><jingle xmlns='urn:xmpp:jingle:1' action='session-terminate' sid='3c3b9aef-ba74-4e7a-bd2e-c593309c6021'><reason><general-error/><sip-error code='480'>Temporarily Unavailable</sip-error></reason></jingle></iq>"},
[{escalus_new_assert,assert_true,2,
[{file,
"/home/circleci/app/big_tests/_build/default/lib/escalus/src/escalus_new_assert.erl"},
{line,84}]},
{jingle_SUITE,send_initiate_and_wait_for_first_iq_set,2,
[{file,"/home/circleci/app/big_tests/tests/jingle_SUITE.erl"},
{line,395}]},
{jingle_SUITE,
'-res... pgsql_mnesia_24 / pgsql_mnesia / f71b7f0 riak_mnesia_24 / riak_mnesia / f71b7f0 dynamic_domains_pgsql_mnesia_23 / pgsql_mnesia / f71b7f0 mysql_redis_24 / mysql_redis / f71b7f0 sm_SUITE:parallel_manual_ack_freq_1:resume_session_state_stop_c2s{error,{thrown,{timeout,msg}}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extensive load tests showed no difference in performance. Test were performed for:
- One to one chat with MAM and Inbox
- One to one chat w/MAM but w/o Inbox
- MAM lookup
- MUC Light w/o Inbox
This PR removes dynamically compiled
_backend
modules and adds real proxy modules instead.It also removes some dynamically compiled modules that were not backends.
mod_bosh
,mod_global_distrib
andmod_pubsub
are left for later.