Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[misc] using maxscale 2.2.2
  • Loading branch information
rusher committed Mar 7, 2018
1 parent 0989045 commit daaf8a1
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -47,5 +47,5 @@ env:
- DB=mariadb:10.2 PACKET=40M TYPE=NO_BULK_SERVER
- DB=mariadb:10.2 PACKET=40M COMPRESSION=true
- DB=mariadb:10.3 PACKET=8M
- DB=mariadb:10.2 PACKET=8M MAXSCALE_VERSION=2.1.8
- DB=mariadb:10.2 PACKET=8M MAXSCALE_VERSION=2.2.2
script: .travis/script.sh
2 changes: 1 addition & 1 deletion .travis/maxscale/docker-entrypoint.sh
Expand Up @@ -28,7 +28,7 @@ echo 'maxscale launching ...'

tail -n 500 /etc/maxscale.cnf

/usr/bin/maxscale --nodaemon
/usr/bin/maxscale --user=root --nodaemon

cd /var/log/maxscale
ls -lrt
Expand Down
42 changes: 21 additions & 21 deletions .travis/maxscale/maxscale.cnf
Expand Up @@ -23,7 +23,7 @@ log_debug=1
type=server
address=db
port=3306
protocol=MySQLBackend
protocol=MariaDBBackend
authenticator_options=skip_authentication=true
router_options=master

Expand All @@ -33,9 +33,9 @@ router_options=master
# MySQL Monitor documentation:
# https://github.com/mariadb-corporation/MaxScale/blob/2.1/Documentation/Monitors/MySQL-Monitor.md

[MySQL Monitor]
[MySQLMonitor]
type=monitor
module=mysqlmon
module=mariadbmon
servers=server1
user=boby
passwd=hey
Expand All @@ -50,7 +50,7 @@ monitor_interval=10000
# ReadConnRoute documentation:
# https://github.com/mariadb-corporation/MaxScale/blob/2.1/Documentation/Routers/ReadConnRoute.md

[Read-Only Service]
[Read-OnlyService]
enable_root_user=1
version_string=10.2.99-MariaDB-maxScale
type=service
Expand All @@ -61,7 +61,7 @@ passwd=hey
router_options=slave
localhost_match_wildcard_host=1

[Read-Write Service]
[Read-WriteService]
enable_root_user=1
version_string=10.2.99-MariaDB-maxScale
type=service
Expand All @@ -71,7 +71,7 @@ user=boby
passwd=hey
localhost_match_wildcard_host=1

[Write Service]
[WriteService]
type=service
router=readconnroute
servers=server1
Expand All @@ -86,7 +86,7 @@ version_string=10.2.99-MariaDB-maxscale
# MaxScale administration guide:
# https://github.com/mariadb-corporation/MaxScale/blob/2.1/Documentation/Reference/MaxAdmin.mda

[MaxAdmin Service]
[MaxAdminService]
enable_root_user=1
version_string=10.2.99-MariaDB-maxScale
type=service
Expand All @@ -97,29 +97,29 @@ router=cli
# These listeners represent the ports the
# services will listen on.
#
[Write Listener]
[WriteListener]
type=listener
service=Write Service
protocol=MySQLClient
service=WriteService
protocol=MariaDBClient
port=4007
socket=/var/lib/maxscale/writeconn.sock
#socket=/var/lib/maxscale/writeconn.sock

[Read-Only Listener]
[Read-OnlyListener]
type=listener
service=Read-Only Service
protocol=MySQLClient
service=Read-OnlyService
protocol=MariaDBClient
port=4008
socket=/var/lib/maxscale/readconn.sock
#socket=/var/lib/maxscale/readconn.sock

[Read-Write Listener]
[Read-WriteListener]
type=listener
service=Read-Write Service
protocol=MySQLClient
service=Read-WriteService
protocol=MariaDBClient
port=4006
socket=/var/lib/maxscale/rwsplit.sock
#socket=/var/lib/maxscale/rwsplit.sock

[MaxAdmin Listener]
[MaxAdminListener]
type=listener
service=MaxAdmin Service
service=MaxAdminService
protocol=maxscaled
socket=/tmp/maxadmin.sock
4 changes: 4 additions & 0 deletions src/test/java/org/mariadb/jdbc/PooledConnectionTest.java
Expand Up @@ -52,6 +52,7 @@

package org.mariadb.jdbc;

import org.junit.Assume;
import org.junit.Test;

import javax.sql.ConnectionPoolDataSource;
Expand Down Expand Up @@ -87,6 +88,8 @@ public void testPooledConnectionClosed() throws Exception {

@Test(expected = SQLException.class)
public void testPooledConnectionException() throws Exception {
Assume.assumeTrue(System.getenv("MAXSCALE_VERSION") == null);

ConnectionPoolDataSource ds = new MariaDbDataSource(hostname != null ? hostname : "localhost", port, database);
PooledConnection pc = null;
try {
Expand All @@ -104,6 +107,7 @@ public void testPooledConnectionException() throws Exception {

/* Try to read after server side closed the connection */
connection.createStatement().execute("SELECT 1");

fail("should never get there");
} finally {
if (pc != null) pc.close();
Expand Down

0 comments on commit daaf8a1

Please sign in to comment.