-
Notifications
You must be signed in to change notification settings - Fork 11.6k
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
Storage: Add mode reconciliation for modes 1 and 2 #87919
Conversation
@@ -32,18 +33,21 @@ type PlaylistAPIBuilder struct { | |||
namespacer request.NamespaceMapper | |||
gv schema.GroupVersion | |||
features featuremgmt.FeatureToggles | |||
kvStore *kvstore.NamespacedKVStore | |||
} | |||
|
|||
func RegisterAPIService(p playlistsvc.Service, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: have you checked if we can modify this signature to have the first argument be a context.Context
? I think it would require regenerating the wire files. In case it doesn't work:
- It may be because we don't yet have a wire provider return a
context.Context
. We could try to add a wire provider that provides acontext.Context
, simply returningcontext.Background()
for now. - In the worst case (e.g. if the above is too much work, or unrelated, etc.), we could just pass
context.Background()
toSetDualWritingMode
here.
The idea is that we push the need for a proper context.Context
as far above in dependencies as possible, so that when we take the step to properly providing a context.Context
the refactor is not so big.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review! That makes sense about pushing the need for the context.Context up. Ended up going with option 2 for now.
Co-authored-by: Dan Cech <dcech@grafana.com>
3c47edd
to
4490eda
Compare
pkg/apiserver/rest/dualwriter.go
Outdated
} | ||
} | ||
|
||
currentMode := toMode[m] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should probably make sure that toMode[m] exists and default to mode1 if it doesn't
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Added a check in dc147b9.
What is this feature?
Adds foundation for reconciling current dual writing mode with desired dual writing mode. In particular, adds support for setting current dual writing mode and reconciliation functionality to go from mode 1 to mode 2.
Why do we need this feature?
Required to implement proposal 4 in https://docs.google.com/document/d/1_FZ75QYoBqAW_7pC64fPN5GPUbHyRIWmemcO9SDhBJM/edit#heading=h.5sybau7waq2q
Who is this feature for?
US users, developers
Which issue(s) does this PR fix?:
Relates to https://github.com/grafana/search-and-storage-team/issues/16
Special notes for your reviewer:
Please check that: