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

Rebase #3398 #3954

Merged
merged 7 commits into from
Apr 13, 2023
Merged

Rebase #3398 #3954

merged 7 commits into from
Apr 13, 2023

Conversation

LizardWizzard
Copy link
Contributor

Rebased version of #3398, fixed surrounding code to use strum methods instead of our own as_str.

@LizardWizzard LizardWizzard requested review from a team as code owners April 5, 2023 09:37
@LizardWizzard LizardWizzard requested review from save-buffer and hlinnaka and removed request for a team April 5, 2023 09:37
@github-actions
Copy link

github-actions bot commented Apr 5, 2023

Test results for e1296b4:


debug build: 212 tests run: 202 passed, 0 failed, 10 (full report)


release build: 212 tests run: 202 passed, 0 failed, 10 (full report)


@LizardWizzard LizardWizzard marked this pull request as draft April 5, 2023 11:22
@LizardWizzard LizardWizzard marked this pull request as ready for review April 5, 2023 11:31
@LizardWizzard
Copy link
Contributor Author

Note that PR changes tenant state to be serialized as snake case. Previously we've used snake case for metrics and Camel case for API. I followed the metrics reference because I'd like to keep compatibility with alerts.

Can revert this change though and change alerts.

Copy link
Member

@koivunej koivunej left a comment

Choose a reason for hiding this comment

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

Some comments, wrote these while reviewing and now going to find myself an related issue to learn why we want the backtraces.

libs/pageserver_api/src/models.rs Outdated Show resolved Hide resolved
pageserver/src/tenant.rs Outdated Show resolved Hide resolved
pageserver/src/tenant.rs Outdated Show resolved Hide resolved
libs/pageserver_api/src/models.rs Show resolved Hide resolved
Copy link
Contributor

@SomeoneToIgnore SomeoneToIgnore left a comment

Choose a reason for hiding this comment

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

I'm somewhat concerned about the state case change (Active -> active, etc.) which already had caused python e2e tests to fail.
Is console code and infra (periodic broken tenant checks at least?) good with this change?

I wonder, if we could somehow adjust the enum name representation via strum?
Otherwise looks better than I thought after seeing strum 🙂

libs/pageserver_api/src/models.rs Show resolved Hide resolved
@LizardWizzard
Copy link
Contributor Author

Is console code and infra (periodic broken tenant checks at least?) good with this change?

I'm not aware of any external references to tenant state names besides metrics. I can revert this change, it feels controversial. In that case we'll need to change alerts to refer to Broken instead of broken for example

@LizardWizzard
Copy link
Contributor Author

Moved to #3977 to clean up some things in tests first.

@LizardWizzard LizardWizzard force-pushed the dkr/broken-reason branch 3 times, most recently from 76103c7 to 9b914cb Compare April 7, 2023 18:04
@LizardWizzard
Copy link
Contributor Author

I wonder, if we could somehow adjust the enum name representation via strum?

The problem is that we use different representations. Serde/http api uses Camel case, and metrics uses snake case that is handwritten. Strum supports global renaming, but to maintain compatibility we need two different ways. It can be done if needed (with a few extra allocations on metrics path).

To the best of my knowledge there is only one dashboard that depends on names of tenant state reported via metrics, so I went ahead and changed metrics repr to use camel case as the rest of the places too. Will change a dashboard once the PR is merged.

@LizardWizzard
Copy link
Contributor Author

Getting this error from console e2e test that triggers migration:

"message":"tenant status returned error: json: cannot unmarshal object into Go struct field TenantInfo.state of type string"

I think it should be the only usage, so I think I'll just remove the state from response in the spec. It can be added back if needed.

@SomeoneToIgnore wdyt?

Backward compatibility with API is ensured by custom
serialization with Display trait with strum

Refactor TenantState usage to use Clone (#3001)

Use reason in TenantState (#3001)

Use strum dependency in pageserver (#3001)

Add test for TenantInfo serde (#3001)

Test debug formatting for TenantInfo (#3001)
@LizardWizzard LizardWizzard merged commit 15d1f85 into main Apr 13, 2023
@LizardWizzard LizardWizzard deleted the dkr/broken-reason branch April 13, 2023 09:11
@LizardWizzard LizardWizzard added the /manual_release_instructions Requires to add some manual staff after releasing label Apr 13, 2023
@koivunej koivunej mentioned this pull request Apr 26, 2023
11 tasks
@vadim2404 vadim2404 mentioned this pull request Apr 28, 2023
11 tasks
@arssher arssher mentioned this pull request Apr 30, 2023
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
/manual_release_instructions Requires to add some manual staff after releasing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants