cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benedict (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-13106) Unnecessary assertion
Date Fri, 06 Jan 2017 10:31:58 GMT


Benedict commented on CASSANDRA-13106:

Hi Simon,

The predicate passed in is not always true - I suggest running "find usages" in your IDE before
submitting a patch

That's not to say this assertion is still always necessary, but this area of code used to
be very thorny, so it is assert heavy - after my major refactor I don't know of any serious
misuses of the code, but that's not to say it isn't still possible to misuse it.  It most
certainly is, and these asserts protect from really serious misbehaviour of the system if
that were to happen in future.  It is also vanishingly unlikely this assert consumes significant
CPU.  However, while it may seem a single line patch is a shoe-in, I don't really have the
time to engage in the philosophical debate that might necessarily ensue from this consideration.

For the record, etiquette on the project does not generally permit you to unilaterally assign
somebody a role on a ticket.  Typically you should either contact them directly, or at least
JIRA mention them in a request that they assign themselves a role (or, of course, if you employ
them feel free to do what you like).  I don't actively participate in the project at present
(although I do occasionally lurk), so it is a little jarring to suddenly be spammed by a half-dozen
JIRA emails late at night.

> Unnecessary assertion
> ---------------------
>                 Key: CASSANDRA-13106
>                 URL:
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Simon Zhou
>            Assignee: Simon Zhou
>            Priority: Minor
>         Attachments: CASSANDRA-13106.patch
> We had over 70 thousand sstables and it's slow to bootstrap new node, even though the
CPU utilization for main thread of Cassandra was nearly 100%. So we took a few stack traces
and found that the main thread were busy running this line in
> {code}
> assert Iterables.all(removed, remove);
> {code}
> Not exactly sure whether this line causes CPU utilization/bootstrapping issue, but this
line is redundant because the Predict we pass in is Predicates.<SSTableReader>alwaysTrue(),
which means the assertion always returns true. So I propose to remove that line.

This message was sent by Atlassian JIRA

View raw message