private async Task <ReliabilityLevel> GetActualReliabilityLevelForCluster(CancellationToken cancellationToken)
        {
            UpgradeOrchestrationTrace.TraceSource.WriteInfo(TraceType, "Entering GetCurrentReliabilityLevelForCluster");
            System.Fabric.Query.NodeList nodes = await StandaloneUtility.GetNodesFromFMAsync(this.fabricClient, cancellationToken).ConfigureAwait(false);

            int seedNodeCount = nodes.Count(p => p.IsSeedNode);

            ReliabilityLevel actualReliabilityLevelInCluster = ReliabilityLevelExtension.GetReliabilityLevel(seedNodeCount);

            UpgradeOrchestrationTrace.TraceSource.WriteInfo(TraceType, "SeedNodeCount from cluster {0}, actualReliabilityLevelInCluster {1}", seedNodeCount, actualReliabilityLevelInCluster);

            return(actualReliabilityLevelInCluster);
        }
Exemplo n.º 2
0
        internal override void UpdateUserConfig(IUserConfig userConfig, List <NodeDescriptionGA> nodes)
        {
            base.UpdateUserConfig(userConfig, nodes);
            this.UpdateNodeTypesIfNeeded(nodes);
            userConfig.NodeTypes        = this.NodeTypes.ConvertAll(external => external.ConvertToInternal());
            userConfig.PrimaryNodeTypes = userConfig.NodeTypes.FindAll(nt => nt.IsPrimary);
            userConfig.TotalPrimaryNodeTypeNodeCount = nodes.Count(node => userConfig.PrimaryNodeTypes.FirstOrDefault(nt => nt.Name == node.NodeTypeRef) != null);

            if (this.Security != null)
            {
                userConfig.Security = this.Security.ToInternal();
            }

            userConfig.ReliabilityLevel = !this.TestHookReliabilityLevel.HasValue ? ReliabilityLevelExtension.GetReliabilityLevel(userConfig.TotalPrimaryNodeTypeNodeCount) : this.TestHookReliabilityLevel.Value;
            userConfig.AddonFeatures    = this.AddonFeatures;
        }
Exemplo n.º 3
0
        public MockupUserConfig GetUserConfig()
        {
            var userConfig = new MockupUserConfig();

            userConfig.TotalNodeCount  = this.Nodes != null ? this.Nodes.Count : 0;
            userConfig.ClusterName     = this.Name;
            userConfig.Version         = new UserConfigVersion(this.ClusterConfigurationVersion);
            userConfig.IsScaleMin      = this.Nodes != null ? this.Nodes.Count != this.Nodes.GroupBy(node => node.IPAddress).Count() : true;
            userConfig.EnableTelemetry = this.Properties.EnableTelemetry;
            userConfig.FabricSettings  = this.Properties.FabricSettings;
            userConfig.DiagnosticsStorageAccountConfig = this.Properties.DiagnosticsStorageAccountConfig;
            userConfig.DiagnosticsStoreInformation     = this.Properties.DiagnosticsStore;
            userConfig.Security           = this.Properties.Security;
            userConfig.AutoupgradeEnabled = this.Properties.FabricClusterAutoupgradeEnabled ?? !userConfig.IsScaleMin;
            userConfig.NodeTypes          = this.Properties.NodeTypes;
            userConfig.PrimaryNodeTypes   = userConfig.NodeTypes != null?userConfig.NodeTypes.FindAll(nt => nt.IsPrimary) : null;

            userConfig.TotalPrimaryNodeTypeNodeCount = this.Nodes != null?this.Nodes.Count(node => userConfig.PrimaryNodeTypes.FirstOrDefault(nt => nt.Name == node.NodeTypeRef) != null) : 0;

            userConfig.ReliabilityLevel = ReliabilityLevelExtension.GetReliabilityLevel(userConfig.TotalPrimaryNodeTypeNodeCount);
            return(userConfig);
        }