-
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
Minor improvements to Service Fabric providers #3250
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,19 +6,6 @@ namespace Microsoft.Orleans.ServiceFabric.Utilities | |
{ | ||
internal static class ServiceFabricExtensions | ||
{ | ||
/// <summary> | ||
/// Returns a value indicating whether or not <paramref name="left"/> is older than <paramref name="right"/>. | ||
/// </summary> | ||
/// <param name="left">One resolved partition.</param> | ||
/// <param name="right">The other resolved partition.</param> | ||
/// <returns> | ||
/// <see langword="true"/> if <paramref name="left"/> is older than <paramref name="right"/>, <see langword="false"/> otherwise. | ||
/// </returns> | ||
public static bool IsOlderThan(this ResolvedServicePartition left, ResolvedServicePartition right) | ||
{ | ||
return left.Info.Id == right.Info.Id && left.CompareVersion(right) < 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can this be just There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we can, but the check doesn't provide value There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, that wouldn't work - because the version would be reset when the partition ids change (and anyhow the two versions wouldn't be related to each other since they're for different physical partitions) |
||
} | ||
|
||
/// <summary> | ||
/// Returns a value indicating whether or not <paramref name="left"/> is the same partition as <paramref name="right"/>. | ||
/// </summary> | ||
|
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'm not an expert on service fabric. But would removing this post the risk of older partition overwrites newer partition? Yes the older partition would mostly be corrected by newer partition eventually. But this brought unnecessary handling on partitionChange, which can be avoided, right? or is this pre-mature optimization?
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.
Not really, I was just finding that these checks really don't add value. In the worst case - that there's some race and updates are out of order, we have stale information for 1 polling cycle (5 seconds).