Skip to content

[FLINK-4113] [runtime] Always copy first value in ChainedAllReduceDriver#2156

Closed
greghogan wants to merge 2 commits intoapache:masterfrom
greghogan:4113_always_copy_first_value_in_chainedallreducedriver
Closed

[FLINK-4113] [runtime] Always copy first value in ChainedAllReduceDriver#2156
greghogan wants to merge 2 commits intoapache:masterfrom
greghogan:4113_always_copy_first_value_in_chainedallreducedriver

Conversation

@greghogan
Copy link
Contributor

No description provided.

base = objectReuseEnabled ? record : serializer.copy(record);
base = serializer.copy(record);
} else {
base = objectReuseEnabled ? reducer.reduce(base, record) : serializer.copy(reducer.reduce(base, record));
Copy link
Contributor

Choose a reason for hiding this comment

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

What if we return the record as the result of reducer.reduce (with objectReuseEnabled == true)? That would also be problematic, right?

Copy link
Contributor Author

@greghogan greghogan Jun 27, 2016

Choose a reason for hiding this comment

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

We fixed this in FLINK-3340 for non-chained reduce drivers (where the driver chooses the object to deserialize into) but for chained drivers we cannot prevent one UDF from overwriting an object from a previous UDF. If you look in OverwriteObjects.java you will see testReduce fail.

Copy link
Contributor

Choose a reason for hiding this comment

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

Alright. I guess users then have to live with that if they enable object reuse.

@tillrohrmann
Copy link
Contributor

Good fix @greghogan. We should definitely include it in the upcoming release. Would it be possible to write a test to guard the fix from future changes?

@greghogan greghogan force-pushed the 4113_always_copy_first_value_in_chainedallreducedriver branch from f5f162b to e9ee10e Compare June 27, 2016 16:48
@greghogan
Copy link
Contributor Author

@tillrohrmann just added a test for ChainedAllReduceDriver. I didn't see a way to build a lightweight test for chained drivers as we do with the unchained drivers.

@tillrohrmann
Copy link
Contributor

@greghogan the tests looks good. Thanks for your work :-) The failing test cases are unrelated. Will merge this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants