Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Datasource should validate the keys in the SQL proc file #20

Closed
edmorley opened this issue Jan 24, 2015 · 0 comments
Closed

Datasource should validate the keys in the SQL proc file #20

edmorley opened this issue Jan 24, 2015 · 0 comments

Comments

@edmorley
Copy link
Contributor

In https://bugzilla.mozilla.org/show_bug.cgi?id=1125464#c8 it was found that we were using the master_host for everything, even though we had thought we had specified read_host for the appropriate selects in the SQL proc file.

Unfortunately it turned out we were using the property 'host' rather than 'host_type'., eg:

"get_performance_series": {

    "sql":"SELECT `interval_seconds`, `series_signature`, `type`, `last_updated`, `blob`
           FROM `performance_series`
           WHERE `interval_seconds` = ? AND `series_signature` = ?",

    "host":"read_host"

},

This issue would have been much easier to spot, if Datasource validated the keys and rejected any that it did not recognise.

Alternatively, if that is not something you wish to do - having a way to opt out of the default_host_type would mean we could catch any cases where we were not explicitly passing the desired host_type (possibly a good feature in its own right).

edmorley pushed a commit to mozilla/treeherder that referenced this issue Jan 24, 2015
The 'host' property is unrecognised (and ignored) by Datasource, causing
it to silently fall back to the default of 'master_host'. The property
we needed to have set is in fact called 'host_type'.

As a result, we never use the read-only host!

An issue has been filed against Datasource for making this less silent:
jeads/datasource#20
edmorley pushed a commit to mozilla/treeherder that referenced this issue Jan 24, 2015
The 'host' property is unrecognised (and ignored) by Datasource, causing
it to silently fall back to the default of 'master_host'. The property
we needed to have set is in fact called 'host_type'.

As a result, we never use the read-only host!

An issue has been filed against Datasource for making this less silent:
jeads/datasource#20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant