-
Notifications
You must be signed in to change notification settings - Fork 68
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
ResetReapplyExcludeType (preparation for Update reapply) #348
ResetReapplyExcludeType (preparation for Update reapply) #348
Conversation
93058b2
to
324292f
Compare
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.
Why use exclusion in the api instead of inclusion with a default to apply all?
temporal.api.enums.v1.ResetReapplyType reset_reapply_type = 6; | ||
// Event types not to be reapplied | ||
repeated temporal.api.enums.v1.ResetReapplyExcludeType reset_reapply_exclude_types = 7; |
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.
repeated temporal.api.enums.v1.ResetReapplyExcludeType reset_reapply_exclude_types = 7; | |
repeated temporal.api.enums.v1.ResetReapplyType reset_reapply_types = 7; |
One wonders if this makes more sense, and it can be validated as mutually exclusive with the singular one. I fear we're going to later regret not letting you choose the types to reapply.
I agree that a pure inclusion-based API would be preferable. I'll push a second commit along those lines shortly. |
This reverts commit 91be2e8.
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.
After discussion, due to apply-all being default, exclusion list makes more sense.
We discussed this offline and concluded that exclusion semantics were best seeing as the default needs to be "all". I've included a commit implementing an inclusion variant, but reverted it. |
…5360) ## What changed? - Start honoring the new `reset_reapply_exclude_types` request field added in temporalio/api#348 - Change all reapply codepaths to specify excluded event types rather than included - Pass the set of excluded types further down the stack - Delete a pointless helper function ## Why? - We must honor the new request field because it is in the API and it is how we are going to control update reapply when we implement that - The previous code was not future-proof: there were various codepaths passing `enumspb.RESET_REAPPLY_TYPE_SIGNAL` to mean "reapply everything". This PR changes those codepaths to pass an empty set of exclusions, which is robust to future additions of new reappliable event types. - The actual work is done by `reapplyEvents`, and the excluded types had to be pushed all the way down the stack to this function. The previous code was pretty fragile: it checked that the caller had requested reapplication of signals and then let the downstream code reapply everything. ## How did you test it? - Unit tests ## Potential risks - It could break replication, and reset ## Is hotfix candidate? - No
…emporalio#5360) ## What changed? - Start honoring the new `reset_reapply_exclude_types` request field added in temporalio/api#348 - Change all reapply codepaths to specify excluded event types rather than included - Pass the set of excluded types further down the stack - Delete a pointless helper function ## Why? - We must honor the new request field because it is in the API and it is how we are going to control update reapply when we implement that - The previous code was not future-proof: there were various codepaths passing `enumspb.RESET_REAPPLY_TYPE_SIGNAL` to mean "reapply everything". This PR changes those codepaths to pass an empty set of exclusions, which is robust to future additions of new reappliable event types. - The actual work is done by `reapplyEvents`, and the excluded types had to be pushed all the way down the stack to this function. The previous code was pretty fragile: it checked that the caller had requested reapplication of signals and then let the downstream code reapply everything. ## How did you test it? - Unit tests ## Potential risks - It could break replication, and reset ## Is hotfix candidate? - No
These are proposed proto changes in preparation for Update reapply, based on a design by @yycptt.
Currently, the Reset request allows a user to send
RESET_REAPPLY_TYPE_SIGNAL
orRESET_REAPPLY_TYPE_NONE
. The server defaults toRESET_REAPPLY_TYPE_SIGNAL
.We are about to start reapplying Updates and, in the future, we may reapply other events such as Nexus-related events.
We do not want to expand the
ResetReapplyType
enum to encode arbitrary subsets of event types to be reapplied.Instead, this PR adds to the Reset request the ability to send a list of event types to be excluded from reapply.
I have also added one final value to the legacy enum:
RESET_REAPPLY_TYPE_ALL_ELIGIBLE
. I propose to make this the new default forResetReapplyType
. In practice, today, that has the same consequences (i.e. "reapply signals"), just under a different name.Other than that final addition,
ResetReapplyType
now becomes deprecated.Thus what I'm proposing is that, in the future, the server's implementation will be to:
ResetReapplyType
ResetReapplyExcludeType
eventsThe result is the set of event types that will be reapplied during Reset.