-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
RFC: public methods for Durabler
interface in reparentutil
#15544
Comments
Durabler
interface in reparentutil
Durabler
interface in reparentutil
The proposed approach from this RFC is implemented here: #15548. Thoughts appreciated! 🙇 |
/cc @GuptaManan100 |
I think this is a reasonable change. @deepthi Your thoughts? |
This is reasonable. Probably the initial thought process was that when vtorc was experimental we didn't really want to make the interface public, but now that we've been GA for 4 releases, it makes sense to open up to custom implementations. |
Feature Description
This RFC discusses a change to the
Durabler
interface fromreparentutil
(❤️ this feature) to make it easier to integrateI feel the private interface method names of the
Durabler
interface make it hard to write a custom durability policy whose logic is located outside of thereparentutil
packageAs a direct example, a POC durability policy I am working on is located in a separate repo to our Vitess fork so that it can persist across many Vitess major releases. We build each major release on a new branch from scratch so storing this logic outside makes things a bit cleaner
While the current interface CAN be integrated, to support a Durability Policy that is outside
reparentutil
, one must:reparentutil
(eg:PromotionRule
vspromotionRule
)reparentutil
to wrap the public method names with private method names (eg:promotionRule
->myimpl.PromotionRule
)func init()
usingRegisterDurability(...)
This PR illustrates the "shim"/wrapper I am mentioning: slackhq#266
This RFC proposes the interface is changed to this (all public methods):
An interface that allows public method names would allow users to skip wrapping their implementation in private methods, however this would be a major breaking change
In the end, a user in this scenario would still need a "shim" file in the
reparentutil
package, but it could be as short as:Use Case(s)
Users implementing custom durability policies that are located outside of the
reparentutil
package, which means the methods must be publicThe text was updated successfully, but these errors were encountered: