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(onboard): remove extra multiplication of RP to avoid overflow #19885

Merged
merged 5 commits into from
Nov 3, 2020

Conversation

danxmoran
Copy link
Contributor

@danxmoran danxmoran commented Nov 2, 2020

Closes #19884

(As debugged by @stuartcarnie) Retention policies in onboarding requests are already proper time.Durations, so multiplying by an extra time.Hour factor causes the values to be incorrect and potentially overflow.

  • CHANGELOG.md updated with a link to the PR (not the Issue)
  • Well-formatted commit messages
  • Rebased/mergeable
  • Tests pass
  • http/swagger.yml updated (if modified Go structs or API)
  • Feature flagged (if modified API)
  • Documentation updated or issue created (provide link to issue/pr)
  • Signed CLA (if not already signed)

Copy link
Contributor

@stuartcarnie stuartcarnie left a comment

Choose a reason for hiding this comment

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

Great work, @danxmoran and 💯 for adding tests!

@stuartcarnie stuartcarnie added the area/2.x OSS 2.0 related issues and PRs label Nov 2, 2020
@stuartcarnie
Copy link
Contributor

@danxmoran you will need to update the onboarding unit tests:

service_onboarding_test.go:44: Onboarding: true
        onboarding.go:223: onboarding results are different -got/+want
            diff   (*influxdb.OnboardingResults)(
            - 	&{
            - 		User: &influxdb.User{ID: s"068ec83bbb042000", Name: "admin", Status: "active"},
            - 		Org: &influxdb.Organization{
            - 			ID:   s"7e98146b111fe339",
            - 			Name: "org1",
            - 			CRUDLog: influxdb.CRUDLog{
            - 				CreatedAt: s"2020-11-02 22:46:03.821569357 +0"...,
            - 				UpdatedAt: s"2020-11-02 22:46:03.821569544 +0"...,
            - 			},
            - 		},
            - 		Bucket: &influxdb.Bucket{
            - 			ID:              s"d218c3d8c079ca59",
            - 			OrgID:           s"7e98146b111fe339",
            - 			Name:            "bucket1",
            - 			RetentionPeriod: s"168ns",
            - 			CRUDLog: influxdb.CRUDLog{
            - 				CreatedAt: s"2020-11-02 22:46:03.821641188 +0"...,
            - 				UpdatedAt: s"2020-11-02 22:46:03.821641264 +0"...,
            - 			},
            - 		},
            - 		Auth: &influxdb.Authorization{
            - 			ID:          s"068ec83bcb7ad000",
            - 			Token:       "hA1O0tWXCHxSXdxqu0I25sDw4SEPlwayKmx0mpI833CZpGC2WAIcydbE95ANXnvM"...,
            - 			Status:      "active",
            - 			Description: "admin's Token",
            - 			OrgID:       s"7e98146b111fe339",
            - 			UserID:      s"068ec83bbb042000",
            - 			Permissions: []influxdb.Permission{
            - 				s"read:authorizations", s"write:authorizations", s"read:buckets",
            - 				s"write:buckets", ...,
            - 			},
            - 			CRUDLog: influxdb.CRUDLog{
            - 				CreatedAt: s"2020-11-02 22:46:03.821670074 +0"...,
            - 				UpdatedAt: s"2020-11-02 22:46:03.821670074 +0"...,
            - 			},
            - 		},
            - 	},

@stuartcarnie stuartcarnie self-requested a review November 2, 2020 22:58
@danxmoran
Copy link
Contributor Author

Note to self: Need to update CHANGELOG as well

@danxmoran danxmoran force-pushed the dm-onboard-rp-passthrough-19884 branch from 09f9b19 to 7dac4d7 Compare November 3, 2020 15:08
DB-side services no longer multiply requested RPs by time.Hour, so
the upgrade command shouldn't divide by that factor.
@danxmoran danxmoran requested a review from dgnorton November 3, 2020 16:31
@danxmoran danxmoran merged commit 428a46b into master Nov 3, 2020
@danxmoran danxmoran deleted the dm-onboard-rp-passthrough-19884 branch November 3, 2020 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/2.x OSS 2.0 related issues and PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"influx setup" against v2.0.0-rc.3 fails validation for non-infinite retention period
3 participants