Skip to content
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

Enable "cleaning" of all dead entries in the membership table #5389

Merged
merged 10 commits into from
Feb 27, 2019

Conversation

benjaminpetit
Copy link
Member

Right now, we don't delete old entries in the membership table, and that can be an issue since it will grow forever.

This PR enable deleting old silo entries, and implement it in the azure membership provider. Other providers still need to implement this logic.

return entriesList.Count();
}

public async Task DeleteDeadMembershipTableEntries(DateTime beforeDate)
Copy link
Member

Choose a reason for hiding this comment

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

This should be a DateTimeOffset

return true;
}).Ignore();
}
catch (MissingMethodException)
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to also catch NotImplementedException?

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought that they were caught in the Continue but it seems you are right

Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should use an async method instead of .ContinueWith().Ignore(), so the error handling is flat

/// and will delete them
/// </summary>
public TimeSpan? CleanupDeadEntriesTimeout { get; set; } = DEFAULT_DELETE_ENTRIES_OLDER_THAN;
public static readonly TimeSpan? DEFAULT_CLEANUP_DEAD_ENTRIES_TIMEOUT = null;
Copy link
Member

Choose a reason for hiding this comment

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

This was confusing to me before reading the code. I think we should rename it to something like DefunctSiloCleanupPeriod and change the comment to:

/// <summary>
/// The duration between membership table cleanup operations. When this period elapses, all defunct silo
// entries older than <see cref="DefunctSiloExpiration" /> are removed. This value is per-silo.
/// </summary>

Thoughts? I'm not set on those names, but 'timeout' to me says that the process will be cancelled after that amount of time.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes I like your names better

Copy link
Member

@ReubenBond ReubenBond left a comment

Choose a reason for hiding this comment

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

LGTM after those comments are addressed

@ReubenBond
Copy link
Member

many test failures, unsure why

@sergeybykov sergeybykov added this to the 2.3.0 milestone Feb 26, 2019
@ReubenBond
Copy link
Member

Made some minor changes. LGTM & will squash merge once tests complete again.

@ReubenBond
Copy link
Member

@dotnet-bot test functional

@jinhong-
Copy link

I noticed this is listed as a non-breaking change. If i have a custom membership provider that did not upgrade, wouldn't that break when i upgrade to Orleans 2.3? What would be then considered as breaking change?

@benjaminpetit
Copy link
Member Author

@jinhong- If you are compiling your custom membership provider at the same time as you are compiling your silos then you will have to add this method to your interface to compile properly. You can throw NotImplementedException if you don't want to implement the logic.

If you are referencing via NuGet for example, then it should be fine since it will be catched by the runtime.

@jinhong-
Copy link

@benjaminpetit Okay. So in theory i could use a Membership Provider installed via NuGet package compiled with Orleans 2.2 in the new Orleans 2.3?

On another note, i notice this line seemed a little strange to me.
https://github.com/benjaminpetit/orleans/blob/5b97f1c0d53e3de10dda7530f214033009acb155/src/Orleans.Runtime/MembershipService/MembershipOracle.cs#L942
catch (Exception ex) when (ex is NotImplementedException || ex is NotImplementedException)
Why would you need a or condition that checks for the same exception twice?

@benjaminpetit
Copy link
Member Author

@jinhong- you are right, the condition should be

catch (Exception ex) when (ex is NotImplementedException || ex is MissingMethodException)

@benjaminpetit
Copy link
Member Author

Okay. So in theory i could use a Membership Provider installed via NuGet package compiled with Orleans 2.2 in the new Orleans 2.3?

Yes it should work

@RainingNight
Copy link

RainingNight commented Aug 9, 2019

Why Consul not implemented?

// src/Orleans.Clustering.Consul/ConsulBasedMembershipTable.cs
public Task CleanupDefunctSiloEntries(DateTimeOffset beforeDate)
{
     throw new NotImplementedException();
}

@benjaminpetit
Copy link
Member Author

Because we didn't implemented the logic for Consul yet. But feel free to open a PR with the implementation if you can, I would be happy to review it and merge it!

@benjaminpetit benjaminpetit deleted the membership-clean branch August 14, 2019 16:41
@github-actions github-actions bot locked and limited conversation to collaborators Dec 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants