-
Notifications
You must be signed in to change notification settings - Fork 428
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
Refactor PubSub code to prepare for RDBMS #2122
Conversation
This comment has been minimized.
This comment has been minimized.
Codecov Report
@@ Coverage Diff @@
## master #2122 +/- ##
==========================================
- Coverage 76.9% 75.05% -1.86%
==========================================
Files 323 323
Lines 28116 28105 -11
==========================================
- Hits 21624 21095 -529
- Misses 6492 7010 +518
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me overall. I had only 2 comments to the code.
-callback del_state(Nidx :: mod_pubsub:nodeIdx(), | ||
UserLJID :: jid:ljid()) -> ok. | ||
LJID :: jid:ljid()) -> ok. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If other callbacks expect jid:jid
type, can we make this one consistent with the other and expect jid:jid
as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, because it is called only in one place, where only ljid()
is accessible directly so I'd have to convert it to jid()
. This function will be removed anyway as soon as pubsub_item
table is migrated to RDBMS as well.
This comment has been minimized.
This comment has been minimized.
I have improved the error reporting but I don't have any tests for them for now, as it is pretty urgent to move on to RDBMS implementation. However, here is a sample from provoked crash (I've added line breaks):
|
5827.1 / Erlang 19.3 / small_tests / 8df0240 5827.5 / Erlang 19.3 / ldap_mnesia / 8df0240 5827.3 / Erlang 19.3 / mysql_redis / 8df0240 5827.6 / Erlang 19.3 / elasticsearch_and_cassandra_mnesia / 8df0240 5827.2 / Erlang 19.3 / internal_mnesia / 8df0240 5827.4 / Erlang 19.3 / odbc_mssql_mnesia / 8df0240 5827.8 / Erlang 20.0 / pgsql_mnesia / 8df0240 5827.9 / Erlang 21.0 / riak_mnesia / 8df0240 |
For some reason travis didn't change the check status from pending to success. It's all green on travis. |
This PR refactors DB calls, mostly in
node_flat
, to be more efficient for future RDBMS backend. Causes more Mnesia operations but Mnesia backend should probably be rewritten or deprecated anyway.