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

Blake Eggleston commented on CASSANDRA-15564:
---------------------------------------------

{quote}, so we are on the same page, you are saying something like the below 
example?
{quote}
Not quite, you should be able to get through that method without adding mutable 
class state, with the exception of {{traceState}} so something more like this:
{code:java}
List<ColumnFamilyStore> tables = getValidTables();
if (Iterables.isEmpty(tables))
    throw new SkipRepairException(String.format("Empty keyspace, skipping 
repair: %s", keyspace));

this.traceState = setupTracing(tables);

(...)

if (options.isPreview())
{
    previewRepair(parentSession, creationTimeMillis, rangesAndEndpoints.ranges, 
cfnames);
}
else if (options.isIncremental())
{
    incrementalRepair(parentSession, creationTimeMillis, 
rangesAndEndpoints.forced, traceState, rangesAndEndpoints.neighbors, 
rangesAndEndpoints.ranges, cfnames);
}
(...)
{code}
Really just refactoring the method so that the bulk of the logic has been 
organized behind methods, but with approximately the same data/control flow.
{quote}Sorry, its bace to the "life-cycle" bit.
{quote}
I see, so you're explaining why we're logging it's started before we've changed 
the state internally. If so, I think that comment should be added in the parent 
jira? If the parent jira doesn't end up getting committed for some reason, that 
will be confusing.

> Refactor repair coordinator so errors are consistent
> ----------------------------------------------------
>
>                 Key: CASSANDRA-15564
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-15564
>             Project: Cassandra
>          Issue Type: Sub-task
>          Components: Consistency/Repair
>            Reporter: David Capwell
>            Assignee: David Capwell
>            Priority: Normal
>              Labels: pull-request-available
>          Time Spent: 10h 50m
>  Remaining Estimate: 0h
>
> This is to split the change in CASSANDRA-15399 so the refactor is isolated 
> out.
> Currently the repair coordinator special cases the exit cases at each call 
> site; this makes it so that errors can be inconsistent and there are cases 
> where proper complete isn't done (proper notifications, and forgetting to 
> update ActiveRepairService).
> [Circle 
> CI|https://circleci.com/gh/dcapwell/cassandra/tree/bug%2FrepairCoordinatorJmxConsistency]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to