Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding checks to ensure historical tiers also undergo rollingDeploy and do not deploy in parallel #347

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions controllers/druid/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down