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

Fix storelogs #222

Merged
merged 2 commits into from
Oct 24, 2018
Merged

Fix storelogs #222

merged 2 commits into from
Oct 24, 2018

Conversation

toshiiw
Copy link
Contributor

@toshiiw toshiiw commented Oct 23, 2018

This PR ensures worker logs are stored correctly.
Also tweak DB table definitions for consistency.


This change is Reviewable

@YujiOshima
Copy link
Contributor

@toshiiw Thanks!
related to #220
/ok-to-test

// in worker_metrics.
rows, err := d.db.Query(
"SELECT worker_lastlogs.time, name, value FROM worker_lastlogs "+
"LEFT JOIN worker_metrics ON (worker_lastlogs.worker_id = worker_metrics.worker_id AND worker_lastlogs.time = worker_metrics.time) "+
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not using ` to make a multiple line string?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

The function has been storing into worker_metrics with duplicates and
wrong timestamps for some time. The fix changes the worker_lastlogs
DB table definition. DBs must be recreated.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
name VARCHAR(255),
value TEXT,
is_objective TINYINT,
FOREIGN KEY (worker_id) REFERENCES workers(id) ON DELETE CASCADE)`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you replace " + to ` on other tables?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My idea was to minimize the size of diff. It might be better to tidy all the things now. Just a sec.

…tting

This patch make sure worker_* rows have matching row in the worker table.
Also changes multi-line string formatting for readability.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
@YujiOshima
Copy link
Contributor

@toshiiw Great, Thanks!
/lgtm
/approve

@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: YujiOshima

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 106235b into kubeflow:master Oct 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants