Fixed first/last_indexed, improved import perf, support for mariadb connector #4108
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
VuFind 10 includes a PR that modifies
UpdateDateTracker.java
to avoid a deprecated method. After we started using that in prod, our galera cluster crashed. Disablingfirst
/last_indexed
fixed it. We are guessing galera could not keep up with the frequent statement creations during import.This PR reverts the
UpdateDateTracker
PR. Thefinalize()
code could have been simply removed, becauseDatabaseManager
closes the database connection and hence the statements on shutdown.It also improves performance by sending db updates by batch. This required changing
DatabaseManager
to call the shutdown inUpdateDateTracker
before the connection is closed, otherwise the statements could not have been used reliably to finish sending db data by batch. When thechange_tracker
table is empty and only database inserts are used, import performance was improved by 30% in a test.Sending batches is done a bit differently in mysql and mariadb. We are using mariadb, so I had to add specific support for mariadb, and include the mariadb JDBC connector. In PHP code the mysql driver can be used, but support for the
mariadb
connection string is needed.NOTE 1: this change will require mariadb users to change their config to use
mariadb
as the database driver (or in the connection string). If they don't do it,firt
/last_indexed
import might fail with a syntax error.NOTE 2: this code has only been tested with mariadb so far, but it also changes execution for mysql and postgres.