无法更改参与者的分区方案
Can't change partitioning scheme for actors
在使用 azure service fabric actor 时,我最近发现了一件奇怪的事情 - 我无法更改分区的默认设置。例如,如果我尝试设置命名分区或更改 UniformInt64 的 low/high 键,每次我在 Visual Studio 中构建项目时它都会被覆盖。对于有状态服务这样做没有问题,它只发生在演员身上。没有错误,事件日志中没有记录,什么都没有...我在 Internet 上只找到一个关于同一问题的参考 -
但我没有看到任何对此的解释 - 无论是在 MSDN 上还是在官方文档中。有任何想法吗?真的会是'by design'吗?
P.S.
仅执行 Powershell 脚本来部署应用程序确实允许我按照我想要的方式设置方案。仍然无法在 VS 中执行此操作令人沮丧。可能有一个很好的理由......应该是,对吧? :)
Reliable Services can be created with different partition schemes and
partition key ranges. The Actor Service uses the Int64 partitioning
scheme with the full Int64 key range to map actors to partitions.
Every ActorId is hashed to an Int64, which is why the actor service
must use an Int64 partitioning scheme with the full Int64 key range.
However, custom ID values can be used for an ActorID, including GUIDs,
strings, and Int64s.
When using GUIDs and strings, the values are hashed to an Int64.
However, when explicitly providing an Int64 to an ActorId, the Int64
will map directly to a partition without further hashing. This can be
used to control which partition actors are placed in.
(Source)
如果您的分区已命名,此 ActorId => PartitionKey 转换策略将不起作用。
在使用 azure service fabric actor 时,我最近发现了一件奇怪的事情 - 我无法更改分区的默认设置。例如,如果我尝试设置命名分区或更改 UniformInt64 的 low/high 键,每次我在 Visual Studio 中构建项目时它都会被覆盖。对于有状态服务这样做没有问题,它只发生在演员身上。没有错误,事件日志中没有记录,什么都没有...我在 Internet 上只找到一个关于同一问题的参考 -
但我没有看到任何对此的解释 - 无论是在 MSDN 上还是在官方文档中。有任何想法吗?真的会是'by design'吗?
P.S.
仅执行 Powershell 脚本来部署应用程序确实允许我按照我想要的方式设置方案。仍然无法在 VS 中执行此操作令人沮丧。可能有一个很好的理由......应该是,对吧? :)
Reliable Services can be created with different partition schemes and partition key ranges. The Actor Service uses the Int64 partitioning scheme with the full Int64 key range to map actors to partitions.
Every ActorId is hashed to an Int64, which is why the actor service must use an Int64 partitioning scheme with the full Int64 key range. However, custom ID values can be used for an ActorID, including GUIDs, strings, and Int64s.
When using GUIDs and strings, the values are hashed to an Int64. However, when explicitly providing an Int64 to an ActorId, the Int64 will map directly to a partition without further hashing. This can be used to control which partition actors are placed in.
(Source)
如果您的分区已命名,此 ActorId => PartitionKey 转换策略将不起作用。