thegooglecodearchive / mycheckpoint

Automatically exported from code.google.com/p/mycheckpoint
0 stars 1 forks source link

Wrong connection used in function get_custom_query_ids #12

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use a different monitoring host then write host
2. Run mycheckpoint <parameters> -v
3. Mysql-problem: (1146, "Table 'mycheckpoint.custom_query_view' doesn't exist")

What is the expected output? Full creation of 58 tables in database 
mycheckpoint_HOST
What do you see instead? Only 5 tables are created, python script stops after 
that one.

What version of the mycheckpoint are you using? revision 174
What version of the MySQL are you using?  5.1.37
On what operating system? SLES 11

I think the problem is the use of the wrong connection-parameter in the 
get_rows call (no connection is defined so it uses the monitor-connection. For 
this query, it should use the write_conn instead). Problem was fixed when 
replacing:
query = """SELECT custom_query_id, chart_name FROM %s.custom_query_view""" % 
database_name
rows = get_rows(query) 
with:
query = """SELECT custom_query_id, chart_name FROM %s.custom_query_view""" % 
database_name
rows = get_rows(query,write_conn)

Also, I think it is strange that no parameters can be defined for the user and 
password on the monitored mysql database. Now it needs to be the same one of 
both servers...

Original issue reported on code.google.com by barty.de...@gmail.com on 13 Aug 2010 at 9:53

GoogleCodeExporter commented 9 years ago
Thanks for the report. Will look more closely a couple of days ahead.
The issue of monitored user-password is not new; I'll consider adding this as 
option.

Original comment by shlomi.n...@gmail.com on 14 Aug 2010 at 1:03

GoogleCodeExporter commented 9 years ago
Your diagnosis is correct. The problem with using the read-connection is that:
1. If there is master-slave relationship between write host and monitored host 
- the slave may not get the view created so fast
2. If there isn;t such relationship... well, the monitored host just won't get 
it...

I'll add a fix in the next revision.

Original comment by shlomi.n...@gmail.com on 16 Aug 2010 at 7:13

GoogleCodeExporter commented 9 years ago
Fixed in r188 (not yet released)
Expect a release in the next couple of weeks.

Original comment by shlomi.n...@gmail.com on 18 Aug 2010 at 7:42

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
With regards to:
"...Also, I think it is strange that no parameters can be defined for the user 
and password on the monitored mysql database. Now it needs to be the same one 
of both servers..."
I have created Issue 15: a feature request for adding these parameters. Work in 
on the way.

Original comment by shlomi.n...@gmail.com on 22 Aug 2010 at 6:15