[
https://issues.apache.org/jira/browse/CASSANDRA-13660?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Blake Eggleston updated CASSANDRA-13660:
----------------------------------------
Reviewer: Marcus Eriksson
Status: Patch Available (was: Open)
[trunk|https://github.com/bdeggleston/cassandra/tree/13660]
[utests|https://circleci.com/gh/bdeggleston/cassandra/61]
This prevents a scenario where sessions can revert to an earlier state on
startup. Here, as part of the finalize propose sequence, we flush the repairs
table after setting the local state to FINALIZE_PROMISED, but before responding
to the coordinator. If we fail after, we'll be in a state we can get to
FINALIZED to. If we fail before the sync, we won't have responded to the
coordinator, so the session will end up failing anyway.
> Correctly timed kill -9 can put incremental repair sessions in an illegal
> state
> -------------------------------------------------------------------------------
>
> Key: CASSANDRA-13660
> URL: https://issues.apache.org/jira/browse/CASSANDRA-13660
> Project: Cassandra
> Issue Type: Bug
> Reporter: Blake Eggleston
> Assignee: Blake Eggleston
> Fix For: 4.0
>
>
> If a node is killed after it has sent a finalize promise message to an
> incremental repair coordinator, but before that section of commit log has
> been synced to disk, it can startup with the incremental repair session in a
> previous state, leading the following exception:
> {code}
> java.lang.RuntimeException: java.lang.IllegalArgumentException: Invalid state
> transition PREPARED -> FINALIZED
> at
> org.apache.cassandra.repair.RepairMessageVerbHandler.doVerb(RepairMessageVerbHandler.java:201)
> ~[cie-cassandra-3.0.13.5.jar:3.0.13.5]
> at
> org.apache.cassandra.net.MessageDeliveryTask.run(MessageDeliveryTask.java:67)
> ~[cie-cassandra-3.0.13.5.jar:3.0.13.5]
> at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
> ~[?:1.8.0_112]
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> ~[?:1.8.0_112]
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> ~[?:1.8.0_112]
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> ~[?:1.8.0_112]
> at
> org.apache.cassandra.concurrent.NamedThreadFactory.lambda$threadLocalDeallocator$0(NamedThreadFactory.java:79)
> ~[cie-cassandra-3.0.13.5.jar:3.0.13.5]
> at java.lang.Thread.run(Thread.java:745) [?:1.8.0_112]
> Caused by: java.lang.IllegalArgumentException: Invalid state transition
> PREPARED -> FINALIZED
> at
> com.google.common.base.Preconditions.checkArgument(Preconditions.java:145)
> ~[guava-18.0.jar:?]
> at
> org.apache.cassandra.repair.consistent.LocalSessions.setStateAndSave(LocalSessions.java:452)
> ~[cie-cassandra-3.0.13.5.jar:3.0.13.5]
> at
> org.apache.cassandra.repair.consistent.LocalSessions.handleStatusResponse(LocalSessions.java:679)
> ~[cie-cassandra-3.0.13.5.jar:3.0.13.5]
> at
> org.apache.cassandra.repair.RepairMessageVerbHandler.doVerb(RepairMessageVerbHandler.java:188)
> ~[cie-cassandra-3.0.13.5.jar:3.0.13.5]
> ... 7 more
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]