Projects tigase _server server-core Issues #769
Extract AMP repository schema to external file (#769)
Closed
wojciech.kapcia@tigase.net opened 8 years ago
Due Date
2017-04-05

In an effort to make all schema/stored procedures stored externally please process AMP Repository implementation (@tigase.server.amp.JDBCMsgRepository@)

Andrzej Wójcik (Tigase) commented 8 years ago

I've processed JDBCMsgRepository and JDBCMsgBroadcastRepository and now they are using stored procedures.

At the same time I changed database schemas so that tables are named with proper prefix tig_@, followed by functionality @id and actual table name - same way as it is done for other components (MUC, PubSub, MA, UA, HTTP Upload). Now we only have 3 tables which do not follow this convention:

  • short_news

  • xmpp_stanza

  • cluster_nodes

I wonder if we should not rename them as well as in 7.2.0 we do a lot of schema changes already.

I've tested new schema changes with JUnit tests which I created and they work fine, however to make better test we should have automatic schema load within tests (as I did in MA, UA, MUC, PubSub). But for now I'm not able to do so as in some cases it is not possible to rerun same schema file few times (files for 7.2.0 allow this).

%wojtek Please review my changes and if possible check if schema upgrade works properly - it worked in my cases (I've checked every database at least few times). Also please note that schema is still marked as 7.1 while it contains changes from 7.2.0 and it is no longer backward compatible with 7.1.x.

Artur Hefczyc commented 8 years ago
  • short_news can be removed. It will not be used anymore. And this reminds me, by the way, we can remove from Tigase XMPP Server code: StanzaReceiver and StanzaSender components.

  • xmpp_stanza - I do not even remember what this is for, maybe we can remove it as well

  • cluster_nodes - I agree, we should rename the table

Andrzej Wójcik (Tigase) commented 8 years ago

%kobit Thank you for your comments about listed tables. I created separate tasks #5149 and #5150

wojciech.kapcia@tigase.net commented 8 years ago

Haven't reviewed the changes yet but while trying to run the latest code (while working on another issue) I run into a problem

java -cp "jars/*" tigase.db.util.DBSchemaLoader -T mysql -U tigase -P tigase -F database/mysql-schema-7-2.sql

results in:

2017-04-04 12:28:53.786 [main]             DBSchemaLoader.loadSchemaFile()         FINEST:   Executing query: call TigUpgradeMsgHistory()
2017-04-04 12:28:53.790 [main]             DBSchemaLoader.loadSchemaFile()         SEVERE:   Failed to execute query: call TigUpgradeMsgHistory()
2017-04-04 12:28:53.791 [main]             DBSchemaLoader.loadSchemaFile()         WARNING:  Can't finalize: Table 'tigasedb.tig_offline_messages' doesn't exist

Please make sure that it's possible to load the schema.

Andrzej Wójcik (Tigase) commented 8 years ago

I've fixed issue which caused that it was not possible to apply schema to empty database. I checked schemas on every database which we support.

issue 1 of 1
Type
Task
Priority
Major
Assignee
RedmineID
4995
Version
tigase-server-8.0.0
Spent time
112h 30m
Issue Votes (0)
Watchers (0)
Reference
tigase/_server/server-core#769
Please wait...
Page is in error, reload to recover