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

Update feature gate logging to include default on #4029

Merged
merged 6 commits into from
Dec 3, 2024

Conversation

benjaminjb
Copy link
Contributor

Checklist:

  • Have you added an explanation of what your changes do and why you'd like them to be included?
  • Have you updated or added documentation for the change, as applicable?
  • Have you tested your changes on all related environments with successful results, as applicable?
    • Have you added automated tests?

Type of Changes:

  • New feature
  • Bug fix
  • Documentation
  • Testing enhancement
  • Other

What is the current behavior (link to any open issues here)?

After the 5.7 release, when AutoUserSchemaCreate was graduated to default on/true, we discovered that our current system (and the underlying featuregate implementation) treats features explicitly turned on by the user differently than features turned on by default.

What is the new behavior (if this is a feature change)?

  • Breaking change (fix or feature that would cause existing functionality to change)

This PR updates that logging to make clear that the features are those specifically requested by the user (kept as a string to help debugging) and revises the 'ShowGates' function to include those set through defaults.

Other Information:

Issues: [PGO-1824]

After the 5.7 release, when AutoUserSchemaCreate was graduated to
default on/true, we discovered that our current system (and the
underlying featuregate implementation) treats features explicitly
turned on by the user differently than features turned on by default.

This PR updates that logging to make clear that the features are those
specifically requested by the user (kept as a string to help debugging)
and revises the 'ShowGates' function to include those set through defaults.

Issues: [PGO-1824]
@benjaminjb benjaminjb requested a review from cbandy November 5, 2024 22:36
Copy link
Member

@cbandy cbandy left a comment

Choose a reason for hiding this comment

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

The implementation is good, but I've soured on some of the naming. I misunderstood what "String" did, and now want better method names.

I can do the work of renaming a bunch of things if you're ready to be done with this PR.

internal/feature/features.go Outdated Show resolved Hide resolved
internal/feature/features.go Outdated Show resolved Hide resolved
internal/feature/features.go Outdated Show resolved Hide resolved
internal/feature/features.go Outdated Show resolved Hide resolved
internal/feature/features.go Outdated Show resolved Hide resolved
internal/feature/features_test.go Outdated Show resolved Hide resolved
internal/feature/features_test.go Outdated Show resolved Hide resolved
@@ -69,7 +69,7 @@ func TestCheckForUpgrades(t *testing.T) {
assert.Equal(t, data.RegistrationToken, "speakFriend")
assert.Equal(t, data.BridgeClustersTotal, 2)
assert.Equal(t, data.PGOClustersTotal, 2)
assert.Equal(t, data.FeatureGatesEnabled, "TablespaceVolumes=true")
assert.Equal(t, data.FeatureGatesEnabled, "AutoCreateUserSchema=true,TablespaceVolumes=true")
Copy link
Member

Choose a reason for hiding this comment

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

👍🏻 This isn't Contains, but I don't mind seeing the format. 🌱 We can change the test if it is ever a problem.

internal/feature/features.go Outdated Show resolved Hide resolved
Copy link
Member

@cbandy cbandy left a comment

Choose a reason for hiding this comment

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

LGTM. Please squash.

cmd/postgres-operator/main.go Outdated Show resolved Hide resolved
benjaminjb and others added 2 commits December 3, 2024 07:43
@benjaminjb benjaminjb merged commit 12c8207 into main Dec 3, 2024
17 checks passed
@benjaminjb benjaminjb deleted the update-feature-gate-logging branch December 3, 2024 16:18
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

Successfully merging this pull request may close these issues.

2 participants