Skip to content

Commit

Permalink
Test with MariaDB 10.3
Browse files Browse the repository at this point in the history
Fixes #471.
  • Loading branch information
Yunera authored and adamchainz committed May 27, 2018
1 parent 62e9ef2 commit 4913f4d
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 6 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -22,6 +22,7 @@ env:
- DB=mariadb DB_VERSION=10.0
- DB=mariadb DB_VERSION=10.1
- DB=mariadb DB_VERSION=10.2
- DB=mariadb DB_VERSION=10.3

before_script: .travis/before_script.sh

Expand Down
2 changes: 1 addition & 1 deletion .travis/before_script.sh
Expand Up @@ -36,7 +36,7 @@ Pin: origin sfo1.mirrors.digitalocean.com
Pin-Priority: 10000' | sudo tee /etc/apt/preferences.d/pin-mariadb.pref
sudo apt-get update
PACKAGES="mariadb-server mariadb-client"
if [[ $DB_VERSION != '10.2' ]]
if [[ $DB_VERSION < '10.2' ]]
then
PACKAGES="$PACKAGES libmariadbclient-dev"
fi
Expand Down
6 changes: 6 additions & 0 deletions HISTORY.rst
Expand Up @@ -8,6 +8,12 @@ Pending

.. Insert new release notes below this line
* Started testing with MariaDB 10.3.

* Changed ``GlobalStatus.wait_until_load_low()`` to increase the default number
of allowed running threads from 5 to 10, to account for the new default
threads in MariaDB 10.3.

* Added ``encoder`` and ``decoder`` arguments to ``JSONField`` for customizing
the way JSON is encoded and decoded from the database.

Expand Down
2 changes: 1 addition & 1 deletion django_mysql/status.py
Expand Up @@ -89,7 +89,7 @@ class GlobalStatus(BaseStatus):

def wait_until_load_low(self, thresholds=None, timeout=60.0, sleep=0.1):
if thresholds is None:
thresholds = {'Threads_running': 5}
thresholds = {'Threads_running': 10}

start = time.time()
names = thresholds.keys()
Expand Down
2 changes: 1 addition & 1 deletion docs/installation.rst
Expand Up @@ -9,7 +9,7 @@ Tested with all combinations of:

* Python: 2.7, 3.6
* Django: 1.8, 1.9, 1.10, 1.11, 2.0
* MySQL: 5.6, 5.7 / MariaDB: 10.0, 10.1, 10.2
* MySQL: 5.6, 5.7 / MariaDB: 10.0, 10.1, 10.2, 10.3
* mysqlclient: 1.3 (Python 3 compatible version of ``MySQL-python``)

Any combination of these should be good, and also ``MySQL-python`` should work
Expand Down
6 changes: 3 additions & 3 deletions docs/status.rst
Expand Up @@ -78,7 +78,7 @@ The following can all be imported from ``django_mysql.status``.

Uses the same type-casting strategy as ``get()``.

.. method:: wait_until_load_low(thresholds={'Threads_running': 5}, \
.. method:: wait_until_load_low(thresholds={'Threads_running': 10}, \
timeout=60.0, sleep=0.1)

A helper method similar to the logic in ``pt-online-schema-change`` for
Expand All @@ -89,9 +89,9 @@ The following can all be imported from ``django_mysql.status``.
:class:`django_mysql.exceptions.TimeoutError` if this does not occur
within ``timeout`` seconds. Set ``timeout`` to 0 to never time out.

``thresholds`` defaults to ``{'Threads_running': 5}``, which is the
``thresholds`` defaults to ``{'Threads_running': 10}``, which is the
default variable used in ``pt-online-schema-change``, but with a lower
threshold of 5 that is more suitable for small servers. You will very
threshold of 10 that is more suitable for small servers. You will very
probably need to tweak it to your server.

You can use this method during large background operations which you
Expand Down

0 comments on commit 4913f4d

Please sign in to comment.