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

Mam retraction events #3497

Merged
merged 1 commit into from
Jan 12, 2022
Merged

Mam retraction events #3497

merged 1 commit into from
Jan 12, 2022

Conversation

NelsonVides
Copy link
Collaborator

Different handlers might want to listen on when a retraction happens, for example if the message being deleted wants to be rescued before being lost forever, or if we want metrics for it.

@mongoose-im
Copy link
Collaborator

mongoose-im commented Jan 12, 2022

small_tests_24 / small_tests / e762c53
Reports root / small


small_tests_23 / small_tests / e762c53
Reports root / small


dynamic_domains_mysql_redis_24 / mysql_redis / e762c53
Reports root/ big
OK: 2674 / Failed: 0 / User-skipped: 247 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / e762c53
Reports root/ big
OK: 2691 / Failed: 0 / User-skipped: 230 / Auto-skipped: 0

@codecov
Copy link

codecov bot commented Jan 12, 2022

Codecov Report

Merging #3497 (4185838) into master (b9b34c2) will decrease coverage by 0.03%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3497      +/-   ##
==========================================
- Coverage   81.00%   80.96%   -0.04%     
==========================================
  Files         418      418              
  Lines       32329    32333       +4     
==========================================
- Hits        26187    26180       -7     
- Misses       6142     6153      +11     
Impacted Files Coverage Δ
src/mam/mod_mam_rdbms_arch.erl 50.00% <0.00%> (-0.50%) ⬇️
src/mam/mod_mam_muc_rdbms_arch.erl 95.14% <100.00%> (+0.04%) ⬆️
src/mongoose_hooks.erl 95.31% <100.00%> (+0.04%) ⬆️
src/elasticsearch/mongoose_elasticsearch.erl 76.92% <0.00%> (-7.70%) ⬇️
src/ejabberd_s2s_out.erl 61.21% <0.00%> (-1.87%) ⬇️
src/mam/mod_mam_elasticsearch_arch.erl 85.08% <0.00%> (-1.76%) ⬇️
src/rdbms/mongoose_rdbms.erl 62.17% <0.00%> (-1.13%) ⬇️
src/ejabberd_sm.erl 84.59% <0.00%> (-0.33%) ⬇️
src/pubsub/mod_pubsub.erl 73.31% <0.00%> (+0.11%) ⬆️
src/mod_muc_room.erl 77.26% <0.00%> (+0.17%) ⬆️

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 b9b34c2...4185838. Read the comment docs.

@mongoose-im
Copy link
Collaborator

mongoose-im commented Jan 12, 2022

small_tests_24 / small_tests / c09b867
Reports root / small


small_tests_23 / small_tests / c09b867
Reports root / small


dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / c09b867
Reports root/ big
OK: 2691 / Failed: 0 / User-skipped: 230 / Auto-skipped: 0


dynamic_domains_mysql_redis_24 / mysql_redis / c09b867
Reports root/ big
OK: 2674 / Failed: 0 / User-skipped: 247 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_24 / odbc_mssql_mnesia / c09b867
Reports root/ big
OK: 2691 / Failed: 0 / User-skipped: 230 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_23 / pgsql_mnesia / c09b867
Reports root/ big
OK: 2691 / Failed: 0 / User-skipped: 230 / Auto-skipped: 0


ldap_mnesia_24 / ldap_mnesia / c09b867
Reports root/ big
OK: 1501 / Failed: 0 / User-skipped: 389 / Auto-skipped: 0


ldap_mnesia_23 / ldap_mnesia / c09b867
Reports root/ big
OK: 1501 / Failed: 0 / User-skipped: 389 / Auto-skipped: 0


internal_mnesia_24 / internal_mnesia / c09b867
Reports root/ big
OK: 1542 / Failed: 0 / User-skipped: 348 / Auto-skipped: 0


pgsql_mnesia_24 / pgsql_mnesia / c09b867
Reports root/ big
OK: 3078 / Failed: 0 / User-skipped: 239 / Auto-skipped: 0


pgsql_mnesia_23 / pgsql_mnesia / c09b867
Reports root/ big
OK: 3078 / Failed: 0 / User-skipped: 239 / Auto-skipped: 0


elasticsearch_and_cassandra_24 / elasticsearch_and_cassandra_mnesia / c09b867
Reports root/ big
OK: 1835 / Failed: 0 / User-skipped: 360 / Auto-skipped: 0


mysql_redis_24 / mysql_redis / c09b867
Reports root/ big
OK: 3073 / Failed: 0 / User-skipped: 244 / Auto-skipped: 0


mssql_mnesia_24 / odbc_mssql_mnesia / c09b867
Reports root/ big
OK: 3078 / Failed: 0 / User-skipped: 239 / Auto-skipped: 0


riak_mnesia_24 / riak_mnesia / c09b867
Reports root/ big
OK: 1681 / Failed: 0 / User-skipped: 361 / Auto-skipped: 0

mod_mam_rdbms_arch:env_vars()) ->
mod_mam_utils:retraction_info().
mam_retraction(HostType, RetractionInfo, Env) ->
{ok, RetractionInfo1} = gen_hook:run_fold(mam_retraction, HostType, RetractionInfo, Env),
Copy link
Contributor

Choose a reason for hiding this comment

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

There is a helper for calling hooks at the bottom of this file. It also handles the ok/stop matching (discarding both actually).

Copy link
Contributor

@gustawlippa gustawlippa Jan 12, 2022

Choose a reason for hiding this comment

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

I'd use the helper and revert the change for returning {stop, NewAcc} in case of a stopped hook in gen_hook.erl. We may not use it now, but at least it's not surprising that it's getting changed to an ok if we ever would want to...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh, that helper 😄

@mongoose-im
Copy link
Collaborator

mongoose-im commented Jan 12, 2022

small_tests_24 / small_tests / 4185838
Reports root / small


small_tests_23 / small_tests / 4185838
Reports root / small


dynamic_domains_pgsql_mnesia_23 / pgsql_mnesia / 4185838
Reports root/ big
OK: 2690 / Failed: 0 / User-skipped: 231 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 4185838
Reports root/ big
OK: 2690 / Failed: 0 / User-skipped: 231 / Auto-skipped: 0


ldap_mnesia_23 / ldap_mnesia / 4185838
Reports root/ big
OK: 1500 / Failed: 0 / User-skipped: 390 / Auto-skipped: 0


dynamic_domains_mysql_redis_24 / mysql_redis / 4185838
Reports root/ big
OK: 2673 / Failed: 0 / User-skipped: 248 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_24 / odbc_mssql_mnesia / 4185838
Reports root/ big
OK: 2690 / Failed: 0 / User-skipped: 231 / Auto-skipped: 0


ldap_mnesia_24 / ldap_mnesia / 4185838
Reports root/ big
OK: 1500 / Failed: 0 / User-skipped: 390 / Auto-skipped: 0


internal_mnesia_24 / internal_mnesia / 4185838
Reports root/ big
OK: 1541 / Failed: 0 / User-skipped: 349 / Auto-skipped: 0


pgsql_mnesia_23 / pgsql_mnesia / 4185838
Reports root/ big
OK: 3077 / Failed: 0 / User-skipped: 240 / Auto-skipped: 0


pgsql_mnesia_24 / pgsql_mnesia / 4185838
Reports root/ big
OK: 3077 / Failed: 0 / User-skipped: 240 / Auto-skipped: 0


mysql_redis_24 / mysql_redis / 4185838
Reports root/ big
OK: 3072 / Failed: 0 / User-skipped: 245 / Auto-skipped: 0


elasticsearch_and_cassandra_24 / elasticsearch_and_cassandra_mnesia / 4185838
Reports root/ big
OK: 1834 / Failed: 0 / User-skipped: 361 / Auto-skipped: 0


mssql_mnesia_24 / odbc_mssql_mnesia / 4185838
Reports root/ big
OK: 3077 / Failed: 0 / User-skipped: 240 / Auto-skipped: 0


riak_mnesia_24 / riak_mnesia / 4185838
Reports root/ big
OK: 1680 / Failed: 0 / User-skipped: 362 / Auto-skipped: 0

Copy link
Contributor

@gustawlippa gustawlippa left a comment

Choose a reason for hiding this comment

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

Adds a new useful hook. LGTM 👍

@gustawlippa gustawlippa merged commit 1f73b71 into master Jan 12, 2022
@gustawlippa gustawlippa deleted the mam_retractions branch January 12, 2022 15:04
@Premwoik Premwoik added this to the 5.1.0 milestone 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.

4 participants