Create egress firewall with one db transaction #3847
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This should improve the time it takes to create an egressfirewall.
Transaction size is limited to 8000 acls, which should be fine based on https://github.com/ovn-org/ovn-kubernetes/blob/master/go-controller/pkg/ovn/external_ids_syncer/acl/acl_sync.go#L58-L60
but should be verified for older version is case of backporting
To test, use 8000-rule egressfirewall https://gist.github.com/npinaeva/7af14f6aa3234694c6d0e082e6c58d14 and find ovnkube-master or ovnkube-controller log
Creating *v1.EgressFirewall <namespace>/default took: <n>s
in local testing, before change the result is
31.372159307s
, after change2.599303302s
(with db logging enabled, which takes extra time)