lostluck commented on code in PR #17386:
URL: https://github.com/apache/beam/pull/17386#discussion_r859200270
##########
sdks/go/pkg/beam/core/runtime/exec/datasource.go:
##########
@@ -320,6 +321,73 @@ func (n *DataSource) Progress() ProgressReportSnapshot {
return ProgressReportSnapshot{ID: n.SID.PtransformID, Name: n.Name,
Count: c, pcol: pcol}
}
+func (n *DataSource) getProcessContinuation() sdf.ProcessContinuation {
+ if u, ok := n.Out.(*ProcessSizedElementsAndRestrictions); ok {
Review Comment:
Consider adding a comment here that current support requires the SDF to be
immediately after the datasource node. This is true for most runners (it's
easiest to reason about), but it's not a requirement of the model. See also how
we could theoretically support multiple Datasources in a single bundled, but in
practice, that never happens....
##########
sdks/go/pkg/beam/core/runtime/harness/harness.go:
##########
@@ -401,21 +402,47 @@ func (c *control) handleInstruction(ctx context.Context,
req *fnpb.InstructionRe
c.plans[bdID] = append(c.plans[bdID], plan)
}
}
+
+ // Check if the underlying DoFn self-checkpointed.
+ sr, delay, checkpointed, checkErr := plan.Checkpoint()
+
+ var rRoots []*fnpb.DelayedBundleApplication
+ if checkpointed {
+ rRoots = make([]*fnpb.DelayedBundleApplication,
len(sr.RS))
+ for i, r := range sr.RS {
+ rRoots[i] = &fnpb.DelayedBundleApplication{
+ Application: &fnpb.BundleApplication{
+ TransformId: sr.TId,
+ InputId: sr.InId,
+ Element: r,
+ OutputWatermarks: sr.OW,
+ },
+ RequestedTimeDelay:
durationpb.New(delay),
+ }
+ }
+ }
+
delete(c.active, instID)
if removed, ok := c.inactive.Insert(instID); ok {
delete(c.failed, removed) // Also GC old failed bundles.
}
delete(c.metStore, instID)
+
c.mu.Unlock()
if err != nil {
return fail(ctx, instID, "process bundle failed for
instruction %v using plan %v : %v", instID, bdID, err)
}
+ if checkErr != nil {
+ return fail(ctx, instID, "process bundle failed for
instruction %v using plan %v : %v", instID, bdID, checkErr)
Review Comment:
Consider making it explicit that this error happened while checkpointing.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]