-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-27216][CORE] Upgrade RoaringBitmap to 0.7.45 to fix Kryo unsafe ser/dser issue #24264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
||
| conf.set(KRYO_USE_UNSAFE, false) | ||
| val safeSer = new KryoSerializer(conf).newInstance() | ||
| var actual : RoaringBitmap = safeSer.deserialize(safeSer.serialize(expected)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I think the style checker will flag the space before the colon.
| } | ||
|
|
||
| test("SPARK-27216: Upgrade RoaringBitmap to 0.7.45 to fix Kryo unsafe ser/dser issue") { | ||
| val expected = new RoaringBitmap |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tiny nit: () after the constructor
|
Test build #4675 has finished for PR 24264 at commit
|
|
Rename for a better searching or tracing. |
| super.afterAll() | ||
| } | ||
|
|
||
| test("SPARK-27216: Upgrade RoaringBitmap to 0.7.45 to fix Kryo unsafe ser/dser issue") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move your test into KryoSerializerSuite where conf.set(KRYO_USE_UNSAFE, false) is given.
And as UnsafeKryoSerializerSuite is inherited from KryoSerializerSuite beside using conf.set(KRYO_USE_UNSAFE, true) in beforeAll() it will inherit your test method so both the safe/unsafe case will be tested this way: once executing KryoSerializerSuite and once UnsafeKryoSerializerSuite.
Summary: you do not need to test both cases in one test method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, thanks for this reminding.
|
Run |
| val expected = new RoaringBitmap() | ||
| expected.add(1787) | ||
|
|
||
| conf.set(KRYO_USE_UNSAFE, true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont' think this is what @attilapiros meant. I think he meant to (a) leave UnsafeKryoSerializerSuite as it was before and (b) add a new test which just tested serialization of RoaringBitmap with kryo in this class, but didn't tweak confs at all. That way you'd get a test for serializing with kryo.unsafe=false (here in KryoSerializerSuite) and you'd also automatically get a test with kryo.unsafe=true (inherited in UnsafeKryoSerializerSuite).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly. I was about to write a similar comment.
|
Uh... @attilapiros Is it proper now? |
|
@LantaoJin No.
|
|
Finally via |
|
You can revert the deletion by: But please double check the commit ID (my laptop used for developing Spark runs an OS update and this is my other machine...). |
Everything looks fine from my side. |
|
@attilapiros Oh, I read your comment again. I guess I have understood it. I will refactor it. |
|
@attilapiros What about it now? |
|
@LantaoJin Now your change is almost perfect. But as there was no need to import I have found this: spark/core/src/test/scala/org/apache/spark/serializer/KryoSerializerSuite.scala Lines 373 to 396 in 8cc3eb4
I think it is out-dated and this test can be removed as the statement |
|
I think it's out-dated. But it needs double check if we plan to merge this PR to multiple branches. |
|
As this change contradicts with that statement it is safe to remove that test. |
|
I've checked branch 2.1 and above. The kryo versions in them are all 3.0 or above. According to the description in SPARK-12222, it should be safe. I will remove it. |
|
Jenkins retest this please. |
|
lgtm assuming tests pass. Thanks for the work on this @LantaoJin & @attilapiros |
|
Test build #4679 has finished for PR 24264 at commit
|
|
You might want to consider upgrading directly to RoaringBitmap 0.8.0. We added |
|
@lemire I think that's a good idea for something to do eventually, but I think that can be handled separately. IIUC, to take advantage of those performance improvements, we need to change how we're serializing the RoaringBitmaps inside spark. This is a bug fix we can get in now. I filed https://issues.apache.org/jira/browse/SPARK-27367 for this if anybody wants to follow up with that |
|
I merged this to master, but there were merge conflicts going back farther. @LantaoJin would you like to open another pr, against branch 2.4 at least? |
…fix Kryo unsafe ser/dser issue ## What changes were proposed in this pull request? Back-port of #24264 to branch-2.4. HighlyCompressedMapStatus uses RoaringBitmap to record the empty blocks. But RoaringBitmap couldn't be ser/deser with unsafe KryoSerializer. It's a bug of RoaringBitmap-0.5.11 and fixed in latest version. ## How was this patch tested? Add a UT Closes #24290 from LantaoJin/SPARK-27216_BACKPORT-2.4. Authored-by: LantaoJin <[email protected]> Signed-off-by: Sean Owen <[email protected]>
…fix Kryo unsafe ser/dser issue ## What changes were proposed in this pull request? Back-port of #24264 to branch-2.3. HighlyCompressedMapStatus uses RoaringBitmap to record the empty blocks. But RoaringBitmap couldn't be ser/deser with unsafe KryoSerializer. It's a bug of RoaringBitmap-0.5.11 and fixed in latest version. ## How was this patch tested? Add a UT Closes #24291 from LantaoJin/SPARK-27216_BACKPORT-2.3. Authored-by: LantaoJin <[email protected]> Signed-off-by: Sean Owen <[email protected]>
…fix Kryo unsafe ser/dser issue ## What changes were proposed in this pull request? Back-port of apache#24264 to branch-2.4. HighlyCompressedMapStatus uses RoaringBitmap to record the empty blocks. But RoaringBitmap couldn't be ser/deser with unsafe KryoSerializer. It's a bug of RoaringBitmap-0.5.11 and fixed in latest version. ## How was this patch tested? Add a UT Closes apache#24290 from LantaoJin/SPARK-27216_BACKPORT-2.4. Authored-by: LantaoJin <[email protected]> Signed-off-by: Sean Owen <[email protected]>
…fix Kryo unsafe ser/dser issue ## What changes were proposed in this pull request? Back-port of apache#24264 to branch-2.4. HighlyCompressedMapStatus uses RoaringBitmap to record the empty blocks. But RoaringBitmap couldn't be ser/deser with unsafe KryoSerializer. It's a bug of RoaringBitmap-0.5.11 and fixed in latest version. ## How was this patch tested? Add a UT Closes apache#24290 from LantaoJin/SPARK-27216_BACKPORT-2.4. Authored-by: LantaoJin <[email protected]> Signed-off-by: Sean Owen <[email protected]>
…fix Kryo unsafe ser/dser issue ## What changes were proposed in this pull request? Back-port of apache#24264 to branch-2.4. HighlyCompressedMapStatus uses RoaringBitmap to record the empty blocks. But RoaringBitmap couldn't be ser/deser with unsafe KryoSerializer. It's a bug of RoaringBitmap-0.5.11 and fixed in latest version. ## How was this patch tested? Add a UT Closes apache#24290 from LantaoJin/SPARK-27216_BACKPORT-2.4. Authored-by: LantaoJin <[email protected]> Signed-off-by: Sean Owen <[email protected]>
What changes were proposed in this pull request?
HighlyCompressedMapStatus uses RoaringBitmap to record the empty blocks. But RoaringBitmap couldn't be ser/deser with unsafe KryoSerializer.
It's a bug of RoaringBitmap-0.5.11 and fixed in latest version.
This is an update of #24157
How was this patch tested?
Add a UT