Search code examples
azureshardingazure-elastic-scale

Elastic Scale Split/Merge tool fails unexpectedly


I'm using the Azure Elastic Scale Split Merge tool to move one shardlet to another shard. Everything seems to go as planned but in the end it fails without telling me why.

This is the complete output of the log

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]

Is there a way to ask for more detailed info so I can know why it goes wrong?


Solution

  • I managed to fix it by setting my SchemaInfo when I set up my shards:

            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);
            }
    

    Not sure if it is the right way, but it works