Skip to content

Batch potentially big transaction on egress firewall ACLs migration.#3463

Merged
jcaamano merged 2 commits into
ovn-kubernetes:masterfrom
npinaeva:ops-batching
Mar 9, 2023
Merged

Batch potentially big transaction on egress firewall ACLs migration.#3463
jcaamano merged 2 commits into
ovn-kubernetes:masterfrom
npinaeva:ops-batching

Conversation

@npinaeva
Copy link
Copy Markdown
Contributor

@npinaeva npinaeva commented Mar 6, 2023

The default transaction timeout is 10 seconds, it can be reached when we delete all egress firewall acls during migration to port groups from switches.

I reproduced the bug trying to delete 3M acls with random-generated UUIDs from 1 worker switch, and measured the time it takes to transact the changes on a kind cluster, here are the results:
2M(no batching) = 9.08 s
100000/batch = 7.66 s
10000/batch = 6.6 s
1000/batch = 6.97 s
Say we have 1000 nodes * 1000 ACLs ~= 1M ACLs * 1 switch = 4.38 s

That is a rough explanation for defaultBatchSize = 1000

I also updated RemoveACLsFromLogicalSwitchesWithPredicateOps to only delete acls that are present on the switch, since this op will be generated unconditionally on every sync

Comment thread go-controller/pkg/libovsdbops/switch.go Outdated
Comment thread go-controller/pkg/libovsdbops/switch.go Outdated
@npinaeva
Copy link
Copy Markdown
Contributor Author

npinaeva commented Mar 8, 2023

/retest

@npinaeva
Copy link
Copy Markdown
Contributor Author

npinaeva commented Mar 8, 2023

failed because of #3447

Comment thread go-controller/pkg/libovsdbops/switch.go Outdated
Comment thread go-controller/pkg/ovn/egressfirewall.go Outdated
Comment thread go-controller/pkg/util/batching/batch.go Outdated
Comment thread go-controller/pkg/util/batching/batch_test.go
Comment thread go-controller/pkg/util/batching/batch_test.go
npinaeva added 2 commits March 8, 2023 18:08
The default transaction timeout is 10 seconds, it can be reached
when we delete all egress firewall acls during migration to port groups
from switches.

Signed-off-by: Nadia Pinaeva <npinaeva@redhat.com>
stale acls.

Signed-off-by: Nadia Pinaeva <npinaeva@redhat.com>
Copy link
Copy Markdown
Contributor

@jcaamano jcaamano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now I am left wondering how much time we spend with this when there is actually no migration to be done. Cross-checking that none of the ACLs are referenced from any of the switches, knowing that this will be true always but once, might not be in the same order of what we would spend with the encoding but still meaningful. So perhaps the migration itself can be approached in some other manner.

Added #3471 because there are important improvements that can be made when building the operations to be sent to the server.

@jcaamano
Copy link
Copy Markdown
Contributor

jcaamano commented Mar 9, 2023

/retest-failed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants