[
https://issues.apache.org/jira/browse/CASSANDRA-11743?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15286833#comment-15286833
]
Branimir Lambov commented on CASSANDRA-11743:
---------------------------------------------
This has been fixed so many times I'm not sure a solution based on checking the
managed list could work at all.
An easier solution is to use {{CommitLogSegment.idBase}} as a threshold: replay
only if segment id is below that. This is done in CASSANDRA-10202, which only
targets trunk -- I think it's best to take the code from there
({{CommitLogSegment}}
[{{replayLimitId}}|https://github.com/apache/cassandra/compare/trunk...blambov:10202-commitlog#diff-7720d4b5123a354876e0b3139222f34eR63],
{{shouldReplay}} and {{resetReplayLimit}}, {{CommitLog}}
[{{recover}}|https://github.com/apache/cassandra/compare/trunk...blambov:10202-commitlog#diff-05c1e4fd86fea19b8e0552b1f289be85L133]
and
[{{stopUnsafe}}|https://github.com/apache/cassandra/compare/trunk...blambov:10202-commitlog#diff-05c1e4fd86fea19b8e0552b1f289be85R427])
and backport it.
Do we need to go back all the way to 2.1?
> Race condition in CommitLog.recover can prevent startup
> -------------------------------------------------------
>
> Key: CASSANDRA-11743
> URL: https://issues.apache.org/jira/browse/CASSANDRA-11743
> Project: Cassandra
> Issue Type: Bug
> Components: Lifecycle
> Reporter: Benjamin Lerer
> Assignee: Benjamin Lerer
> Fix For: 2.1.x, 2.2.x, 3.0.x, 3.x
>
>
> In {{CommitLog::recover}} the list of segments to recover from is determined
> by removing the files managed by the {{CommitLogSegmentManager}} from the
> list of files present in the commit log directory. Unfortunatly, due to the
> way the creation of segments is done there is a time window where a segment
> file has been created but has not been added yet to the list of segments
> managed by the {{CommitLogSegmentManager}}. If the filtering ocurs during
> that time window the Commit log might try to recover from that new segment
> and crash.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)