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

Migrate to reset reapply event type exclusions instead of inclusions #5360

Merged
merged 4 commits into from
Mar 12, 2024

Conversation

dandavison
Copy link
Contributor

What changed?

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

@dandavison dandavison mentioned this pull request Jan 29, 2024
@dandavison dandavison force-pushed the oss-2147-reapply-types-prep branch 2 times, most recently from 9a35ddf to 48e0147 Compare February 2, 2024 12:49
@dandavison dandavison force-pushed the oss-2147-reapply-types-prep branch 4 times, most recently from 2170deb to 6a37404 Compare February 20, 2024 17:07
@dandavison dandavison force-pushed the oss-2147-reapply-types-prep branch 2 times, most recently from 13a1f43 to a180aea Compare March 12, 2024 12:56
@dandavison dandavison marked this pull request as ready for review March 12, 2024 12:56
@dandavison dandavison requested a review from a team as a code owner March 12, 2024 12:56
@dandavison dandavison force-pushed the oss-2147-reapply-types-prep branch from a180aea to 0a5bd90 Compare March 12, 2024 13:05
@dandavison dandavison merged commit 069e2de into main Mar 12, 2024
42 checks passed
@dandavison dandavison deleted the oss-2147-reapply-types-prep branch March 12, 2024 23:45
stephanos pushed a commit to stephanos/temporal that referenced this pull request Mar 21, 2024
…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
dandavison added a commit that referenced this pull request Apr 9, 2024
## What changed?
Revert change to default enum value made in #5360

## Why?
We cannot deploy a change that both introduces a new value and starts
using it as the default, since during rollout it may cause a frontend
client on the new version to send a value that is unknown to a history
node on the old version.

## How did you test it?
I didn't

## Potential risks
No risk

## Is hotfix candidate?
This change should be cherry-picked onto current release candidates.
dnr pushed a commit that referenced this pull request Apr 9, 2024
## What changed?
Revert change to default enum value made in #5360

## Why?
We cannot deploy a change that both introduces a new value and starts
using it as the default, since during rollout it may cause a frontend
client on the new version to send a value that is unknown to a history
node on the old version.

## How did you test it?
I didn't

## Potential risks
No risk

## Is hotfix candidate?
This change should be cherry-picked onto current release candidates.
dandavison added a commit that referenced this pull request Sep 25, 2024
## What changed?
Change default `ResetReapply` enum value to `ALL_ELIGIBLE`.

## Why?
Reverts #5688, i.e. after this PR we will have the
behavior described in #5360.
This means both signals *and* updates will be reapplied by default
during resets and coinflict resolution, which is the product behavior we
want.

### Explanation
- #5360 attempted to introduce a new proto enum value and start using it
as the default
- However, that is not a valid single-deploy change, since it can cause
a frontend client on the new version to send a value that is unknown to
a history node on the old version.
- Therefore #5688 reverted the change to the default, allowing the new
proto enum value to be introduced to the codebase
- This PR is deployable iff all clusters that we deploy to have #5360
deployed


## How did you test it?
I didn't. Tests were added in the original PR
#5360.

## Potential risks
Could break reset or history conflict resolution.

## Is hotfix candidate?
1.25.1
jmbarzee pushed a commit that referenced this pull request Sep 27, 2024
Change default `ResetReapply` enum value to `ALL_ELIGIBLE`.

Reverts #5688, i.e. after this PR we will have the
behavior described in #5360.
This means both signals *and* updates will be reapplied by default
during resets and coinflict resolution, which is the product behavior we
want.

- #5360 attempted to introduce a new proto enum value and start using it
as the default
- However, that is not a valid single-deploy change, since it can cause
a frontend client on the new version to send a value that is unknown to
a history node on the old version.
- Therefore #5688 reverted the change to the default, allowing the new
proto enum value to be introduced to the codebase
- This PR is deployable iff all clusters that we deploy to have #5360
deployed

I didn't. Tests were added in the original PR
#5360.

Could break reset or history conflict resolution.

1.25.1
dnr pushed a commit that referenced this pull request Oct 4, 2024
Change default `ResetReapply` enum value to `ALL_ELIGIBLE`.

Reverts #5688, i.e. after this PR we will have the
behavior described in #5360.
This means both signals *and* updates will be reapplied by default
during resets and coinflict resolution, which is the product behavior we
want.

- #5360 attempted to introduce a new proto enum value and start using it
as the default
- However, that is not a valid single-deploy change, since it can cause
a frontend client on the new version to send a value that is unknown to
a history node on the old version.
- Therefore #5688 reverted the change to the default, allowing the new
proto enum value to be introduced to the codebase
- This PR is deployable iff all clusters that we deploy to have #5360
deployed

I didn't. Tests were added in the original PR
#5360.

Could break reset or history conflict resolution.

1.25.1
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