Skip to content

Commit 17cad7d

Browse files
committed
Address the reviewer feedback.
1 parent 471708b commit 17cad7d

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

sdks/go/pkg/beam/runners/prism/internal/engine/elementmanager.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,7 +1153,7 @@ type stageState struct {
11531153
input mtime.Time // input watermark for the parallel input.
11541154
output mtime.Time // Output watermark for the whole stage
11551155
estimatedOutput mtime.Time // Estimated watermark output from DoFns
1156-
preRefreshedInput mtime.Time // input watermark before the last watermark refresh
1156+
previousInput mtime.Time // input watermark before the latest watermark refresh
11571157

11581158
pending elementHeap // pending input elements for this stage that are to be processesd
11591159
inprogress map[string]elements // inprogress elements by active bundles, keyed by bundle
@@ -2015,7 +2015,7 @@ func (ss *stageState) updateWatermarks(em *ElementManager) set[string] {
20152015
newIn = minPending
20162016
}
20172017

2018-
ss.preRefreshedInput = ss.input
2018+
ss.previousInput = ss.input
20192019

20202020
// If bigger, advance the input watermark.
20212021
if newIn > ss.input {
@@ -2174,13 +2174,14 @@ func (ss *stageState) bundleReady(em *ElementManager, emNow mtime.Time) (mtime.T
21742174
ptimeEventsReady := ss.processingTimeTimers.Peek() <= emNow || emNow == mtime.MaxTimestamp
21752175
injectedReady := len(ss.bundlesToInject) > 0
21762176

2177-
// If the upstream watermark, the input watermark, and the input watermark before the last refresh are the same,
2178-
// then we can't yet process this stage.
2177+
// If the upstream watermark does not change, we can't yet process this stage.
2178+
// To check whether upstream water is unchanged, we evaluate if the input watermark, and
2179+
// the input watermark before the latest refresh are the same.
21792180
inputW := ss.input
21802181
_, upstreamW := ss.UpstreamWatermark()
2181-
preRefreshInputW := ss.preRefreshedInput
2182-
if inputW == upstreamW && preRefreshInputW == inputW {
2183-
slog.Debug("bundleReady: unchanged upstream/input watermark",
2182+
previousInputW := ss.previousInput
2183+
if inputW == upstreamW && previousInputW == inputW {
2184+
slog.Debug("bundleReady: unchanged upstream watermark",
21842185
slog.String("stage", ss.ID),
21852186
slog.Group("watermark",
21862187
slog.Any("upstream", upstreamW),

0 commit comments

Comments
 (0)