Skip to content

Conversation

@huntergregory
Copy link
Contributor

@huntergregory huntergregory commented Mar 31, 2022

dramatically improves apply time for medium to large scale.

Previously, we would parse through an ipset save file for every batch dataplane operation. We can forego that by maintaining member diff for our ipset dirty cache.

New dirty cache adds robustness to all combinations of create/add/del/destroy calls. Windows doesn't need to maintain member diff by nature of HNS.

@huntergregory huntergregory added the npm Related to NPM. label Mar 31, 2022
@huntergregory huntergregory marked this pull request as draft March 31, 2022 00:32
@huntergregory huntergregory force-pushed the npm-logs-and-ipset-restore-speed branch 3 times, most recently from 23f8c0b to b95cf6e Compare March 31, 2022 17:35
@huntergregory huntergregory force-pushed the npm-logs-and-ipset-restore-speed branch from 0dd7e58 to bab47ba Compare April 11, 2022 23:26
@huntergregory huntergregory marked this pull request as ready for review April 13, 2022 17:55
@huntergregory huntergregory requested a review from a team as a code owner April 13, 2022 17:55
@huntergregory huntergregory requested review from matmerr and removed request for a team April 13, 2022 17:55

// NOTE: duplicate code in the first step in this function and fileCreatorForApplyWithSaveFile
func (iMgr *IPSetManager) fileCreatorForApply(maxTryCount int) *ioutil.FileCreator {
creator := ioutil.NewFileCreator(iMgr.ioShim, maxTryCount, ipsetRestoreLineFailurePattern) // TODO make the line failure pattern into a definition constant eventually
Copy link
Member

Choose a reason for hiding this comment

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

should we persist these creators within the ipsetmanager to avoid creating these in both this and fileCreatorForApplyWithSaveFile?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

talked offline. rough to duplicate a lot between the functions but no clean solution

Copy link
Contributor

@vakalapa vakalapa left a comment

Choose a reason for hiding this comment

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

Great work, this improves our perf by about 10x !! :shipit:

@vakalapa vakalapa merged commit 3b876d4 into master Apr 19, 2022
@vakalapa vakalapa deleted the npm-logs-and-ipset-restore-speed branch April 19, 2022 01:03
matmerr pushed a commit to matmerr/azure-container-networking that referenced this pull request Jun 29, 2022
* wip

* fix member update

* fix hashed name bug

* fix hashed name bug and bug for original members for delete cache

* fix delete bug

* print cache in logs again

* some UTs

* dirty cache UTs

* fix windows build problem

* dirty cache with members to add/delete & keep old apply with save file code

* fix windows

* fix windows 2

* fix windows 3

* UTs and dirty cache in same struct shared between each OS

* fix windows build

* change some error situations to valid situations

* log clean up and addressing comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

npm Related to NPM.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants