[
https://issues.apache.org/jira/browse/CASSANDRA-8592?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14354622#comment-14354622
]
Stefania commented on CASSANDRA-8592:
-------------------------------------
[~thobbs], thanks for your comments, I believe I've addressed them all except
for the second one:
{quote}
MutationVerbHandler:
* I can't see a good reason to wrap the exception in an IOError. It should be
fine to re-throw the exception (there's only one caller of this method).
{quote}
\\
{{IOException}} is a checked exception so to rethrow it we need to change the
signature of {{IVerbHandler.doVerb()}}. Is this what you meant or did I
misunderstand you? I did however remove the additional logs and we only rely on
{{MessageDeliveryTask}} throwing the exception like you suggested in the 6th
bullet point.
I also removed the try/catch from {{CounterMutationVerbHandler}}, modified the
v4 protocol document, and fixed a couple more things highlighted by the tests I
wrote today.
Regarding the JVM flag, {{-Dcassandra.test.fail_writes}}, I found it easier to
specify the keyspace that should have failed writes, please double check that
there is no performance impact (I stored a static boolean rather than checking
the failed write keyspace name is empty every time but maybe this is not
required if the compiler optimizes the check on static strings):
{code}
private static final String TEST_FAIL_WRITES_KS =
System.getProperty("cassandra.test.fail_writes_ks", "");
private static final boolean TEST_FAIL_WRITES =
!TEST_FAIL_WRITES_KS.isEmpty();
[...]
if (TEST_FAIL_WRITES && metadata.name.equals(TEST_FAIL_WRITES_KS))
throw new RuntimeException("Testing write failures");
{code}
The reason for using a keyspace name was to exclude system keyspaces (else
nothing would work) and to have better control on when the writes should fail.
If you don't like it I can go back to a boolean but I need a reliable way to
exclude all system keyspaces.
I added more tests (https://github.com/stef1927/cassandra-dtest/tree/8592) and
I am happy wiht the level of testing now. I had to change a couple of things:
\\
\\
* {{ccmlib/node.py}} needs to use {{JVM_OPTS}} instead of {{JVM_EXTRA_OPTS}},
as {{JVM_EXTRA_OPTS}} is not used by bin/cassandra, see
https://github.com/stef1927/ccm/tree/8592
* {{python-driver/__init__.py}} needed {{ReadFailure}} and {{WriteFailure}},
see https://github.com/stef1927/python-driver/tree/CASSANDRA-8592.
I'm not sure how to best keep track of the changes in ccmlib, dtest and the
python-driver. I can create pull requests if required.
> Add WriteFailureException
> -------------------------
>
> Key: CASSANDRA-8592
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8592
> Project: Cassandra
> Issue Type: New Feature
> Components: API, Core
> Reporter: Tyler Hobbs
> Assignee: Stefania
> Labels: client-impacting
> Fix For: 3.0
>
>
> Similar to what CASSANDRA-7886 did for reads, we should add a
> WriteFailureException and have replicas signal a failure while handling a
> write to the coordinator.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)