OrleansContrib/Orleans.Providers.MongoDB

CollectionPrefix mismatch

bboyle1234 opened this issue · 1 comments

The following image shows the two configuration options classes that are used for Orleans membership.

On the left, MongoDBGatewayListProviderOptions is used by the IClusterClientBuilder and sets the default CollectionPrefix value to Members.

On the right, MongoDBMembershipTableOptions is used by the ISiloHostBuilder extension methods and sets the default CollectionPrefix value to null.

The consequence is that unless users explicitly set the CollectionPrefix value when initializing both the silo and the client, there will be an accidental collection name mismatch, as shown in the second image below:

image

image

The solution as I see it is to initialize the default CollectionPrefix value in the base class inherited by both, MongoDBOptions.CollectionPrefix.

I think the best default for this value is null. What do you think?

Finally merged.