Skip to content

Allow transient range owner to serve as repair coordinator#257

Closed
ifesdjeen wants to merge 13 commits intoapache:trunkfrom
ifesdjeen:tr-followup-1
Closed

Allow transient range owner to serve as repair coordinator#257
ifesdjeen wants to merge 13 commits intoapache:trunkfrom
ifesdjeen:tr-followup-1

Conversation

@ifesdjeen
Copy link
Copy Markdown
Contributor

@ifesdjeen ifesdjeen commented Sep 5, 2018

{
// 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())
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use .equals() here. Set equality does the right thing.

Copy link
Copy Markdown
Contributor Author

@ifesdjeen ifesdjeen Sep 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, return s.size() == o.size() && s.containsAll(o);, i should've did that from starters.

@bdeggleston
Copy link
Copy Markdown
Member

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:

  • Move set comparison logic in RepairRunnable#addRangeToNeighbors to CommonRange class
  • changed asserts to Preconditions
  • added a SymmetricLocalSync task test for the local transient case
  • misc formatting

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.

@ifesdjeen
Copy link
Copy Markdown
Contributor Author

ifesdjeen commented Sep 6, 2018

@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);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in transfer

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for noticing!

import java.net.UnknownHostException;
import java.util.*;
import java.util.concurrent.*;
import java.util.ArrayList;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import fighting still happening?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'll remove it on commit when it's squashed.

@ifesdjeen
Copy link
Copy Markdown
Contributor Author

@aweisberg fixed imports and spelling. Thank you for spotting those.

@bdeggleston
Copy link
Copy Markdown
Member

@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 :)

@ifesdjeen
Copy link
Copy Markdown
Contributor Author

Heh, now I need to take a look as well)

@ifesdjeen ifesdjeen closed this Sep 12, 2018
blambov pushed a commit to blambov/cassandra that referenced this pull request Oct 1, 2021
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.
blambov pushed a commit to blambov/cassandra that referenced this pull request Mar 21, 2022
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)
blambov pushed a commit to blambov/cassandra that referenced this pull request Jun 13, 2022
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)
blambov pushed a commit to blambov/cassandra that referenced this pull request Nov 24, 2022
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)
adelapena pushed a commit to adelapena/cassandra that referenced this pull request Sep 26, 2023
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)
ekaterinadimitrova2 pushed a commit to ekaterinadimitrova2/cassandra that referenced this pull request Jun 3, 2024
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
michaelsembwever pushed a commit to thelastpickle/cassandra that referenced this pull request Jan 7, 2026
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants