Elastic Sc​​ale Split/Merge 工具意外失败

Elastic Scale Split/Merge tool fails unexpectedly

我正在使用 Azure Elastic Sc​​ale Split Merge 工具将一个 shardlet 移动到另一个分片。一切似乎都按计划进行,但最终却失败了,却没有告诉我原因。

这是日志的完整输出

Status: Failed
Details: [Error] The request failed.
Status: Completing
Details: [Informational] Deleting any temp tables that were created while processing the request.
Status: CopyingShardedTables
Details: [Informational] Successfully copied key range [8643e580-b986-426f-8a11-0d33bd766a37:8743e580-b986-426f-8a11-0d33bd766a37) for sharded table [Edumatic].[Channels].
Status: CopyingShardedTables
Details: [Informational] Moving key range [8643e580-b986-426f-8a11-0d33bd766a37:8743e580-b986-426f-8a11-0d33bd766a37) of sharded tables.
Status: CopyingReferenceTables
Details: [Informational] Successfully copied reference table [Edumatic].[RoleUsers].
Status: CopyingReferenceTables
Details: [Informational] Successfully copied reference table [Edumatic].[Roles].
Status: CopyingReferenceTables
Details: [Informational] Successfully copied reference table [Edumatic].[Quizes].
Status: CopyingReferenceTables
Details: [Informational] Successfully copied reference table [Edumatic].[Practices].
Status: CopyingReferenceTables
Details: [Informational] Successfully copied reference table [Edumatic].[Polls].
Status: CopyingReferenceTables
Details: [Informational] Successfully copied reference table [Edumatic].[Migrations].
Status: CopyingReferenceTables
Details: [Informational] Successfully copied reference table [Edumatic].[MediaNodes].
Status: CopyingReferenceTables
Details: [Informational] Successfully copied reference table [Edumatic].[Lectures].
Status: CopyingReferenceTables
Details: [Informational] Successfully copied reference table [Edumatic].[Items].
Status: CopyingReferenceTables
Details: [Informational] Successfully copied reference table [Edumatic].[GroupUsers].
Status: CopyingReferenceTables
Details: [Informational] Successfully copied reference table [Edumatic].[Groups].
Status: CopyingReferenceTables
Details: [Informational] Successfully copied reference table [Edumatic].[Exams].
Status: CopyingReferenceTables
Details: [Informational] Successfully copied reference table [Edumatic].[Activities].
Status: CopyingReferenceTables
Details: [Informational] Successfully copied reference table [Edumatic].[TreeStructures].
Status: CopyingReferenceTables
Details: [Informational] Successfully copied reference table [Edumatic].[TreeNodes].
Status: CopyingReferenceTables
Details: [Informational] Successfully copied reference table [Edumatic].[Workspaces].
Status: CopyingReferenceTables
Details: [Informational] Successfully copied reference table [Edumatic].[Locks].
Status: CopyingReferenceTables
Details: [Informational] Successfully copied reference table [Edumatic].[Media].
Status: Starting
Details: [Informational] Performing data consistency checks on target shards.
Status: Starting
Details: [Informational] Starting Split-Merge state machine for request.
Status: Queued
Details: [Informational] Operation has been queued.
Split-Merge request created with OperationId: [4ca7910b-ce66-45fd-a450-c95765c590d6]

有没有办法询问更详细的信息,以便我知道为什么会出错?

在拆分合并服务用于元数据的数据库中,您有一个名为 RequestStatus 的 table。

如果你这样做 select details from requeststatus where operationid = '4ca7910b-ce66-45fd-a450-c95765c590d6' 您将收到一份 xml 报告,其中包含 web-ui 由于某种原因并不总是会显示的错误。

我在设置分片时通过设置 SchemaInfo 设法修复了它:

        SchemaInfoCollection schemaInfoCollection = this.ShardMapManager.GetSchemaInfoCollection();
        SchemaInfo schemaInfo = new SchemaInfo();

        schemaInfo.Add(new ReferenceTableInfo("dbo", "ActivityData"));
        schemaInfo.Add(new ShardedTableInfo("dbo", "Answers", "ChannelId"));
        schemaInfo.Add(new ShardedTableInfo("dbo","Channels","Id"));
        schemaInfo.Add(new ReferenceTableInfo("dbo", "ExamData"));
        schemaInfo.Add(new ShardedTableInfo("dbo","Groups", "ChannelId"))

        bool keyExists = false;
        foreach (var pair in schemaInfoCollection)
        {
            if (pair.Key == "ElasticScaleWithEF")
            {
                keyExists = true;
                schemaInfoCollection.Replace("ElasticScaleWithEF", schemaInfo);
            }
        }
        if (!keyExists)
        {
            schemaInfoCollection.Add("ElasticScaleWithEF", schemaInfo);
        }

不确定方法是否正确,但确实有效