[ 
https://issues.apache.org/jira/browse/CASSANDRA-13067?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16061192#comment-16061192
 ] 

Benjamin Lerer commented on CASSANDRA-13067:
--------------------------------------------

I pushed some new patches for 
[2.2|https://github.com/apache/cassandra/compare/trunk...blerer:13067-2.2],  
[3.0|https://github.com/apache/cassandra/compare/trunk...blerer:13067-3.0] and 
[3.11|https://github.com/apache/cassandra/compare/trunk...blerer:13067-3.11]. I 
ran the tests for {{2.2}}, {{3.0}}, {{3.11}} and {{trunk}} on our internal CI. 
There are no unit tests failures and the DTests failures are unrelated to the 
changes.

The patch handle the 
[JDK-8162520|https://bugs.openjdk.java.net/browse/JDK-8162520] and 
[JDK-8179320|https://bugs.openjdk.java.net/browse/JDK-8179320] problems by 
providing safe methods within {{FileUtils}} to create a safe {{FileStore}} or 
retrieve the {{totalSpace}}, {{freeSpace}} or {{usableSpace}}.
If one value overflow, {{Long.MAX_VALUE}} will be returned instead of the 
negative value.
I considered returning a {{BigInteger}} but finally decided to keep the changes 
 as small as possible.

[~ifesdjeen] could you review?

> Integer overflows with file system size reported by Amazon Elastic File 
> System (EFS)
> ------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-13067
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-13067
>             Project: Cassandra
>          Issue Type: Bug
>         Environment: Cassandra in OpenShift running on Amazon EC2 instance 
> with EFS mounted for data
>            Reporter: Michael Hanselmann
>            Assignee: Benjamin Lerer
>         Attachments: 0001-Handle-exabyte-sized-filesystems.patch
>
>
> When not explicitly configured Cassandra uses 
> [{{nio.FileStore.getTotalSpace}}|https://docs.oracle.com/javase/7/docs/api/java/nio/file/FileStore.html]
>  to determine the total amount of available space in order to [calculate the 
> preferred commit log 
> size|https://github.com/apache/cassandra/blob/cassandra-3.9/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L553].
>  [Amazon EFS|https://aws.amazon.com/efs/] instances report a filesystem size 
> of 8 EiB when empty. [{{getTotalSpace}} causes an integer overflow 
> (JDK-8162520)|https://bugs.openjdk.java.net/browse/JDK-8162520] and returns a 
> negative number, resulting in a negative preferred size and causing the 
> checked integer to throw.
> Overriding {{commitlog_total_space_in_mb}} is not sufficient as 
> [{{DataDirectory.getAvailableSpace}}|https://github.com/apache/cassandra/blob/cassandra-3.9/src/java/org/apache/cassandra/db/Directories.java#L550]
>  makes use of {{nio.FileStore.getUsableSpace}}.
> [AMQ-6441] is a comparable issue in ActiveMQ.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to