-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GrainDirectory Refactoring and Multi-Cluster Registration #1108
Conversation
@sebastianburckhardt, Thanks for signing the contribution license agreement so quickly! Actual humans will now validate the agreement and then evaluate the PR. |
private const int DEFAULT_MAX_RETRIES = 0; | ||
private readonly Dictionary<SiloAddress, DateTime> lastConnectionFailure; | ||
protected readonly Dictionary<SiloAddress, DateTime> lastConnectionFailure; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the goal in making these fields protected? I couldn't find any usages of them outside this class (and also I don't see any subclasses of SiloMessageSender.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, I agree it should be private. I think this was just left over from some code that no longer exists.
@@ -32,6 +33,7 @@ internal class ActivationAddress | |||
public GrainId Grain { get; private set; } | |||
public ActivationId Activation { get; private set; } | |||
public SiloAddress Silo { get; private set; } | |||
public MultiClusterStatus Status { get; private set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you now also need to change the way ActivationAddress
is serialized in Orleans serializer. We have manually written built in serializer for all runtime types. Look at BuiltInTypes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless of course you explicitly do not want this extra field to be serialized, and then you need to mark it as NonSerialized
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I am not quite sure. I think it is only used locally, but I will take a look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seems to be at least one case where the status has to be serialized (namely, when handing off activations). I have updated the binarystreamreader and binarystreamwriter and the serialization unit test accordingly. This adds one byte.
… to singletonSystemTargetNames
… to singletonSystemTargetNames
Regarding your question about
|
{ | ||
// Force the list to be created in order to avoid race conditions | ||
return result.Item1.Select(pair => ActivationAddress.GetAddress(pair.Item1, grain, pair.Item2)).ToList(); | ||
return result.Addresses.Select(a => ActivationAddress.GetAddress(a.Silo, grain, a.Activation, a.Status)).ToList(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason to recreate the list? It doesn't seem to be accomplishing anything. It creates an identical List<ActivationAddress>
as result.ActivationAddresses
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that this is unnecessary, since an identical list is now being constructed in partition.LooupGrain and can be used directly.
Also, the comment about race conditions seems irrelevant since the list returned by partition.LookupGrain is always fresh, and the ActivationAddress objects are immutable.
I will simplify this.
RegistrationsLocal.Increment(); | ||
// if I am the owner, store the new activation locally | ||
DirectoryPartition.AddActivation(address.Grain, address.Activation, address.Silo); | ||
(singleActivation ? RegistrationsSingleActLocal : RegistrationsLocal).Increment(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The naming is a bit confusing to me - it is easy to read it as if RegistrationsLocal
is all local registration including single-activation ones while in reality it seems that it actually means RegistrationsMultipleLocal
or something like that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with you, but did not dare to change the counter names since that could break someone else's stuff.
I think I'm done with my review pass. Once the outstanding comments are addressed, I think we can rebase, squash, retest, and merge. |
I think I have addressed all suggestions and questions. I will wait a couple hours and then squash, unless there are objections. |
@sebastianburckhardt Please give us some more time. I'm in a meeting unable to do much. I think give us till the rest of the day before rebasing and squashing. Thanks. |
return Task.WhenAll(addresses.Select(addr => Register(addr, retries))); | ||
} | ||
if (addresses == null || addresses.Count == 0) | ||
throw new ArgumentException("addresses"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A nit: ArgumentException
takes an error message as a constructor argument, e.g. "addresses cannot be an empty list or null" and an optional parameter name. ArgumentNullException
OTOH takes just an argument name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok. I will change that and then rebase and squash.
I am ready for rebasing and squashing of this. |
09839f1
to
1fa6036
Compare
Rebased and squashed. |
Awesome, thanks everybody. Doing some final test runs on our VSO and will get this merged by EOD |
GrainDirectory Refactoring and Multi-Cluster Registration
Alright, this is in! Load & Reliability tests worked fine. Thanks to all involved in this implementation and review 😄 |
A huge leap into geo-distribution has begun! :-) |
👍 |
Whoo. Nice job @sebastianburckhardt and everyone. |
This branch contains