Mycat Source code Modification MongoDB use problem record collection

Source: Internet
Author: User
Tags mongodb mongodb client

Mycat as a database middleware also has some problems, in the use of the process will inevitably encounter a variety of problems, based on this we will be related to the issue of a record for the FAQ to view. The following questions are proposed for MongoDB modification and use. MYCAT Official Issues List: Https://github.com/MyCATApache/Mycat-Server/issues
problem 0:mycat source code modified after the jar package replacement does not work


This problem is due to the fact that there are no more than one release versions of Mycat-server under/usr/local/mycat/lib, and if you need to back up, place them under another path.


problem 1:mycat Large batch query pending, recovery after all connections disconnected
This is a large data query, there is no response pending, client termination is useless. Details are subject to DBA collection logs.


Issue 2: Gateway write Mycat (normal), MySQL has the Times wrong
Fatal error encountered during command execution. ---> MySql.Data.MySqlClient.MySqlException (0x80004005): Fatal Error encountered attempting to read the resultset. ---> MySql.Data.MySqlClient.MySqlException (0x80004005): Reading from the stream has failed. ---> System.IO

. EndOfStreamException: Attempt to read content beyond the end of the stream.


WORKAROUND: It is recommended to set the MySQL write timeout longer.


Question 3: Other queries are normal why this query statement is not to find out the results


Note: We do not include keywords in the field, and some fields such as and, in, or, and so on, may cause an exception in conditional resolution.

WORKAROUND: Troubleshoot the conditions that follow the where, preferably not with keywords in the field.


Question 4: Condition or--or query is a wonderful thing, occasionally there are results most of the time is empty result set

The query with or condition returns the result set to NULL, or is a set condition, to see the operation of the MongoDB Shell:

Db.getcollection ("goods"). Find ({"$or": [{"User": "Jhon"}, {"owner": "Jhon"}]})
We are accustomed to a=1 or a=20 SQL statements, you must parse the conditions or to achieve, you may do the experiment. can refer to: http://blog.csdn.net/boonya/article/details/77530263

MongoDB Client Testing:

Db.getcollection (' t_subtable_date_20170801 '). Find ({"$or": [{"F_time": {"$gte": "2017-08-01 06:00:00", "$lte": " 2017-08-01 08:00:00 "}},{" F_sex ":" Female "}]});



MongoDB source code inside the support:

In most cases:

To appear occasionally:



Because of the instability, still try to avoid using or query.
Problem 5: Large data query manual stop causes MYCAT service paralysis not available "resolved"


Large data table or full table query: There is a problem with manual stop during the query (you can wait for the automatic timeout), after the Mycat service is maintained but in fact it has not been provided services, which is why the service is not connected to the survival of the reason, the bug handling method please refer to: Mycat issue 1616.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.