添加新分片 - Azure Elastics Scale

Adding new shard - Azure Elastics Scale

我在为我们的系统创建新分片时遇到了问题。我有一个已经分片的数据库,有两个分片。

0-280000
280000-inf

我正在使用 Microsoft 提供的 this 应用程序。

使用上面的应用程序,我 select 添加分片,当我尝试添加新分片并输入 400000 作为新的高键时,执行操作并在最后尝试添加范围映射,我收到以下错误。

错误

{"Mapping referencing shard '[DataSource=xxxxxxxxxxxxxx Database=xxxxxx]' in the shard map 'UserID' cannot be added because the Range it covers is already mapped by another mapping. Error occurred while executing stored procedure '__ShardManagement.spBulkOperationShardMappingsGlobalBegin' for operation 'AddRangeMapping'. This can occur if another concurrent user has already added a mapping covering the given Range."}

在这方面的任何帮助将不胜感激。

如果您的第二个分片实际上是 280000-inf,inf 表示无穷大,那么您收到的错误是正确的。第二个分片已经包含 400000 的映射。您需要拆分第二个分片,而不是添加分片。请改用 split-merge 工具。