diff --git a/controllers/druid/handler.go b/controllers/druid/handler.go index 40d348b4..01c2f51e 100644 --- a/controllers/druid/handler.go +++ b/controllers/druid/handler.go @@ -41,6 +41,8 @@ const ( finalizerName = "deletepvc.finalizers.druid.apache.org" ) +//Initialize the slice to store node-specific unique identity strings for historical tiers +var historicalTierList []string var logger = logf.Log.WithName("druid_operator_handler") func deployDruidCluster(sdk client.Client, m *v1alpha1.Druid, emitEvents EventEmitter) error { @@ -119,6 +121,19 @@ func deployDruidCluster(sdk client.Client, m *v1alpha1.Druid, emitEvents EventEm } } + for _, elem := range allNodeSpecs { + if !m.Spec.RollingDeploy { + break + } + + key := elem.key + if elem.spec.NodeType == historical { + nodeSpecUniqueStr := makeNodeSpecificUniqueString(m, key) + historicalTierList = append(historicalTierList, nodeSpecUniqueStr) + } + } + + for _, elem := range allNodeSpecs { key := elem.key nodeSpec := elem.spec @@ -204,6 +219,16 @@ func deployDruidCluster(sdk client.Client, m *v1alpha1.Druid, emitEvents EventEm } } + // In case of rollingDeploy, check if each historical tier has been successfully deployed before moving on + if m.Spec.RollingDeploy && elem.spec.NodeType == historical { + for _, historicalTier := range historicalTierList { + done, err := isObjFullyDeployed(sdk, nodeSpec, nodeSpecUniqueStr, m, func() object { return makeStatefulSetEmptyObj() }, emitEvents) + if !done { + return err + } + } + } + // Create/Update StatefulSet if stsCreateUpdateStatus, err := sdkCreateOrUpdateAsNeeded(sdk, func() (object, error) {