Skip to content

System parameter maxCon is invalid after a connection failure #838

@FlyingMao

Description

@FlyingMao
  • dble version:
    5.6.29-dble-9.9.9.9-c53c3f7-20181116022818
  • preconditions :
    no
  • configs:

schema.xml

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE dble:schema SYSTEM "schema.dtd"><dble:schema xmlns:dble="http://dble.cloud/">
	<schema dataNode="dn5" name="mytest" sqlMaxLimit="100">
		<table dataNode="dn1,dn2,dn3,dn4" name="test" type="global" />
	</schema>

	<dataNode dataHost="172.100.9.5" database="db1" name="dn1" />
	<dataNode dataHost="172.100.9.6" database="db1" name="dn2" />
	<dataNode dataHost="172.100.9.5" database="db2" name="dn3" />
	<dataNode dataHost="172.100.9.6" database="db2" name="dn4" />
	<dataNode dataHost="172.100.9.5" database="db3" name="dn5" />

	<dataHost balance="0" maxCon="1000" minCon="10" name="172.100.9.5" slaveThreshold="100" switchType="1">
		<heartbeat>select user()</heartbeat>
		<writeHost host="hostM1" password="111111" url="172.100.9.5:3306" user="test">
		</writeHost>
	</dataHost>

	<dataHost balance="0" maxCon="1000" minCon="10" name="172.100.9.6" slaveThreshold="100" switchType="1">
		<heartbeat>select user()</heartbeat>
		<writeHost host="hostM2" password="111111" url="172.100.9.6:3306" user="test">
		</writeHost>
	</dataHost>
	
</dble:schema>

rule.xml

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE dble:rule SYSTEM "rule.dtd"><dble:rule xmlns:dble="http://dble.cloud/">
	<tableRule name="hash-two">
        <rule>
            <columns>id</columns>
            <algorithm>two-long</algorithm>
        </rule>
    </tableRule>
    <tableRule name="hash-three">
        <rule>
            <columns>id</columns>
            <algorithm>three-long</algorithm>
        </rule>
    </tableRule>
	<tableRule name="hash-four">
        <rule>
            <columns>id</columns>
            <algorithm>four-long</algorithm>
        </rule>
    </tableRule>
    <function class="Hash" name="two-long">
        <property name="partitionCount">2</property>
        <property name="partitionLength">1</property>
    </function>
    <function class="Hash" name="three-long">
        <property name="partitionCount">3</property>
        <property name="partitionLength">1</property>
    </function>
	<function class="Hash" name="four-long">
		<property name="partitionCount">4</property>
		<property name="partitionLength">1</property>
	</function>
</dble:rule>


server.xml

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE dble:server SYSTEM "server.dtd">
<dble:server xmlns:dble="http://dble.cloud/">
	<system>
     <property name="defaultSqlParser">druidparser</property>
<property name="useGlobleTableCheck">1</property>
<property name="processors">1</property>
     <property name="processorExecutor">1</property>
     <property name="maxCon">1</property>
</system>

<user name="root">
     <property name="password">111111</property>
     <property name="manager">true</property>
</user>
<user name="test">
     <property name="password">test</property>
     <property name="schemas">mytest</property>
     <property name="maxCon">1</property>
</user>
<user name="action">
     <property name="password">action</property>
     <property name="schemas">mytest</property>
     <property name="readOnly">true</property>
     <property name="maxCon">1</property>
</user>

  • steps:
    step1. Do not close the connection after connecting to the client using the test user
[root@10-186-24-44 dble]# mysql -utest -ptest -h127.0.0.1 -P8066
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.6.29-dble-9.9.9.9-c53c3f7-20181116022818 dble Server (ActionTech)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 

step2. connect to the client using the test user

[root@10-186-24-44 dble]# mysql -utest -ptest -h127.0.0.1 -P8066
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)

step3. connect to the client using the action user

[root@10-186-24-44 logs]# mysql -uaction -paction -h127.0.0.1 -P8066
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.6.29-dble-9.9.9.9-c53c3f7-20181116022818 dble Server (ActionTech)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 

  • expect result:
    1. step3: Connection failed
  • real result:
    1. step3: Connection successed
  • supplements:
    1.

/label ~BUG

Metadata

Metadata

Assignees

Labels

from auto_testresolveproblem has been fixed by developerverifiedissue's resolve was verified by tester

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions