Allow transient range owner to serve as repair coordinator#257
Allow transient range owner to serve as repair coordinator#257ifesdjeen wants to merge 13 commits intoapache:trunkfrom ifesdjeen:tr-followup-1
Conversation
| { | ||
| // Use strict equality here, as worst thing that can happen is we generate one more stream | ||
| if (Iterables.elementsEqual(cr.endpoints, endpoints) && Iterables.elementsEqual(cr.transEndpoints, transEndpoints)) | ||
| if (Sets.difference(cr.endpoints, endpoints).isEmpty() && Sets.difference(cr.transEndpoints, transEndpoints).isEmpty()) |
There was a problem hiding this comment.
You can use .equals() here. Set equality does the right thing.
There was a problem hiding this comment.
Right, return s.size() == o.size() && s.containsAll(o);, i should've did that from starters.
|
I think I've mostly convinced myself this is all you need to do to support coordinating repairs for locally transient ranges. I have a commit here here with a few adjustments:
This leaves the sync task class hierarchy in kind of a messy state. We have AsymmetricSyncTask, but we also have SymmetricSyncTask which can also function as an asymmetric sync task. I do think the state of things is preferable to adding more branches to RepairJob#standardSyncing though, and a refactor is out of scope for this ticket. I'll open a follow on jira to clean that up once this is committed. |
|
@bdeggleston thank you for the review and changes, they look great! I agree the class hierarchy became not very optimal. I was concentrating on the AssumetrciLocalSyncTask and didn't change the symmetric one. I've added a follow-up commit that makes only one of them necessary and renames it to LocalSyncTask. It did not seem necessary to do the same with remote tasks as there we do not depend on the argument order, which we do in the local case because of transiency. I did try to avoid this change but couldn't find a good way to make it order-independent, but I've changed argument names and made sure corresponding checks are in place. |
| // send ranges to the remote node if we are not performing a pull repair | ||
| // see comment on RangesAtEndpoint.toDummyList for why we synthesize replicas here | ||
| plan.transferRanges(dst, desc.keyspace, RangesAtEndpoint.toDummyList(differences), desc.columnFamily); | ||
| plan.transferRanges(remote, desc.keyspace, RangesAtEndpoint.toDummyList(differences), desc.columnFamily); |
There was a problem hiding this comment.
So the idiom where it returns this isn't always used to return "this" some of the time it's a copy. Granted here it is returning this, but should you assign the plan field on the stack again?
I don't feel strongly about it just noticing that.
There was a problem hiding this comment.
I felt like this is a side-effect generating, imperative method, so ignoring its return is fine as it's done in order to facilitate chaining.
| // pull only if local is full | ||
| boolean requestRanges = !isTransient(self.endpoint); | ||
| // push only if remote is full; additionally check for pull repair | ||
| boolean transfterRanges = !isTransient(remote.endpoint) && !session.pullRepair; |
There was a problem hiding this comment.
Thanks for noticing!
| import java.net.UnknownHostException; | ||
| import java.util.*; | ||
| import java.util.concurrent.*; | ||
| import java.util.ArrayList; |
There was a problem hiding this comment.
Import fighting still happening?
There was a problem hiding this comment.
Yes, I'll remove it on commit when it's squashed.
|
@aweisberg fixed imports and spelling. Thank you for spotting those. |
|
@ifesdjeen did some further consolidation of the sync task class hierarchy here. I'm not really opposed to doing this refactor here instead of a separate ticket, but @krummas should probably take a look now :) |
|
Heh, now I need to take a look as well) |
FailingRepairTest uses serialization to pass Verbs back and forth between the nodes during the test. Unforuntately, Verbs aren't serializable anymore because they're no longer enums and this broke the test. Instead of passing a verb around, pass the verb Id and lookup the verb inside of the test method.
FailingRepairTest uses serialization to pass Verbs back and forth between the nodes during the test. Unforuntately, Verbs aren't serializable anymore because they're no longer enums and this broke the test. Instead of passing a verb around, pass the verb Id and lookup the verb inside of the test method. (cherry picked from commit 47d0719)
FailingRepairTest uses serialization to pass Verbs back and forth between the nodes during the test. Unforuntately, Verbs aren't serializable anymore because they're no longer enums and this broke the test. Instead of passing a verb around, pass the verb Id and lookup the verb inside of the test method. (cherry picked from commit 47d0719) (cherry picked from commit 6ed9a94)
FailingRepairTest uses serialization to pass Verbs back and forth between the nodes during the test. Unforuntately, Verbs aren't serializable anymore because they're no longer enums and this broke the test. Instead of passing a verb around, pass the verb Id and lookup the verb inside of the test method. (cherry picked from commit 47d0719) (cherry picked from commit 6ed9a94) (cherry picked from commit eaed731)
FailingRepairTest uses serialization to pass Verbs back and forth between the nodes during the test. Unforuntately, Verbs aren't serializable anymore because they're no longer enums and this broke the test. Instead of passing a verb around, pass the verb Id and lookup the verb inside of the test method. (cherry picked from commit 47d0719) (cherry picked from commit 6ed9a94) (cherry picked from commit eaed731) (cherry picked from commit 4432e3c) (+1 squashed commit) Squashed commits: [5d65744ea5b] STAR-845: Port MessagingService implementation from DSE (apache#254) Add support for: - Registering new verbs at runtime - Decorating existing verb handlers with another method - Running a callback after the MessagingService sends a message (cherry picked from commit c7d0ba0) (cherry picked from commit e8e13ed) (cherry picked from commit 964892a) (cherry picked from commit 1968d3c) (cherry picked from commit 012cd01)
FailingRepairTest uses serialization to pass Verbs back and forth between the nodes during the test. Unforuntately, Verbs aren't serializable anymore because they're no longer enums and this broke the test. Instead of passing a verb around, pass the verb Id and lookup the verb inside of the test method. (cherry picked from commit 47d0719) (cherry picked from commit 6ed9a94) (cherry picked from commit eaed731) (cherry picked from commit 4432e3c) (+1 squashed commit) Squashed commits: [5d65744ea5b] STAR-845: Port MessagingService implementation from DSE (apache#254) Add support for: - Registering new verbs at runtime - Decorating existing verb handlers with another method - Running a callback after the MessagingService sends a message (cherry picked from commit c7d0ba0) (cherry picked from commit e8e13ed) (cherry picked from commit 964892a) (cherry picked from commit 1968d3c) (cherry picked from commit 012cd01) (cherry picked from commit 67b9707) STAR-881 Fix rebase compile issues
FailingRepairTest uses serialization to pass Verbs back and forth between the nodes during the test. Unforuntately, Verbs aren't serializable anymore because they're no longer enums and this broke the test. Instead of passing a verb around, pass the verb Id and lookup the verb inside of the test method. (cherry picked from commit 47d0719) (cherry picked from commit 6ed9a94) (cherry picked from commit eaed731) (cherry picked from commit 4432e3c) (+1 squashed commit) Squashed commits: [5d65744ea5b] STAR-845: Port MessagingService implementation from DSE (apache#254) Add support for: - Registering new verbs at runtime - Decorating existing verb handlers with another method - Running a callback after the MessagingService sends a message (cherry picked from commit c7d0ba0) (cherry picked from commit e8e13ed) (cherry picked from commit 964892a) (cherry picked from commit 1968d3c) (cherry picked from commit 012cd01) (cherry picked from commit 67b9707) STAR-881 Fix rebase compile issues
cc @bdeggleston @aweisberg