This is an automated email from the ASF dual-hosted git repository.

lostluck pushed a commit to branch lostluck-idempotentSplit
in repository https://gitbox.apache.org/repos/asf/beam.git

commit 17f767498be4574e64d18850a265195dc5274da4
Author: Robert Burke <[email protected]>
AuthorDate: Tue Dec 17 13:39:01 2019 -0800

    [GoSDK] Make data channel splits idempotent
    
    In particular, if the split request includes the currently decided split 
index, return that instead of an error.
---
 sdks/go/pkg/beam/core/runtime/exec/datasource.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sdks/go/pkg/beam/core/runtime/exec/datasource.go 
b/sdks/go/pkg/beam/core/runtime/exec/datasource.go
index 60d2a8d..85f8bca 100644
--- a/sdks/go/pkg/beam/core/runtime/exec/datasource.go
+++ b/sdks/go/pkg/beam/core/runtime/exec/datasource.go
@@ -275,7 +275,7 @@ func (n *DataSource) Split(splits []int64, frac float32) 
(int64, error) {
        // the promised split index to this value.
        for _, s := range splits {
                // // Never split on the first element, or the current element.
-               if s > 0 && s > c && s < n.splitIdx {
+               if s > 0 && s > c && s <= n.splitIdx {
                        n.splitIdx = s
                        fs := n.splitIdx
                        n.mu.Unlock()

Reply via email to