temporalio / temporalio/temporal
Task Predicate Equivalence Check
@yycptt is already working on this.
Since Jun 14, 2022.
- Dominant language
- Go
- Stars
- 23.2k
- Forks
- 1.9k
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 228
Description
Is your feature request related to a problem? Please describe.
-
https://github.com/temporalio/temporal/pull/2988 added Predicate.Equals() which checks if two predicates have the same form and value. Since the check won't try to re-arrange the predicates (especially when and/or/not operations are involved), the result will contains false negatives even if mathematically two predicates are equivalent.
-
At current stage we think ^ check is sufficient as 1. in most cases our predicates are quite simple and should be equal even when form is taken into consideration 2. When false negatives are returned we will simply not merge (attach) two queue slices and there's no cost for correctness and performance. (All it costs is some additional storage costs for storing an additional queue slice scope data, which is negligible)
-
If in the future it turns out that we always have a large number of queue slices, we may want to implement a real equivalence check for predicates so that more queue slices can be merged together.
-
Creating this issue to track that this is something we can improve in the future.
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.