Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Grain placement documentation is a bit lacking #6376
Comments
|
More detail in that document would be much appreciated. To answer your questions:
siloBuilder.ConfigureServices(services =>
services.AddSingleton<PlacementStrategy, MyPlacementStrategy>());
All strategies select a silo from the set of compatible silos. The set of compatible silos is the set of all silos which have an implementation for the grain and where that implementation's interface version is compatible with the caller's interface version. For more information, see the grain versioning documentation. RandomPlacementA silo is randomly selected from the set of compatible silos. PreferLocalPlacementIf the local silo is compatible, select the local silo, otherwise select a random silo. HashBasedPlacementHash the grain id to a non-negative integer and modulo it with the number of compatible silos. Select the corresponding silo from list of compatible silos ordered by silo address. Note that this is not guaranteed to remain stable as the cluster membership changes. Specifically, adding, removing, or restarting silos can alter the silo selected for a given grain id. Because grains placed using this strategy are registered in the grain directory, this change in placement decision as membership changes typically does not have a noticeable effect. ActivationCountPlacementThe intention of this placement strategy is to place new grain activations on the least heavily loaded silo. The implementation of this director is not simple enough to explain briefly, however. It includes a mechanism in which all silos periodically publish their total activation count to all other silos. The placement director then selects a silo which is predicted to have the fewest activations by examining the most recently reported activation count and a making prediction of the current activation count based upon the recent activation count made by the placement director on the current silo. The general advice is to not use this placement director without careful testing and analysis. (@sergeybykov, should we submit a PR to remove it?) |
|
If you do remove ActivationCountPlacement, could I suggest it is moved to Samples rather than deleted, as it might be a useful reference for others writing custom strategies? |
|
In my opinion, |
|
So let's avoid documenting Also, can anyone confirm whether the sample in the existing document is still up to date? Specifically with regard to the strategy and director registration. |
|
I think it's okay to document The sample code looks correct for 2.x and 3.x. |
|
We are heavily relying on ActivationCountPlacement. Please don't remove it. We understand all consequences and are using it at our own risk |
|
We should publish a Liability Waiver form that one would have to sign before using |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

There is a document on the subject, but it's lacking in a few ways:
I can send a PR to update the document, but I would need someone to clarify the points above.
It would also be good if someone could confirm that the custom strategy example in that document is still up to date since I know some work was done to simplify strategy registration.