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

[markers] removals #3544

Merged
merged 5 commits into from
Feb 24, 2022
Merged

[markers] removals #3544

merged 5 commits into from
Feb 24, 2022

Conversation

NelsonVides
Copy link
Collaborator

This PR adds all the automatic removals, like the very important remove_domain (which requires changing the DB model), and also remove_user, forget_room, and removing a user from a room.

@mongoose-im

This comment was marked as outdated.

@mongoose-im

This comment was marked as outdated.

@codecov
Copy link

codecov bot commented Feb 15, 2022

Codecov Report

Merging #3544 (66595bd) into master (b4392ac) will increase coverage by 0.02%.
The diff coverage is 95.91%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3544      +/-   ##
==========================================
+ Coverage   79.23%   79.26%   +0.02%     
==========================================
  Files         421      421              
  Lines       32283    32307      +24     
==========================================
+ Hits        25581    25607      +26     
+ Misses       6702     6700       -2     
Impacted Files Coverage Δ
src/smart_markers/mod_smart_markers.erl 90.74% <90.00%> (-1.16%) ⬇️
src/smart_markers/mod_smart_markers_backend.erl 95.00% <100.00%> (+3.33%) ⬆️
src/smart_markers/mod_smart_markers_rdbms.erl 92.10% <100.00%> (-0.21%) ⬇️
src/mongoose_tcp_listener.erl 76.59% <0.00%> (-4.26%) ⬇️
src/rdbms/mongoose_rdbms.erl 62.17% <0.00%> (-1.13%) ⬇️
src/offline/mod_offline.erl 76.08% <0.00%> (-1.09%) ⬇️
src/mod_muc_log.erl 78.11% <0.00%> (ø)
src/mod_muc.erl 75.00% <0.00%> (+0.22%) ⬆️
src/mod_muc_room.erl 77.26% <0.00%> (+0.23%) ⬆️
src/pubsub/mod_pubsub_db_rdbms.erl 95.34% <0.00%> (+0.25%) ⬆️
... and 4 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 b4392ac...66595bd. Read the comment docs.

@mongoose-im

This comment was marked as outdated.

@NelsonVides NelsonVides changed the title Markers/removals [markers] removals Feb 15, 2022
@mongoose-im

This comment was marked as outdated.

@mongoose-im

This comment was marked as outdated.

@mongoose-im
Copy link
Collaborator

mongoose-im commented Feb 16, 2022

small_tests_24 / small_tests / 817f7cf
Reports root / small


small_tests_23 / small_tests / 817f7cf
Reports root / small


dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 817f7cf
Reports root/ big
OK: 2726 / Failed: 0 / User-skipped: 239 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_23 / pgsql_mnesia / 817f7cf
Reports root/ big
OK: 2726 / Failed: 0 / User-skipped: 239 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_24 / odbc_mssql_mnesia / 817f7cf
Reports root/ big
OK: 2726 / Failed: 0 / User-skipped: 239 / Auto-skipped: 0


dynamic_domains_mysql_redis_24 / mysql_redis / 817f7cf
Reports root/ big
OK: 2709 / Failed: 0 / User-skipped: 256 / Auto-skipped: 0


ldap_mnesia_24 / ldap_mnesia / 817f7cf
Reports root/ big
OK: 1509 / Failed: 0 / User-skipped: 392 / Auto-skipped: 0


ldap_mnesia_23 / ldap_mnesia / 817f7cf
Reports root/ big
OK: 1509 / Failed: 0 / User-skipped: 392 / Auto-skipped: 0


internal_mnesia_24 / internal_mnesia / 817f7cf
Reports root/ big
OK: 1550 / Failed: 0 / User-skipped: 351 / Auto-skipped: 0


mysql_redis_24 / mysql_redis / 817f7cf
Reports root/ big
OK: 3095 / Failed: 0 / User-skipped: 253 / Auto-skipped: 0


pgsql_mnesia_23 / pgsql_mnesia / 817f7cf
Reports root/ big
OK: 3100 / Failed: 0 / User-skipped: 248 / Auto-skipped: 0


elasticsearch_and_cassandra_24 / elasticsearch_and_cassandra_mnesia / 817f7cf
Reports root/ big
OK: 1843 / Failed: 0 / User-skipped: 367 / Auto-skipped: 0


mssql_mnesia_24 / odbc_mssql_mnesia / 817f7cf
Reports root/ big
OK: 3100 / Failed: 0 / User-skipped: 248 / Auto-skipped: 0


pgsql_mnesia_24 / pgsql_mnesia / 817f7cf
Reports root/ big
OK: 3100 / Failed: 0 / User-skipped: 248 / Auto-skipped: 0


riak_mnesia_24 / riak_mnesia / 817f7cf
Reports root/ big
OK: 1689 / Failed: 0 / User-skipped: 366 / Auto-skipped: 0

@NelsonVides
Copy link
Collaborator Author

Actually for this branch, I'm not sure if this goes to the feature branch or it it can go to master, it's fairly unrelated to any new behaviour, just adding all the removals that should have been there to begin with 🤔

@NelsonVides NelsonVides changed the base branch from feature/smart_markers to master February 17, 2022 09:48
thread => get_thread(Packet),
timestamp => TS,
type => undefined,
id => undefined},
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are these set here actually?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Performance: https://www.erlang.org/doc/efficiency_guide/maps.html
It's faster to create a map with all the keys it'll need and then modify its values, than to add keys to a map. Small maps are implemented as tuples, and adding keys to the map means having to copy the entire tuple with the keys again 😇

Copy link
Contributor

Choose a reason for hiding this comment

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

So I thought it was about performance 😄
It's a funny case, if the compiler was really clever, it could see what will happen with this map and expand it already...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OTP guys are very conservative about the compiler being too clever because it dirties tracing. They're only recently being more aggressive about optimising the jit compiler, more than the traditional interpreter.
Nevertheless I don't know what the compiler would do here, would be interesting to dump the assembly and see, but allow me to do that some other day xD

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, sure, just a thought. And I agree, that in some special cases, crazy debugging, it could be a nasty surprise to see some unexpected fields being added by who knows whom. xD

@mongoose-im
Copy link
Collaborator

mongoose-im commented Feb 24, 2022

small_tests_24 / small_tests / f83207a
Reports root / small


small_tests_23 / small_tests / f83207a
Reports root / small


dynamic_domains_mysql_redis_24 / mysql_redis / f83207a
Reports root/ big
OK: 2709 / Failed: 0 / User-skipped: 256 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_23 / pgsql_mnesia / f83207a
Reports root/ big
OK: 2726 / Failed: 0 / User-skipped: 239 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / f83207a
Reports root/ big
OK: 2726 / Failed: 0 / User-skipped: 239 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_24 / odbc_mssql_mnesia / f83207a
Reports root/ big
OK: 2740 / Failed: 3 / User-skipped: 239 / Auto-skipped: 0

vcard_SUITE:ro_full:retrieve_own_card
{error,{test_case_failed,"Expected <<\"alice\">> got undefined\n"}}

Report log

vcard_SUITE:ro_full:update_other_card
{error,{test_case_failed,"Expected <<\"alice\">> got undefined\n"}}

Report log

vcard_SUITE:ro_full:retrieve_others_card
{error,{test_case_failed,"Expected <<\"bob\">> got undefined\n"}}

Report log


ldap_mnesia_24 / ldap_mnesia / f83207a
Reports root/ big
OK: 1509 / Failed: 0 / User-skipped: 392 / Auto-skipped: 0


internal_mnesia_24 / internal_mnesia / f83207a
Reports root/ big
OK: 1550 / Failed: 0 / User-skipped: 351 / Auto-skipped: 0


pgsql_mnesia_23 / pgsql_mnesia / f83207a
Reports root/ big
OK: 3100 / Failed: 0 / User-skipped: 248 / Auto-skipped: 0


elasticsearch_and_cassandra_24 / elasticsearch_and_cassandra_mnesia / f83207a
Reports root/ big
OK: 1843 / Failed: 0 / User-skipped: 367 / Auto-skipped: 0


mysql_redis_24 / mysql_redis / f83207a
Reports root/ big
OK: 3095 / Failed: 0 / User-skipped: 253 / Auto-skipped: 0


mssql_mnesia_24 / odbc_mssql_mnesia / f83207a
Reports root/ big
OK: 3100 / Failed: 0 / User-skipped: 248 / Auto-skipped: 0


pgsql_mnesia_24 / pgsql_mnesia / f83207a
Reports root/ big
OK: 3100 / Failed: 0 / User-skipped: 248 / Auto-skipped: 0


riak_mnesia_24 / riak_mnesia / f83207a
Reports root/ big
OK: 1689 / Failed: 0 / User-skipped: 366 / Auto-skipped: 0

@mongoose-im
Copy link
Collaborator

mongoose-im commented Feb 24, 2022

small_tests_24 / small_tests / 66595bd
Reports root / small


small_tests_23 / small_tests / 66595bd
Reports root / small


dynamic_domains_pgsql_mnesia_23 / pgsql_mnesia / 66595bd
Reports root/ big
OK: 2727 / Failed: 0 / User-skipped: 239 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 66595bd
Reports root/ big
OK: 2727 / Failed: 0 / User-skipped: 239 / Auto-skipped: 0


dynamic_domains_mysql_redis_24 / mysql_redis / 66595bd
Reports root/ big
OK: 2710 / Failed: 0 / User-skipped: 256 / Auto-skipped: 0


ldap_mnesia_23 / ldap_mnesia / 66595bd
Reports root/ big
OK: 1510 / Failed: 0 / User-skipped: 392 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_24 / odbc_mssql_mnesia / 66595bd
Reports root/ big
OK: 2727 / Failed: 0 / User-skipped: 239 / Auto-skipped: 0


internal_mnesia_24 / internal_mnesia / 66595bd
Reports root/ big
OK: 1551 / Failed: 0 / User-skipped: 351 / Auto-skipped: 0


ldap_mnesia_24 / ldap_mnesia / 66595bd
Reports root/ big
OK: 1510 / Failed: 0 / User-skipped: 392 / Auto-skipped: 0


elasticsearch_and_cassandra_24 / elasticsearch_and_cassandra_mnesia / 66595bd
Reports root/ big
OK: 1685 / Failed: 0 / User-skipped: 371 / Auto-skipped: 0


pgsql_mnesia_23 / pgsql_mnesia / 66595bd
Reports root/ big
OK: 3101 / Failed: 0 / User-skipped: 248 / Auto-skipped: 0


pgsql_mnesia_24 / pgsql_mnesia / 66595bd
Reports root/ big
OK: 3101 / Failed: 0 / User-skipped: 248 / Auto-skipped: 0


mysql_redis_24 / mysql_redis / 66595bd
Reports root/ big
OK: 3096 / Failed: 0 / User-skipped: 253 / Auto-skipped: 0


mssql_mnesia_24 / odbc_mssql_mnesia / 66595bd
Reports root/ big
OK: 3101 / Failed: 0 / User-skipped: 248 / Auto-skipped: 0


riak_mnesia_24 / riak_mnesia / 66595bd
Reports root/ big
OK: 1690 / Failed: 0 / User-skipped: 366 / 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.

Looks good 👍

@gustawlippa gustawlippa merged commit d5301f8 into master Feb 24, 2022
@gustawlippa gustawlippa deleted the markers/removals branch February 24, 2022 11:43
@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.

None yet

5 participants