Exemple #1
0
        internal static StandAloneCluster DoBaselineUpgrade(string jsonFilePath)
        {
            StandAloneCluster result = Utility.PopulateStandAloneClusterWithBaselineJson(jsonFilePath);

            Assert.IsTrue(result.RunStateMachine());
            Utility.RollForwardOneIteration(result);
            Assert.IsFalse(result.RunStateMachine());
            Assert.IsNull(result.Pending);
            Assert.IsNotNull(result.Current);

            return(result);
        }
        private StandAloneCluster InitializeBaselineUpgrade(string jsonFilePath)
        {
            StandAloneCluster result = Utility.PopulateStandAloneClusterWithBaselineJson(jsonFilePath);

            Assert.IsTrue(result.RunStateMachine());
            return(result);
        }
        private void ValidateUpgrade(StandAloneCluster cluster, int iterations, bool expectedForceRestart)
        {
            for (int i = 0; i < iterations; i++)
            {
                cluster.RunStateMachine();

                bool currentExpectedForceRestart = expectedForceRestart && i == 0;
                Assert.AreEqual(currentExpectedForceRestart, cluster.Pending.GetUpgradePolicy().ForceRestart);

                Utility.RollForwardOneIteration(cluster);
                Assert.AreEqual(cluster.Pending == null, i == iterations - 1);
            }

            Assert.IsFalse(cluster.RunStateMachine());
            Assert.IsNull(cluster.Pending);
            Assert.IsNotNull(cluster.Current);
        }
        public static void DryRunConfigUpgrade(StandAloneCluster cluster)
        {
            UpgradeOrchestrationTrace.TraceSource.WriteInfo(FabricUpgradeOrchestrationService.TraceType, "In data loss state. Starting dry run config upgrade in order to recover FUOS state");

            // 1-step baseline upgrade with non-baseline config
            if (cluster.RunStateMachine())
            {
                cluster.ClusterUpgradeCompleted();
                cluster.Reset();
                UpgradeOrchestrationTrace.TraceSource.WriteInfo(FabricUpgradeOrchestrationService.TraceType, "Dry run config upgrade completed");
            }
            else
            {
                UpgradeOrchestrationTrace.TraceSource.WriteError(FabricUpgradeOrchestrationService.TraceType, "Unexpected. Dry run config upgrade is skipped");
            }
        }