You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Joaquin Casares (JIRA)" <ji...@apache.org> on 2011/03/09 20:47:59 UTC

[jira] Created: (CASSANDRA-2301) OOM on repair

OOM on repair
-------------

                 Key: CASSANDRA-2301
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2301
             Project: Cassandra
          Issue Type: Bug
    Affects Versions: 0.7.1
            Reporter: Joaquin Casares
             Fix For: 0.7.4
         Attachments: 2301.diff

On repair, the java heap space tends to OOM.

I replicated the error by making 1264 3MB sstables on one node, added a second node, changed the replication factor to 2, and ran a repair.

Looking at the heap dump of the original failure, there were 2.4GB of FutureTasks, each taking up 8MB of space. I tracked down the BufferedRandomAccessFile and made sure that it was cleared every time it was closed inside of src/java/org/apache/cassandra/io/sstable/SSTableWriter.java.

Attached is the patch I used which stopped the error when I was trying to replicate it.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Updated: (CASSANDRA-2301) OOM on repair with many inconsistent ranges

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2301?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis updated CASSANDRA-2301:
--------------------------------------

    Attachment: 2301-v3.txt

v2 overcomplicated the problem.  v3 attached w/o extra Builder fields.

> OOM on repair with many inconsistent ranges
> -------------------------------------------
>
>                 Key: CASSANDRA-2301
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2301
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 0.7.0
>            Reporter: Joaquin Casares
>            Assignee: Joaquin Casares
>             Fix For: 0.7.4
>
>         Attachments: 2301-v2.txt, 2301-v3.txt, 2301.diff
>
>
> Repair can OOM when lots of ranges are inconsistent, causing many sstables to be streamed.
> I replicated the error by making 1264 3MB sstables on one node, added a second node, changed the replication factor to 2, and ran a repair.
> Looking at the heap dump of the original failure, there were 2.4GB of FutureTasks, each taking up 8MB of space. I tracked down the BufferedRandomAccessFile and made sure that it was cleared every time it was closed inside of src/java/org/apache/cassandra/io/sstable/SSTableWriter.java.
> Attached is the patch I used which stopped the error when I was trying to replicate it.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Updated: (CASSANDRA-2301) OOM on repair with many inconsistent ranges

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2301?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis updated CASSANDRA-2301:
--------------------------------------

             Reviewer: jbellis
          Description: 
Repair can OOM when lots of ranges are inconsistent, causing many sstables to be streamed.

I replicated the error by making 1264 3MB sstables on one node, added a second node, changed the replication factor to 2, and ran a repair.

Looking at the heap dump of the original failure, there were 2.4GB of FutureTasks, each taking up 8MB of space. I tracked down the BufferedRandomAccessFile and made sure that it was cleared every time it was closed inside of src/java/org/apache/cassandra/io/sstable/SSTableWriter.java.

Attached is the patch I used which stopped the error when I was trying to replicate it.

  was:
On repair, the java heap space tends to OOM.

I replicated the error by making 1264 3MB sstables on one node, added a second node, changed the replication factor to 2, and ran a repair.

Looking at the heap dump of the original failure, there were 2.4GB of FutureTasks, each taking up 8MB of space. I tracked down the BufferedRandomAccessFile and made sure that it was cleared every time it was closed inside of src/java/org/apache/cassandra/io/sstable/SSTableWriter.java.

Attached is the patch I used which stopped the error when I was trying to replicate it.

    Affects Version/s:     (was: 0.7.1)
                       0.7.0
             Assignee: Joaquin Casares
              Summary: OOM on repair with many inconsistent ranges  (was: OOM on repair)

> OOM on repair with many inconsistent ranges
> -------------------------------------------
>
>                 Key: CASSANDRA-2301
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2301
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 0.7.0
>            Reporter: Joaquin Casares
>            Assignee: Joaquin Casares
>             Fix For: 0.7.4
>
>         Attachments: 2301.diff
>
>
> Repair can OOM when lots of ranges are inconsistent, causing many sstables to be streamed.
> I replicated the error by making 1264 3MB sstables on one node, added a second node, changed the replication factor to 2, and ran a repair.
> Looking at the heap dump of the original failure, there were 2.4GB of FutureTasks, each taking up 8MB of space. I tracked down the BufferedRandomAccessFile and made sure that it was cleared every time it was closed inside of src/java/org/apache/cassandra/io/sstable/SSTableWriter.java.
> Attached is the patch I used which stopped the error when I was trying to replicate it.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (CASSANDRA-2301) OOM on repair with many inconsistent ranges

Posted by "Matthew F. Dennis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13005340#comment-13005340 ] 

Matthew F. Dennis commented on CASSANDRA-2301:
----------------------------------------------

+1 on v3

> OOM on repair with many inconsistent ranges
> -------------------------------------------
>
>                 Key: CASSANDRA-2301
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2301
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 0.7.0
>            Reporter: Joaquin Casares
>            Assignee: Joaquin Casares
>             Fix For: 0.7.4
>
>         Attachments: 2301-v2.txt, 2301-v3.txt, 2301.diff
>
>
> Repair can OOM when lots of ranges are inconsistent, causing many sstables to be streamed.
> I replicated the error by making 1264 3MB sstables on one node, added a second node, changed the replication factor to 2, and ran a repair.
> Looking at the heap dump of the original failure, there were 2.4GB of FutureTasks, each taking up 8MB of space. I tracked down the BufferedRandomAccessFile and made sure that it was cleared every time it was closed inside of src/java/org/apache/cassandra/io/sstable/SSTableWriter.java.
> Attached is the patch I used which stopped the error when I was trying to replicate it.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (CASSANDRA-2301) OOM on repair with many inconsistent ranges

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13005473#comment-13005473 ] 

Hudson commented on CASSANDRA-2301:
-----------------------------------

Integrated in Cassandra-0.7 #373 (See [https://hudson.apache.org/hudson/job/Cassandra-0.7/373/])
    reduce memory use during streaming of multiple sstables
patch by jbellis; reviewed by mdennis and tested by Joaquin Casares for CASSANDRA-2301


> OOM on repair with many inconsistent ranges
> -------------------------------------------
>
>                 Key: CASSANDRA-2301
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2301
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 0.7.0
>            Reporter: Joaquin Casares
>            Assignee: Joaquin Casares
>             Fix For: 0.7.4
>
>         Attachments: 2301-v2.txt, 2301-v3.txt, 2301.diff
>
>
> Repair can OOM when lots of ranges are inconsistent, causing many sstables to be streamed.
> I replicated the error by making 1264 3MB sstables on one node, added a second node, changed the replication factor to 2, and ran a repair.
> Looking at the heap dump of the original failure, there were 2.4GB of FutureTasks, each taking up 8MB of space. I tracked down the BufferedRandomAccessFile and made sure that it was cleared every time it was closed inside of src/java/org/apache/cassandra/io/sstable/SSTableWriter.java.
> Attached is the patch I used which stopped the error when I was trying to replicate it.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Updated: (CASSANDRA-2301) OOM on repair with many inconsistent ranges

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2301?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis updated CASSANDRA-2301:
--------------------------------------

    Attachment: 2301-v2.txt

I'm actually not sure how this could help -- dfile.close() already un-references the buffer, so there's no need to set dfile itself to be null.  Also, the file pointer changes as we read through the file, so changing bytescomplete to init-once is broken. (This is what nodetool compactionstats uses.)

My guess is that the second time around you just got lucky and index build was able to keep up w/ streaming enough to avoid OOMing.

But there is a bug here with the file/buffer handling -- we should lazy-init this once we're ready to build the index, rather than when we enqueue the task.  Patch attached w/ this approach.

> OOM on repair with many inconsistent ranges
> -------------------------------------------
>
>                 Key: CASSANDRA-2301
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2301
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 0.7.0
>            Reporter: Joaquin Casares
>            Assignee: Joaquin Casares
>             Fix For: 0.7.4
>
>         Attachments: 2301-v2.txt, 2301.diff
>
>
> Repair can OOM when lots of ranges are inconsistent, causing many sstables to be streamed.
> I replicated the error by making 1264 3MB sstables on one node, added a second node, changed the replication factor to 2, and ran a repair.
> Looking at the heap dump of the original failure, there were 2.4GB of FutureTasks, each taking up 8MB of space. I tracked down the BufferedRandomAccessFile and made sure that it was cleared every time it was closed inside of src/java/org/apache/cassandra/io/sstable/SSTableWriter.java.
> Attached is the patch I used which stopped the error when I was trying to replicate it.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Resolved: (CASSANDRA-2301) OOM on repair with many inconsistent ranges

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2301?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis resolved CASSANDRA-2301.
---------------------------------------

    Resolution: Fixed

committed

> OOM on repair with many inconsistent ranges
> -------------------------------------------
>
>                 Key: CASSANDRA-2301
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2301
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 0.7.0
>            Reporter: Joaquin Casares
>            Assignee: Joaquin Casares
>             Fix For: 0.7.4
>
>         Attachments: 2301-v2.txt, 2301-v3.txt, 2301.diff
>
>
> Repair can OOM when lots of ranges are inconsistent, causing many sstables to be streamed.
> I replicated the error by making 1264 3MB sstables on one node, added a second node, changed the replication factor to 2, and ran a repair.
> Looking at the heap dump of the original failure, there were 2.4GB of FutureTasks, each taking up 8MB of space. I tracked down the BufferedRandomAccessFile and made sure that it was cleared every time it was closed inside of src/java/org/apache/cassandra/io/sstable/SSTableWriter.java.
> Attached is the patch I used which stopped the error when I was trying to replicate it.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Updated: (CASSANDRA-2301) OOM on repair

Posted by "Joaquin Casares (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2301?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joaquin Casares updated CASSANDRA-2301:
---------------------------------------

    Attachment: 2301.diff

> OOM on repair
> -------------
>
>                 Key: CASSANDRA-2301
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2301
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 0.7.1
>            Reporter: Joaquin Casares
>             Fix For: 0.7.4
>
>         Attachments: 2301.diff
>
>
> On repair, the java heap space tends to OOM.
> I replicated the error by making 1264 3MB sstables on one node, added a second node, changed the replication factor to 2, and ran a repair.
> Looking at the heap dump of the original failure, there were 2.4GB of FutureTasks, each taking up 8MB of space. I tracked down the BufferedRandomAccessFile and made sure that it was cleared every time it was closed inside of src/java/org/apache/cassandra/io/sstable/SSTableWriter.java.
> Attached is the patch I used which stopped the error when I was trying to replicate it.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (CASSANDRA-2301) OOM on repair with many inconsistent ranges

Posted by "Joaquin Casares (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13005414#comment-13005414 ] 

Joaquin Casares commented on CASSANDRA-2301:
--------------------------------------------

+1 on v3.

Ran the patched code twice and my cluster of 2 didn't OOM.

> OOM on repair with many inconsistent ranges
> -------------------------------------------
>
>                 Key: CASSANDRA-2301
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2301
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 0.7.0
>            Reporter: Joaquin Casares
>            Assignee: Joaquin Casares
>             Fix For: 0.7.4
>
>         Attachments: 2301-v2.txt, 2301-v3.txt, 2301.diff
>
>
> Repair can OOM when lots of ranges are inconsistent, causing many sstables to be streamed.
> I replicated the error by making 1264 3MB sstables on one node, added a second node, changed the replication factor to 2, and ran a repair.
> Looking at the heap dump of the original failure, there were 2.4GB of FutureTasks, each taking up 8MB of space. I tracked down the BufferedRandomAccessFile and made sure that it was cleared every time it was closed inside of src/java/org/apache/cassandra/io/sstable/SSTableWriter.java.
> Attached is the patch I used which stopped the error when I was trying to replicate it.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Updated: (CASSANDRA-2301) OOM on repair with many inconsistent ranges

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2301?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis updated CASSANDRA-2301:
--------------------------------------

    Remaining Estimate: 4h
     Original Estimate: 4h

> OOM on repair with many inconsistent ranges
> -------------------------------------------
>
>                 Key: CASSANDRA-2301
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2301
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 0.7.0
>            Reporter: Joaquin Casares
>            Assignee: Joaquin Casares
>             Fix For: 0.7.4
>
>         Attachments: 2301-v2.txt, 2301-v3.txt, 2301.diff
>
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> Repair can OOM when lots of ranges are inconsistent, causing many sstables to be streamed.
> I replicated the error by making 1264 3MB sstables on one node, added a second node, changed the replication factor to 2, and ran a repair.
> Looking at the heap dump of the original failure, there were 2.4GB of FutureTasks, each taking up 8MB of space. I tracked down the BufferedRandomAccessFile and made sure that it was cleared every time it was closed inside of src/java/org/apache/cassandra/io/sstable/SSTableWriter.java.
> Attached is the patch I used which stopped the error when I was trying to replicate it.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira