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

[DB] Add NoCatchup field to Job db model #3129

Merged
merged 3 commits into from
Feb 20, 2020

Conversation

Bobgy
Copy link
Contributor

@Bobgy Bobgy commented Feb 20, 2020

/assign @IronPan
/assign @jingzhang36

Part of #3055

Recommend hiding whitespace difference when reviewing, because there seems to be some format inconsistency.


This change is Reviewable

@@ -23,6 +23,7 @@ type Job struct {
Namespace string `gorm:"column:Namespace; not null;"`
Description string `gorm:"column:Description; not null"`
MaxConcurrency int64 `gorm:"column:MaxConcurrency;not null"`
NoCatchup bool `gorm:"column:NoCatchup; not null"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Just want to double check on how mysql handles this schema change. When the new column is added, the existing rows don't have value for this column. Since the column is said to be not null, what would be the default value be used or upgrade doesn't go through?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good point. I think default value will be false, but I'm not sure, let me double check on a real db.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

mysql> select Name, NoCatchup from jobs;
+-----------------------------+-----------+
| Name                        | NoCatchup |
+-----------------------------+-----------+
| periodic-catchup-falsehtrd9 |         0 |
| cron-catchup-true6km84      |         0 |
| periodic-catchup-truezcwhs  |         0 |
| periodic-catchup-falsefd272 |         0 |
| catchupfalsesslv8           |         0 |
| cron-catchup-falsemx58x     |         0 |
| periodic-catchup-true-znwf8 |         0 |
| catchuptruec9vr6            |         0 |
| periodic-catchup-truekdq5d  |         0 |
| cron-catchup-falsefcpdl     |         0 |
| periodic-catchup-truenn4qr  |         0 |
| cron-catchup-true6qxdq      |         0 |
+-----------------------------+-----------+
12 rows in set (0.00 sec)

Looks like it's correct, this column will be auto populated with false, so it matches backward compatible behavior.

@jingzhang36
Copy link
Contributor

Only a nit question inline.
/lgtm
/approve

@Bobgy
Copy link
Contributor Author

Bobgy commented Feb 20, 2020

@jingzhang36 thanks!

/hold
until I tested db backfill behavior

@Bobgy
Copy link
Contributor Author

Bobgy commented Feb 20, 2020

/approve
for the cloudbuild yaml added

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Bobgy, jingzhang36

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

@Bobgy
Copy link
Contributor Author

Bobgy commented Feb 20, 2020

/retest
/hold cancel
Verified this works well in a real cluster.

@IronPan
Copy link
Member

IronPan commented Feb 20, 2020

/lgtm

@Bobgy
Copy link
Contributor Author

Bobgy commented Feb 20, 2020

/retest

@k8s-ci-robot k8s-ci-robot merged commit 5c54904 into kubeflow:master Feb 20, 2020
@Bobgy Bobgy deleted the be_swf_catchup_db branch February 21, 2020 01:09
Jeffwan pushed a commit to Jeffwan/pipelines that referenced this pull request Dec 9, 2020
* Add noCatchup field to Job db model

* Add scheduledworkflow cloudbuild yaml to facilitate local testing

* Add no catchup to api converter too
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.

4 participants