[MDEV-4368] Client hangs when using an imported MySQL database with wrong ownership Created: 2013-04-04 Updated: 2022-09-08 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 10.0.1, 5.5.30 |
| Fix Version/s: | 5.5 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Mark Trutter (Inactive) | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | database-import, table-name-completion | ||
| Environment: |
OpenSuse 12.3 64bit using the standard repository's MariaDB package version 5.5.29 |
||
| Attachments: |
|
| Description |
|
I have imported a Mysql-database from a remote Mysql-server. For that purpose I've created an empty database of the respective name locally and then copied the database files to /var/lib/mysql/DATABASENAME using rsync (This works perfectly in MySQL). Reading table information for completion of table and column names Doing so, that is starting the client with the -A option I have no problem and can query the database. Connecting to the database via jdbc (using the mysql-java-connector) my program hangs as well and here I don't have the -A option I'm not sure whether this way of importing a Mysql database is supported by MariaDB-MySQL compatibility, but since the remote MySQL server doesn't support mysql-dump I don't have another option. ##### (The source is a public mysql server at ucsc for bioinformatics) |
| Comments |
| Comment by Elena Stepanova [ 2013-04-04 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi Mark, Not sure which version of MySQL database you imported the schema from, but it requires mysql_upgrade (which is normally the case when you do upgrade or crossgrade between different versions). in the error log, but it all goes away after I run mysql_upgrade. Please try it out. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Mark Trutter (Inactive) [ 2013-04-04 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi Elena, The server version of the public Mysql-server at ucsc is 5.0.45. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2013-04-04 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Mark, Could you please quote the server error log since the server start and to the end (including the period when you ran mysql_upgrade and tried to connect to the database)? Thanks | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Mark Trutter (Inactive) [ 2013-04-04 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
So, I stopped the server and deleted var/log/mysql/mysqld.log to reset it. 130404 16:21:15 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Mark Trutter (Inactive) [ 2013-04-04 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I've done a couple of more tests. On the other hand it is a fact that MySQL itself can work on the table without an error and MariaDB can work on the table with option -A (without apparent problems). | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Mark Trutter (Inactive) [ 2013-04-04 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
One correction to the last comment: MariaDB cannot work on the deficient | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2013-04-04 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
What happens if you do CHECK TABLE refGene ? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Mark Trutter (Inactive) [ 2013-04-04 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I think we're coming closer:
/var/lib/mysql/hg19/refGene.frm is there and its size is identical to ensGene.frm (9131). | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Mark Trutter (Inactive) [ 2013-04-04 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
OK this is definitely not a bug of the database system in the strict sense of the word since the error is primarily on the side of the datahere. Nevertheless this error might be useful to improve MariaDB's handling of faulty database tables. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Mark Trutter (Inactive) [ 2013-04-04 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
It might be a good idea to mirror the refGene table to a machine of yours (as described above). Since refGene is a widely used database in bioinformatics I assume that the faulty data-source will be corrected very soon. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2013-04-04 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
>> It might be a good idea to mirror the refGene table to a machine of yours (as described above). I did it from the start, and I observed the behavior that you described, but the problem went away after I changed the permissions on the table and ran mysql_upgrade. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Mark Trutter (Inactive) [ 2013-04-05 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
You're right, actually I hadn't changed permissions of the files which is probably why repairing with mysql_upgrade hasn't worked out for me Still I think that it might be a nice improvement of the database system if it would return with an error-message instead of hanging. The faulty table has been corrected on the remote server in the meantime. Thanks a lot for your very nice support !!! | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2013-04-05 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I agree, it was confusing, and it still seems to be a bug, although not critical since there is an external reason and a good workaround. 1. When you attempt to use this database, what looks like a hanging is actually an endless loop – we can see that the error log keeps getting new messages server uses as much cpu as it can get and memory footprint also grows The process is in checking table stage
---
--- Obviously all of that shouldn't be happening, the server doesn't need to loop over the broken table. Instead, it should check it once and (at least) throw the error which it produces if we forcefully kill the thread checking the table: 130405 16:42:57 [Warning] Checking table: './hg19/refGene' 2. The error message in the error log could be much clearer. The server is able to detect the reason of the problem, we can see it in the CHECK TABLE output: MariaDB [test]> check table hg19.refGene;
-------------
------------- Errcode 13 is 'Permission denied', so it should be a good clue. REPAIR TABLE diagnostics is not bad either: MariaDB [test]> repair table hg19.refGene;
-------------
------------- But the error log only keeps saying "is marked as crashed and should be repaired". | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2013-04-05 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
To reproduce:
Not reproducible on MySQL (tried 5.5, 5.6). |