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

Add mongoose_rdbms_backend #3390

Merged
merged 1 commit into from
Nov 9, 2021

Conversation

gustawlippa
Copy link
Contributor

@gustawlippa gustawlippa commented Nov 8, 2021

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.

@mongoose-im

This comment has been minimized.

@codecov
Copy link

codecov bot commented Nov 8, 2021

Codecov Report

Merging #3390 (6ce5112) into without-dynamic-backend-modules (9299add) will increase coverage by 0.00%.
The diff coverage is 95.65%.

Impacted file tree graph

@@                       Coverage Diff                        @@
##           without-dynamic-backend-modules    #3390   +/-   ##
================================================================
  Coverage                            80.89%   80.90%           
================================================================
  Files                                  414      415    +1     
  Lines                                32640    32654   +14     
================================================================
+ Hits                                 26405    26419   +14     
  Misses                                6235     6235           
Impacted Files Coverage Δ
src/mam/mod_mam_rdbms_prefs.erl 97.05% <ø> (ø)
src/rdbms/mongoose_rdbms_mysql.erl 93.10% <ø> (ø)
src/rdbms/mongoose_rdbms_odbc.erl 78.70% <ø> (ø)
src/rdbms/mongoose_rdbms_pgsql.erl 88.23% <ø> (ø)
src/rdbms/mongoose_rdbms.erl 60.48% <80.00%> (ø)
src/rdbms/mongoose_rdbms_backend.erl 100.00% <100.00%> (ø)
src/wpool/mongoose_wpool_rdbms.erl 86.95% <100.00%> (+2.95%) ⬆️
src/mod_roster_mnesia.erl 72.72% <0.00%> (-21.22%) ⬇️
src/mod_roster_riak.erl 81.53% <0.00%> (-15.39%) ⬇️
src/mod_bosh_socket.erl 78.88% <0.00%> (-0.32%) ⬇️
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d21eb5d...6ce5112. Read the comment docs.

Copy link
Collaborator

@NelsonVides NelsonVides left a comment

Choose a reason for hiding this comment

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

That is basically great!
Only remember to remove the xref ignore from here as well:

mongoose_rdbms_backend,

I'm very happy to see this one, it gets us a step closer to supporting more than one rdbms pool, looking forward for that :)

@mongoose-im
Copy link
Collaborator

mongoose-im commented Nov 9, 2021

small_tests_24 / small_tests / 6ce5112
Reports root / small


internal_mnesia_24 / internal_mnesia / 6ce5112
Reports root/ big
OK: 1589 / Failed: 0 / User-skipped: 297 / Auto-skipped: 0


small_tests_23 / small_tests / 6ce5112
Reports root / small


dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 6ce5112
Reports root/ big
OK: 2702 / Failed: 0 / User-skipped: 184 / Auto-skipped: 0


ldap_mnesia_24 / ldap_mnesia / 6ce5112
Reports root/ big
OK: 1489 / Failed: 1 / User-skipped: 400 / Auto-skipped: 0

mod_event_pusher_rabbit_SUITE:group_chat_message_publish:group_chat_message_received_event_properly_formatted
{error,
  {{assertMatch,
     [{module,mod_event_pusher_rabbit_SUITE},
      {line,435},
      {expression,
        "get_decoded_message_from_rabbit ( AliceGroupChatMsgRecvRK )"},
      {pattern,
        "# { << \"from_user_id\" >> := BobRoomJID , << \"to_user_id\" >> := AliceFullJID , << \"message\" >> := Message }"},
      {value,
        #{<<"from_user_id">> =>
          <<"muc_publish@muc.localhost/bOb_unnamed_23.639741">>,
        <<"message">> => <<"Hi there!">>,
        <<"to_user_id">> =>
          <<"alice_unnamed_23.750173@localhost/res1">>}}]},
   [{mod_event_pusher_rabbit_SUITE,
      '-group_chat_message_received_event_properly_formatted/1-fun-1-',3,
      [{file,
         "/home/circleci/app/big_tests/tests/mod_event_pusher_rabbit_SUITE.erl"},
       {line,435}]},
    {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}]}]}}

Report log


dynamic_domains_pgsql_mnesia_23 / pgsql_mnesia / 6ce5112
Reports root/ big
OK: 2702 / Failed: 0 / User-skipped: 184 / Auto-skipped: 0


ldap_mnesia_23 / ldap_mnesia / 6ce5112
Reports root/ big
OK: 1486 / Failed: 0 / User-skipped: 400 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_24 / odbc_mssql_mnesia / 6ce5112
Reports root/ big
OK: 2701 / Failed: 1 / User-skipped: 184 / Auto-skipped: 0

inbox_SUITE:one_to_one:other_resources_do_not_interfere
{error,
  {test_case_failed,
    #{check_params => #{},
      error => {badmatch,1},
      expected_items =>
        [#{content => <<"How are you">>,
         from =>
           <<"kate_other_resources_do_not_interfere_72.876724@domain.example.com/res1">>,
         to =>
           <<"mike_other_resources_do_not_interfere_72.876724@domain.example.com/res1">>,
         unread => 2,verify => #Fun<inbox_SUITE.117.11357666>}],
      inbox_items =>
        [<<"<message from='mike_other_resources_do_not_interfere_72.876724@domain.example.com' to='mike_other_resources_do_not_interfere_72.876724@domain.example.com/res1' id='1fb4ae2e-bdc9-4a8c-9204-0b7100e5df56'><result xmlns='erlang-solutions.com:xmpp:inbox:0' unread='1' queryid='b94c98af1b128b5d695bf3df805cc559'><forwarded xmlns='urn:xmpp:forward:0'><delay xmlns='urn:xmpp:delay' stamp='2021-11-09T09:07:58.328503Z'/><message from='kate_other_resources_do_not_interfere_72.876724@domain.example.com/res1' xml:lang='en' to='mike_other_resources_do_not_interfere_72.876724@domain.example.com/res1' type='chat' id='82efbb7f1fc2d21624f8e19bb401ddca'><body>How are you</body></message></forwarded><archive>false</archive><mute>0</mute></result></message>">>],
      query_params => #{},reason => inbox_mismatch,
      stacktrace =>
        [{inbox_helper,process_inbox_message,4,
           [{file,
            "/home/circleci/app/big_tests/tests/inbox_helper.erl"},
          {line,194}]},
         {lists,foreach,2,[{file,"lists.erl"},{line,1342}]},...

Report log


elasticsearch_and_cassandra_24 / elasticsearch_and_cassandra_mnesia / 6ce5112
Reports root/ big
OK: 1862 / Failed: 0 / User-skipped: 323 / Auto-skipped: 0


pgsql_mnesia_24 / pgsql_mnesia / 6ce5112
Reports root/ big
OK: 3071 / Failed: 0 / User-skipped: 211 / Auto-skipped: 0


mysql_redis_24 / mysql_redis / 6ce5112
Reports root/ big
OK: 3060 / Failed: 2 / User-skipped: 228 / Auto-skipped: 0

mod_event_pusher_rabbit_SUITE:group_chat_message_publish:group_chat_message_received_event_properly_formatted
{error,
  {{assertMatch,
     [{module,mod_event_pusher_rabbit_SUITE},
      {line,435},
      {expression,
        "get_decoded_message_from_rabbit ( AliceGroupChatMsgRecvRK )"},
      {pattern,
        "# { << \"from_user_id\" >> := BobRoomJID , << \"to_user_id\" >> := AliceFullJID , << \"message\" >> := Message }"},
      {value,
        #{<<"from_user_id">> =>
          <<"muc_publish@muc.localhost/bOb_unnamed_72.423185">>,
        <<"message">> => <<"Hi there!">>,
        <<"to_user_id">> =>
          <<"alice_unnamed_72.580939@localhost/res1">>}}]},
   [{mod_event_pusher_rabbit_SUITE,
      '-group_chat_message_received_event_properly_formatted/1-fun-1-',3,
      [{file,
         "/home/circleci/app/big_tests/tests/mod_event_pusher_rabbit_SUITE.erl"},
       {line,435}]},
    {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}]}]}}

Report log

mod_event_pusher_rabbit_SUITE:group_chat_message_publish:group_chat_message_received_event_properly_formatted
{error,
  {{assertMatch,
     [{module,mod_event_pusher_rabbit_SUITE},
      {line,435},
      {expression,
        "get_decoded_message_from_rabbit ( AliceGroupChatMsgRecvRK )"},
      {pattern,
        "# { << \"from_user_id\" >> := BobRoomJID , << \"to_user_id\" >> := AliceFullJID , << \"message\" >> := Message }"},
      {value,
        #{<<"from_user_id">> =>
          <<"muc_publish@muc.localhost/bOb_unnamed_72.423185">>,
        <<"message">> => <<"Hi there!">>,
        <<"to_user_id">> =>
          <<"alice_unnamed_73.281596@localhost/res1">>}}]},
   [{mod_event_pusher_rabbit_SUITE,
      '-group_chat_message_received_event_properly_formatted/1-fun-1-',3,
      [{file,
         "/home/circleci/app/big_tests/tests/mod_event_pusher_rabbit_SUITE.erl"},
       {line,435}]},
    {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}]}]}}

Report log


pgsql_mnesia_23 / pgsql_mnesia / 6ce5112
Reports root/ big
OK: 3071 / Failed: 0 / User-skipped: 211 / Auto-skipped: 0


mssql_mnesia_24 / odbc_mssql_mnesia / 6ce5112
Reports root/ big
OK: 3071 / Failed: 0 / User-skipped: 211 / Auto-skipped: 0


riak_mnesia_24 / riak_mnesia / 6ce5112
Reports root/ big
OK: 1745 / Failed: 2 / User-skipped: 326 / Auto-skipped: 0

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_90.502706@localhost/res1">>},
        {<<"id">>,<<"65c73f4c-7704-4f41-b1f8-42bf70222e5e">>},
        {<<"type">>,<<"set">>}],
       [{xmlel,<<"jingle">>,
          [{<<"xmlns">>,<<"urn:xmpp:jingle:1">>},
           {<<"action">>,<<"session-terminate">>},
           {<<"sid">>,<<"b77dfad1-c619-4497-bbe6-70153d57e7d4">>}],
          [{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_90.502706@localhost/res1' id='65c73f4c-7704-4f41-b1f8-42bf70222e5e' type='set'><jingle xmlns='urn:xmpp:jingle:1' action='session-terminate' sid='b77dfad1-c619-4497-bbe6-70153d57e7d4'><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...

Report log

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_1.174176@localhost/res1">>},
        {<<"id">>,<<"398a5718-31fd-43b0-832e-e7a0a8bd6eb9">>},
        {<<"type">>,<<"set">>}],
       [{xmlel,<<"jingle">>,
          [{<<"xmlns">>,<<"urn:xmpp:jingle:1">>},
           {<<"action">>,<<"session-terminate">>},
           {<<"sid">>,<<"b61e67c6-ff55-40bc-bf08-1e435b4dbd55">>}],
          [{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_1.174176@localhost/res1' id='398a5718-31fd-43b0-832e-e7a0a8bd6eb9' type='set'><jingle xmlns='urn:xmpp:jingle:1' action='session-terminate' sid='b61e67c6-ff55-40bc-bf08-1e435b4dbd55'><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,
      '-resp_...

Report log


dynamic_domains_mssql_mnesia_24 / odbc_mssql_mnesia / 6ce5112
Reports root/ big
OK: 2702 / Failed: 0 / User-skipped: 184 / Auto-skipped: 0


mysql_redis_24 / mysql_redis / 6ce5112
Reports root/ big
OK: 3060 / Failed: 1 / User-skipped: 228 / Auto-skipped: 0

mam_SUITE:rdbms_simple_prefs_cases:messages_filtered_when_prefs_default_policy_is_roster
{error,{test_case_failed,"ASSERT EQUAL\n\tExpected []\n\tValue [ok]\n"}}

Report log


riak_mnesia_24 / riak_mnesia / 6ce5112
Reports root/ big
OK: 1709 / Failed: 0 / User-skipped: 326 / Auto-skipped: 0

Copy link
Collaborator

@NelsonVides NelsonVides left a comment

Choose a reason for hiding this comment

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

Beautiful 👌🏽

@NelsonVides NelsonVides merged commit d856ba0 into without-dynamic-backend-modules Nov 9, 2021
@NelsonVides NelsonVides deleted the wdbm-mongoose_rdbms branch November 9, 2021 10:02
@Premwoik Premwoik modified the milestones: 5.1.0, 5.0.0 May 25, 2022
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.

None yet

4 participants