Skip to content

Commit

Permalink
fix session related flags (vesoft-inc#387)
Browse files Browse the repository at this point in the history
  • Loading branch information
MegaByte875 committed Nov 6, 2023
1 parent a2b1866 commit 4e4bc69
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 0 additions & 2 deletions apis/apps/v1alpha1/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ var DynamicFlags = map[string]string{
"rebuild_index_part_rate_limit": "4194304",
"prioritize_intra_zone_reading": "false",
"stick_to_intra_zone_on_failure": "false",
"sync_meta_when_use_space": "false",
"validate_session_timestamp": "true",
}

const (
Expand Down
5 changes: 4 additions & 1 deletion pkg/controller/component/graphd_updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ func (g *graphUpdater) Update(
return nil
}

if nc.Status.Metad.Phase == v1alpha1.UpdatePhase {
if nc.Status.Metad.Phase == v1alpha1.UpdatePhase ||
nc.Status.Storaged.Phase == v1alpha1.UpdatePhase ||
nc.Status.Storaged.Phase == v1alpha1.ScaleInPhase ||
nc.Status.Storaged.Phase == v1alpha1.ScaleOutPhase {
return setLastConfig(oldUnstruct, newUnstruct)
}

Expand Down
6 changes: 3 additions & 3 deletions pkg/controller/component/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ func syncConfigMap(
if cfg != nil {
namespace := component.GetNamespace()
clusterName := component.GetClusterName()
flags := staticFlags(cfg)
klog.V(3).Infof("cluster [%s/%s] sync %s configmap with custom static configs %v", namespace, clusterName,
flags := staticOrStartupFlags(cfg)
klog.V(3).Infof("cluster [%s/%s] sync %s configmap with custom static or startup configs %v", namespace, clusterName,
component.ComponentType().String(), flags)
customConf := config.AppendCustomConfig(template, flags)
cm.Data[cmKey] = customConf
Expand All @@ -213,7 +213,7 @@ func syncConfigMap(
return cm, cmHash, nil
}

func staticFlags(config map[string]string) map[string]string {
func staticOrStartupFlags(config map[string]string) map[string]string {
static := make(map[string]string)
for k, v := range config {
if _, ok := v1alpha1.DynamicFlags[k]; !ok {
Expand Down

0 comments on commit 4e4bc69

Please sign in to comment.