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

Rick Branson commented on CASSANDRA-3557:
-----------------------------------------

There are a few reasons:

* There is some "reset" logic that would need to be duplicated from the 
constructor into the recycle() method. Resetting this mutable state seems 
fragile vs just discarding immutable state.
* Current code from the constructor for existing files works for both the case 
of recycling recovered segments and recycling discarded segments. Moving this 
out means we'd have to split this logic and duplicate it.
* Naming/renaming logic would have to be reworked and likely duplicated in some 
places, and the segment MUST be renamed for several reasons:
** ReplayPosition objects reference CommitLogSegment's by their id, which is 
stored in the filename
** CommitLog.recover explicitly replays segments in order of their id, and not 
giving them a fresh id would break this contract.
* If we re-use CommitLogSegment objects, leaked references could 
unintentionally operate on the wrong segment file. A CLS object could reference 
one segment at one point in time, and another at a future point in time. This 
seems dangerous to me. The patch as it sits rejects any mutations after the 
segment is closed and any modifications to the "dirty" table are meaningless.
                
> Commit Log segments are not recycled
> ------------------------------------
>
>                 Key: CASSANDRA-3557
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3557
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Rick Branson
>            Assignee: Rick Branson
>         Attachments: 3557.txt
>
>
> Cassandra never recycles segments created after recovery.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to