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

add compact for release-1.12 #3342

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions charts/templates/central-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ spec:
value: "{{ .Values.networking.OVN_LEADER_PROBE_INTERVAL }}"
- name: OVN_NORTHD_N_THREADS
value: "{{ .Values.networking.OVN_NORTHD_N_THREADS }}"
- name: ENABLE_COMPACT
value: "{{ .Values.networking.ENABLE_COMPACT }}"
resources:
requests:
cpu: {{ index .Values "ovn-central" "requests" "cpu" }}
Expand Down
1 change: 1 addition & 0 deletions charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ networking:
OVN_REMOTE_PROBE_INTERVAL: 10000
OVN_REMOTE_OPENFLOW_INTERVAL: 180
OVN_NORTHD_N_THREADS: 1
ENABLE_COMPACT: false

func:
ENABLE_LB: true
Expand Down
3 changes: 3 additions & 0 deletions dist/images/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ DPDK_TUNNEL_IFACE=${DPDK_TUNNEL_IFACE:-br-phy}
ENABLE_BIND_LOCAL_IP=${ENABLE_BIND_LOCAL_IP:-true}
ENABLE_TPROXY=${ENABLE_TPROXY:-false}
OVS_VSCTL_CONCURRENCY=${OVS_VSCTL_CONCURRENCY:-100}
ENABLE_COMPACT=${ENABLE_COMPACT:-false}

# debug
DEBUG_WRAPPER=${DEBUG_WRAPPER:-}
Expand Down Expand Up @@ -3263,6 +3264,8 @@ spec:
value: "5"
- name: OVN_NORTHD_N_THREADS
value: "1"
- name: ENABLE_COMPACT
value: "$ENABLE_COMPACT"
resources:
requests:
cpu: 300m
Expand Down
3 changes: 2 additions & 1 deletion dist/images/start-db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ DEBUG_OPT="--ovn-northd-wrapper=$DEBUG_WRAPPER --ovsdb-nb-wrapper=$DEBUG_WRAPPER
echo "PROBE_INTERVAL is set to $PROBE_INTERVAL"
echo "OVN_LEADER_PROBE_INTERVAL is set to $OVN_LEADER_PROBE_INTERVAL"
echo "OVN_NORTHD_N_THREADS is set to $OVN_NORTHD_N_THREADS"
echo "ENABLE_COMPACT is set to $ENABLE_COMPACT"

# https://bugs.launchpad.net/neutron/+bug/1776778
if grep -q "3.10.0-862" /proc/version
Expand Down Expand Up @@ -496,4 +497,4 @@ ovs-appctl -t /var/run/ovn/ovnnb_db.ctl ovsdb-server/memory-trim-on-compaction o
ovs-appctl -t /var/run/ovn/ovnsb_db.ctl ovsdb-server/memory-trim-on-compaction on

chmod 600 /etc/ovn/*
/kube-ovn/kube-ovn-leader-checker --probeInterval=${OVN_LEADER_PROBE_INTERVAL}
/kube-ovn/kube-ovn-leader-checker --probeInterval=${OVN_LEADER_PROBE_INTERVAL} --enableCompact=${ENABLE_COMPACT}
10 changes: 8 additions & 2 deletions pkg/ovn_leader_checker/ovn.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ type Configuration struct {
KubeConfigFile string
KubeClient kubernetes.Interface
ProbeInterval int
EnableCompact bool
}

// ParseFlags parses cmd args then init kubeclient and conf
Expand All @@ -51,6 +52,7 @@ func ParseFlags() (*Configuration, error) {
var (
argKubeConfigFile = pflag.String("kubeconfig", "", "Path to kubeconfig file with authorization and master location information. If not set use the inCluster token.")
argProbeInterval = pflag.Int("probeInterval", DefaultProbeInterval, "interval of probing leader in seconds")
argEnableCompact = pflag.Bool("enableCompact", true, "is enable compact")
)

klogFlags := flag.NewFlagSet("klog", flag.ContinueOnError)
Expand Down Expand Up @@ -80,6 +82,7 @@ func ParseFlags() (*Configuration, error) {
config := &Configuration{
KubeConfigFile: *argKubeConfigFile,
ProbeInterval: *argProbeInterval,
EnableCompact: *argEnableCompact,
}
return config, nil
}
Expand Down Expand Up @@ -380,8 +383,11 @@ func doOvnLeaderCheck(cfg *Configuration, podName, podNamespace string) {
stealLock()
}
}
compactOvnDatabase("nb")
compactOvnDatabase("sb")

if cfg.EnableCompact {
compactOvnDatabase("nb")
compactOvnDatabase("sb")
}
}

func StartOvnLeaderCheck(cfg *Configuration) {
Expand Down
2 changes: 2 additions & 0 deletions yamls/ovn-dpdk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ spec:
value: "5"
- name: OVN_NORTHD_N_THREADS
value: "1"
- name: ENABLE_COMPACT
value: "false"
resources:
requests:
cpu: 500m
Expand Down
2 changes: 2 additions & 0 deletions yamls/ovn-ha.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ spec:
value: "5"
- name: OVN_NORTHD_N_THREADS
value: "1"
- name: ENABLE_COMPACT
value: "false"
resources:
requests:
cpu: 300m
Expand Down