Skip to content

Conversation

@pwendell
Copy link
Contributor

By default Snappy uses java.io.tempdir for copying the Snappy native library.
If two users run Spark jobs on the same machine it can cause an exception when
the second user tries to access or overwrite the snappy file created by the
first user. This will fail Spark jobs out-of-the-box if they are run on a
machine shared by different users.

Snappy does expose a mechanism to customize the temp directory via a system
property. This system property is read in a static block inside of Snappy code.

Snappy-java fixes this in newer versions. We can upgrade snappy-java in master
but this proposes a "best effort" fix for 1.1 where we try to set the system
property in a static block before Snappy reads it. I've tested it and it does
work, but it relies on static initialization order which is brittle. I.e.
if user code accesses Snappy libraries first this could not-work.

An alternative work-around for users is to explicitly set

org.xerial.snappy.tempdir

themselves through Spark's java options. I also filed a bug upstream with
Snappy-java to ask them for better behavior here:

xerial/snappy-java#84

I think this is worth merging because in many cases it will fix the issue and
at worst it's a no-op.

By default Snappy uses java.io.tempdir for copying the Snappy native library.
If two users run Spark jobs on the same machine it can cause an exception when
the second user tries to access or overwrite the snappy file created by the
first user. This will fail Spark jobs out-of-the-box if they are run on a
machine shared by different users.

Snappy does expose a mechanism to customize the temp directory via a system
property. This system property is read in a static block inside of Snappy code.

I've added a "best effort" fix for this where we try to set the system
property in a static block before Snappy reads it. I've tested it and it does
work, but it relies on static initialization order which is brittle. I.e.
if user code accesses Snappy libraries first this could not-work.

An alternative work-around for users is to explicitly set

    org.xerial.snappy.tempdir

themselves through Spark's java options. I also filed a bug upstream with
Snappy-java to ask them for better behavior here:

xerial/snappy-java#84

I think this is worth merging because in many cases it will fix the issue and
at worst it's a no-op.
pwendell added a commit to pwendell/spark that referenced this pull request Aug 17, 2014
This upgrades snappy-java which fixes the issue reported in SPARK-2881.
This is the master branch equivalemnt to apache#1994 which provides a different
work-around for the 1.1 branch.
@pwendell
Copy link
Contributor Author

I'm closing this in favor of #1999

@pwendell pwendell closed this Aug 17, 2014
asfgit pushed a commit that referenced this pull request Aug 18, 2014
This upgrades snappy-java which fixes the issue reported in SPARK-2881.
This is the master branch equivalent to #1994 which provides a different
work-around for the 1.1 branch.

Author: Patrick Wendell <[email protected]>

Closes #1995 from pwendell/snappy-1.1 and squashes the following commits:

0c7c4c2 [Patrick Wendell] SPARK-2881. Upgrade snappy-java to 1.1.1.3.
xiliu82 pushed a commit to xiliu82/spark that referenced this pull request Sep 4, 2014
This upgrades snappy-java which fixes the issue reported in SPARK-2881.
This is the master branch equivalent to apache#1994 which provides a different
work-around for the 1.1 branch.

Author: Patrick Wendell <[email protected]>

Closes apache#1995 from pwendell/snappy-1.1 and squashes the following commits:

0c7c4c2 [Patrick Wendell] SPARK-2881. Upgrade snappy-java to 1.1.1.3.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant