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

Make enforcing simple queries configurable #3733

Merged
merged 2 commits into from
Aug 12, 2022

Conversation

NelsonVides
Copy link
Collaborator

@NelsonVides NelsonVides commented Aug 12, 2022

This might be useful when we just don't want to offer clients the possibility of making very expensive queries. A conversation with over 10k messages is not uncommon, and when there are many of them and that many are fetched, it can put the DB at DDoS risk.
So if the operator desires so, all counting operations can be removed to begin with.

@NelsonVides NelsonVides requested a review from arcusfelis August 12, 2022 14:43
@mongoose-im

This comment was marked as outdated.

@codecov
Copy link

codecov bot commented Aug 12, 2022

Codecov Report

Merging #3733 (28cb7a1) into master (79c8a87) will increase coverage by 0.36%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #3733      +/-   ##
==========================================
+ Coverage   81.95%   82.31%   +0.36%     
==========================================
  Files         526      526              
  Lines       33839    33844       +5     
==========================================
+ Hits        27732    27859     +127     
+ Misses       6107     5985     -122     
Impacted Files Coverage Δ
src/mam/mod_mam.erl 97.40% <ø> (ø)
src/mam/mam_iq.erl 84.21% <100.00%> (+0.87%) ⬆️
src/mam/mod_mam_muc.erl 75.34% <100.00%> (+0.11%) ⬆️
src/mam/mod_mam_params.erl 100.00% <100.00%> (ø)
src/mam/mod_mam_pm.erl 89.55% <100.00%> (+0.04%) ⬆️
src/pubsub/mod_pubsub_db.erl 57.14% <0.00%> (-28.58%) ⬇️
src/ejabberd.erl 55.00% <0.00%> (-5.00%) ⬇️
src/inbox/mod_inbox_rdbms_async.erl 70.58% <0.00%> (-2.95%) ⬇️
src/mam/mod_mam_muc_rdbms_arch_async.erl 82.85% <0.00%> (-2.86%) ⬇️
src/ejabberd_s2s_out.erl 60.54% <0.00%> (-1.99%) ⬇️
... and 22 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@mongoose-im

This comment was marked as outdated.

@NelsonVides NelsonVides force-pushed the configure_enforcing_simple_queries branch from 607a325 to 28cb7a1 Compare August 12, 2022 18:31
@mongoose-im
Copy link
Collaborator

mongoose-im commented Aug 12, 2022

small_tests_24 / small_tests / 28cb7a1
Reports root / small


small_tests_25 / small_tests / 28cb7a1
Reports root / small


dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 28cb7a1
Reports root/ big
OK: 3354 / Failed: 0 / User-skipped: 88 / Auto-skipped: 0


ldap_mnesia_24 / ldap_mnesia / 28cb7a1
Reports root/ big
OK: 1897 / Failed: 0 / User-skipped: 520 / Auto-skipped: 0


dynamic_domains_mysql_redis_25 / mysql_redis / 28cb7a1
Reports root/ big
OK: 3337 / Failed: 0 / User-skipped: 105 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 28cb7a1
Reports root/ big
OK: 3354 / Failed: 0 / User-skipped: 88 / Auto-skipped: 0


ldap_mnesia_25 / ldap_mnesia / 28cb7a1
Reports root/ big
OK: 1897 / Failed: 0 / User-skipped: 520 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / 28cb7a1
Reports root/ big
OK: 3354 / Failed: 0 / User-skipped: 88 / Auto-skipped: 0


pgsql_mnesia_24 / pgsql_mnesia / 28cb7a1
Reports root/ big
OK: 3728 / Failed: 0 / User-skipped: 97 / Auto-skipped: 0


internal_mnesia_25 / internal_mnesia / 28cb7a1
Reports root/ big
OK: 2018 / Failed: 0 / User-skipped: 399 / Auto-skipped: 0


elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / 28cb7a1
Reports root/ big
OK: 2316 / Failed: 0 / User-skipped: 394 / Auto-skipped: 0


pgsql_mnesia_25 / pgsql_mnesia / 28cb7a1
Reports root/ big
OK: 3728 / Failed: 0 / User-skipped: 97 / Auto-skipped: 0


mysql_redis_25 / mysql_redis / 28cb7a1
Reports root/ big
OK: 3723 / Failed: 0 / User-skipped: 102 / Auto-skipped: 0


riak_mnesia_24 / riak_mnesia / 28cb7a1
Reports root/ big
OK: 2176 / Failed: 0 / User-skipped: 387 / Auto-skipped: 0


mssql_mnesia_25 / odbc_mssql_mnesia / 28cb7a1
Reports root/ big
OK: 3728 / Failed: 0 / User-skipped: 97 / Auto-skipped: 0

Copy link
Contributor

@arcusfelis arcusfelis left a comment

Choose a reason for hiding this comment

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

ok

@arcusfelis arcusfelis merged commit 05eb8f5 into master Aug 12, 2022
@arcusfelis arcusfelis deleted the configure_enforcing_simple_queries branch August 12, 2022 19:08
@chrzaszcz chrzaszcz added this to the 6.0.0 milestone Dec 12, 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.

4 participants