Skip to content
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

Cets/mod register #4146

Merged
merged 3 commits into from
Oct 17, 2023
Merged

Cets/mod register #4146

merged 3 commits into from
Oct 17, 2023

Conversation

NelsonVides
Copy link
Collaborator

@NelsonVides NelsonVides commented Oct 12, 2023

MIM-2072

This removes mnesia usage from mod_register, which really wasn't really needed, it was using mnesia with local_content only.

Couldn't resist also simplifying the logic behind what was stored in that ets table, see removing treap from it.

@codecov
Copy link

codecov bot commented Oct 12, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (c858cec) 83.82% compared to head (3b4a271) 84.07%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4146      +/-   ##
==========================================
+ Coverage   83.82%   84.07%   +0.24%     
==========================================
  Files         561      561              
  Lines       34053    34020      -33     
==========================================
+ Hits        28546    28601      +55     
+ Misses       5507     5419      -88     
Files Coverage Δ
src/global_distrib/mod_global_distrib_utils.erl 85.18% <100.00%> (+1.46%) ⬆️
src/mod_keystore.erl 90.32% <100.00%> (+0.07%) ⬆️
src/wpool/mongoose_wpool.erl 82.69% <100.00%> (-0.33%) ⬇️
src/wpool/mongoose_wpool_http.erl 94.73% <100.00%> (+2.73%) ⬆️
src/wpool/mongoose_wpool_rdbms.erl 91.66% <100.00%> (+8.33%) ⬆️
src/ejabberd_sup.erl 89.13% <90.90%> (+0.55%) ⬆️
src/mod_register.erl 75.26% <90.90%> (-0.84%) ⬇️

... and 15 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mongoose-im

This comment was marked as outdated.

@mongoose-im

This comment was marked as outdated.

@NelsonVides NelsonVides marked this pull request as ready for review October 12, 2023 11:59
@mongoose-im

This comment was marked as outdated.

Copy link
Member

@chrzaszcz chrzaszcz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good in general, and I like the extraction of the ETS creation to one module. I added some comments.

src/ejabberd_sup.erl Outdated Show resolved Hide resolved
src/mod_register.erl Outdated Show resolved Hide resolved
src/mod_register.erl Show resolved Hide resolved
@mongoose-im

This comment was marked as outdated.

The old logic stores a single data structure in the ets table, a "treap",
which is then cleaned and scaned, but we might do with simpler code and store
the entries directly in the ets table, and clean up by full scans.

Using a single treap means that the whole data structure is copied to processes
and then garbage collection can be expensive. It also means that two processes
adding records might override each other and therefore cause inconsistencies.

The pitfall of the ets table is full scans when cleaning old timestamps, but
with low timeouts it might be fine, also considering this module should be
seldom enabled in public setups.
@mongoose-im
Copy link
Collaborator

mongoose-im commented Oct 17, 2023

elasticsearch_and_cassandra_26 / elasticsearch_and_cassandra_mnesia / 3b4a271
Reports root/ big
OK: 369 / Failed: 0 / User-skipped: 38 / Auto-skipped: 0


small_tests_25 / small_tests / 3b4a271
Reports root / small


small_tests_26 / small_tests / 3b4a271
Reports root / small


small_tests_26_arm64 / small_tests / 3b4a271
Reports root / small


ldap_mnesia_25 / ldap_mnesia / 3b4a271
Reports root/ big
OK: 2307 / Failed: 0 / User-skipped: 865 / Auto-skipped: 0


ldap_mnesia_26 / ldap_mnesia / 3b4a271
Reports root/ big
OK: 2307 / Failed: 0 / User-skipped: 865 / Auto-skipped: 0


dynamic_domains_mysql_redis_26 / mysql_redis / 3b4a271
Reports root/ big
OK: 4240 / Failed: 0 / User-skipped: 144 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_26 / pgsql_mnesia / 3b4a271
Reports root/ big
OK: 4272 / Failed: 0 / User-skipped: 112 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_26 / odbc_mssql_mnesia / 3b4a271
Reports root/ big
OK: 4269 / Failed: 0 / User-skipped: 115 / Auto-skipped: 0


pgsql_cets_26 / pgsql_cets / 3b4a271
Reports root/ big
OK: 4659 / Failed: 0 / User-skipped: 121 / Auto-skipped: 0


pgsql_mnesia_25 / pgsql_mnesia / 3b4a271
Reports root/ big
OK: 4661 / Failed: 0 / User-skipped: 119 / Auto-skipped: 0


internal_mnesia_26 / internal_mnesia / 3b4a271
Reports root/ big
OK: 2457 / Failed: 0 / User-skipped: 715 / Auto-skipped: 0


pgsql_mnesia_26 / pgsql_mnesia / 3b4a271
Reports root/ big
OK: 4661 / Failed: 0 / User-skipped: 119 / Auto-skipped: 0


mysql_redis_26 / mysql_redis / 3b4a271
Reports root/ big
OK: 4640 / Failed: 1 / User-skipped: 139 / Auto-skipped: 0

carboncopy_SUITE:one2one:dropped_client_doesnt_create_duplicate_carbons
{error,
  {{badmatch,
     [{xmlel,<<"message">>,
        [{<<"from">>,
        <<"alice_dropped_client_doesnt_create_duplicate_carbons_597@localhost">>},
         {<<"to">>,
        <<"alice_dropped_client_doesnt_create_duplicate_carbons_597@localhost/res2">>},
         {<<"xmlns">>,<<"jabber:client">>},
         {<<"type">>,<<"chat">>}],
        [{xmlel,<<"sent">>,
           [{<<"xmlns">>,<<"urn:xmpp:carbons:2">>}],
           [{xmlel,<<"forwarded">>,
            [{<<"xmlns">>,<<"urn:xmpp:forward:0">>}],
            [{xmlel,<<"message">>,
               [{<<"from">>,
                 <<"alice_dropped_client_doesnt_create_duplicate_carbons_597@localhost/res1">>},
                {<<"type">>,<<"chat">>},
                {<<"to">>,
                 <<"bob_dropped_client_doesnt_create_duplicate_carbons_597@localhost/res1">>},
                {<<"xmlns">>,<<"jabber:client">>}],
               [{xmlel,<<"body">>,[],
                  [{xmlcdata,
                     <<"And pious action">>}]}]}]}]}]}]},
   [{carboncopy_SUITE,
      '-dropped_client_doesnt_create_duplicate_carbons/1-fun-0-',4,
      [{file,
         "/home/circleci/project/big_tests/tests/carboncopy_SUITE.erl"},
       {line,189}]},
    {escalus_story,story,4,
      [{file,
         "/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
       {line,72}]},
    {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1793}]},
    {test_server,run_test_case_eval1,6,
      [{file,"test_serv...

Report log


mssql_mnesia_26 / odbc_mssql_mnesia / 3b4a271
Reports root/ big
OK: 4658 / Failed: 0 / User-skipped: 122 / Auto-skipped: 0


mysql_redis_26 / mysql_redis / 3b4a271
Reports root/ big
OK: 4641 / Failed: 0 / User-skipped: 139 / Auto-skipped: 0

Copy link
Member

@chrzaszcz chrzaszcz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

@chrzaszcz chrzaszcz merged commit 4ece47c into master Oct 17, 2023
@chrzaszcz chrzaszcz deleted the cets/mod_register branch October 17, 2023 11:26
@chrzaszcz chrzaszcz added this to the 6.2.0 milestone Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants