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

chore: patch instead of update and bugfix #2059

Merged
merged 3 commits into from
Sep 14, 2024
Merged

Conversation

whynowy
Copy link
Member

@whynowy whynowy commented Sep 13, 2024

Closes: #2054

  1. Patch instead of update for finalizers change to avoid some of the fields getting updated unexpectedly (e.g. cpu: 2000m is updated to cpu: 2)
  2. Use explicit spec change to patch for pipeline pause/resume, scale replicas, etc.
  3. Fixed a bug for pipeline vertex, that every time there's a spec change, it updates the replica to min.
  4. Fixed a corner case bug, that somehow replicas goes to 0 (might have manually scaled to 0, or some weird testing case), and updateHash != currentHash, it then it gets stuck.

@@ -236,6 +236,8 @@ func (mr *monoVertexReconciler) orchestratePods(ctx context.Context, monoVtx *df
monoVtx.Status.CurrentHash = monoVtx.Status.UpdateHash
} else { // Update scenario
if updatedReplicas >= desiredReplicas {
monoVtx.Status.UpdatedReplicas = uint32(desiredReplicas)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixing 4.)

@@ -259,6 +259,8 @@ func (r *vertexReconciler) orchestratePods(ctx context.Context, vertex *dfv1.Ver
vertex.Status.CurrentHash = vertex.Status.UpdateHash
} else { // Update scenario
if updatedReplicas >= desiredReplicas {
vertex.Status.UpdatedReplicas = uint32(desiredReplicas)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixing 4.)

Copy link

codecov bot commented Sep 13, 2024

Codecov Report

Attention: Patch coverage is 23.07692% with 20 lines in your changes missing coverage. Please review.

Project coverage is 63.38%. Comparing base (49b733e) to head (e18b8d3).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
pkg/reconciler/isbsvc/controller.go 0.00% 7 Missing ⚠️
pkg/reconciler/pipeline/controller.go 54.54% 3 Missing and 2 partials ⚠️
pkg/reconciler/monovertex/controller.go 0.00% 2 Missing ⚠️
pkg/reconciler/monovertex/scaling/scaling.go 0.00% 2 Missing ⚠️
pkg/reconciler/vertex/controller.go 0.00% 2 Missing ⚠️
pkg/reconciler/vertex/scaling/scaling.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2059      +/-   ##
==========================================
+ Coverage   63.11%   63.38%   +0.26%     
==========================================
  Files         319      319              
  Lines       29180    29253      +73     
==========================================
+ Hits        18416    18541     +125     
+ Misses       9750     9695      -55     
- Partials     1014     1017       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

.
Signed-off-by: Derek Wang <[email protected]>
@@ -292,7 +295,9 @@ func (r *pipelineReconciler) reconcileFixedResources(ctx context.Context, pl *df
r.recorder.Eventf(pl, corev1.EventTypeNormal, "CreateVertexSuccess", "Created vertex %s successfully", vertexName)
} else {
if oldObj.GetAnnotations()[dfv1.KeyHash] != newObj.GetAnnotations()[dfv1.KeyHash] { // need to update
originalReplicas := oldObj.Spec.Replicas
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixing 3.)

@whynowy whynowy marked this pull request as ready for review September 13, 2024 07:05
@whynowy whynowy requested a review from vigith as a code owner September 13, 2024 07:05
@vigith vigith requested a review from kohlisid September 13, 2024 22:58
if old == nil {
return true
func needsToPatchFinalizers(old, new *dfv1.InterStepBufferService) bool {
if old == nil { // This is a weird scenario, nothing we can do. Theoretically it will never happen.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since it is a weird scenario should be log so it might help whoever is debugging?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cleaned it up since there's no need to add this function.

@@ -51,6 +51,8 @@ import (

const (
finalizerName = dfv1.ControllerPipeline

pauseTimestampPath = `/metadata/annotations/numaflow.numaproj.io~1pause-timestamp`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

~1 what does that mean?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Signed-off-by: Derek Wang <[email protected]>
@whynowy whynowy enabled auto-merge (squash) September 14, 2024 05:36
@whynowy whynowy merged commit 910ff9b into numaproj:main Sep 14, 2024
25 checks passed
@whynowy whynowy deleted the patchhh branch September 14, 2024 06:18
whynowy added a commit that referenced this pull request Sep 26, 2024
SaniyaKalamkar pushed a commit to SaniyaKalamkar/numaflow that referenced this pull request Jan 19, 2025
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.

Using patch instead of update
2 participants