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

Multi tenancy pm #3075

Merged
merged 8 commits into from
Apr 14, 2021
Merged

Multi tenancy pm #3075

merged 8 commits into from
Apr 14, 2021

Conversation

DenysGonchar
Copy link
Collaborator

@DenysGonchar DenysGonchar commented Apr 7, 2021

this PR introduces:

  • a new router mongoose_router_dynamic_domains that is responcible for a lazy adding (on the first routing attempt) of dynamic domains. removal of dynamic domains happens synchronously on disable_domain hook.
  • a new mandatory configuration item default_server_domain - it must be used for reporting stream errors before user clarifies the domain name he wants to use (before user sets up the stream).

@codecov
Copy link

codecov bot commented Apr 7, 2021

Codecov Report

Merging #3075 (ff6d99b) into multi-tenancy-phase-1 (f991ee2) will increase coverage by 0.60%.
The diff coverage is 88.90%.

Impacted file tree graph

@@                    Coverage Diff                    @@
##           multi-tenancy-phase-1    #3075      +/-   ##
=========================================================
+ Coverage                  78.09%   78.70%   +0.60%     
=========================================================
  Files                        374      387      +13     
  Lines                      31219    31658     +439     
=========================================================
+ Hits                       24382    24916     +534     
+ Misses                      6837     6742      -95     
Impacted Files Coverage Δ
src/admin_extra/service_admin_extra.erl 100.00% <ø> (ø)
src/ejabberd_gen_sm.erl 90.90% <ø> (ø)
src/ejabberd_router.erl 73.78% <ø> (ø)
src/ejabberd_users.erl 81.63% <ø> (ø)
src/muc_light/mod_muc_light_db_mnesia.erl 89.47% <ø> (+4.47%) ⬆️
src/offline/mod_offline_mnesia.erl 51.47% <0.00%> (ø)
src/pubsub/pubsub_form_utils.erl 56.60% <0.00%> (+1.04%) ⬆️
src/rdbms/rdbms_queries_mssql.erl 100.00% <ø> (ø)
src/auth/ejabberd_auth_pki.erl 17.64% <20.00%> (ø)
src/auth/ejabberd_auth_external.erl 29.12% <38.46%> (ø)
... and 110 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 4171b6f...ff6d99b. Read the comment docs.

hide_service_name configuration for specific host type (previously for specific domain) make no sense,
since we don't know the domain name at the moment when we fetch the value of the option. in fact (before
introduction of the host types) we were always using the value for ?MYNAME host, which was the first
item in the 'hosts' list.
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, I have a few specific comments. Also, as we agreed, there is an urgent need to fix the use of the ?MYNAME macro that is now doing something else than expected in some places in the code.

test/config_parser_SUITE.erl Show resolved Hide resolved
test/config_parser_SUITE.erl Outdated Show resolved Hide resolved
%% they have dummy values).
%% DummyDomainName value must be unique to avoid accidental config keys removal.
DummyDomainName = <<"dummy.domain.name">>,
M = maybe_insert_dummy_domain(M0, DummyDomainName),
Copy link
Member

Choose a reason for hiding this comment

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

The idea of putting ?HOST here was to create a valid config. Now the config is invalid in some tests as dummy.domain.name is not the same host as in host_config (see eq_host_config). So the tests now show (and expect) that an invalid config is parsed correctly... This might be confusing.

I'd rather keep a valid host name here and fix the issue later than have a wrong value set on purpose.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

eq_host_config/2 explicitly uses ?HOST value in both checks.

Copy link
Member

@chrzaszcz chrzaszcz Apr 14, 2021

Choose a reason for hiding this comment

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

The point is that after the change some test cases are parsing inconsistent configuration, e.g.

#{<<"hosts">> => [<<"dummy...">>], <<"host_config">> => [{<<"host_type">> => ?HOST, ....}]}

Such configuration does not make sense and maybe it even should be considered a an error.
However, valid or not, it is not typical and I'd rather have typical setups in the test.

I think it's a minor issue and it does not block merging.

@chrzaszcz chrzaszcz merged commit 82330e3 into multi-tenancy-phase-1 Apr 14, 2021
@chrzaszcz chrzaszcz deleted the multi-tenancy-pm branch April 14, 2021 17:57
@DenysGonchar DenysGonchar restored the multi-tenancy-pm branch April 19, 2021 21:03
@DenysGonchar DenysGonchar deleted the multi-tenancy-pm branch April 19, 2021 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants