Skip to content

Commit

Permalink
fix: correct mis-reporting of missing
Browse files Browse the repository at this point in the history
  • Loading branch information
alexec committed Sep 28, 2021
1 parent 7e5ce44 commit ebf38e6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions runner/sidecar/monitor/impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,8 @@ func (i *impl) Accept(ctx context.Context, sourceName, sourceURN string, partiti
}
if offset > expectedOffset {
missingCounter.WithLabelValues(sourceName).Inc()
} else {
i.db[key] = offset
}
i.db[key] = offset
return true, nil
}

Expand Down
2 changes: 1 addition & 1 deletion runner/sidecar/monitor/impl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func Test_impl_Accept(t *testing.T) {
})
thirtyDays := time.Hour * 24 * 30
rdb.On("Set", ctx, "my-pl/my-step/my-urn/1/offset", int64(1), thirtyDays).Return(nil)
rdb.On("Set", ctx, "my-pl/my-step/my-urn/2/offset", int64(2), thirtyDays).Return(nil)
rdb.On("Set", ctx, "my-pl/my-step/my-urn/2/offset", int64(4), thirtyDays).Return(nil)
t.Run("CommitOffsets", func(t *testing.T) {
i.commitOffsets(ctx)
})
Expand Down

0 comments on commit ebf38e6

Please sign in to comment.