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

lib: nb: call child destroy CBs when YANG container is deleted #18082

Merged

Conversation

choppsv1
Copy link
Contributor

@choppsv1 choppsv1 commented Feb 11, 2025

Previously the code was only calling the child destroy callbacks if the target deleted node was a non-presence container. We now add a flag to the callback structure to instruct northbound to perform the rescursive delete.

  • Fix wrong relative path lookup in keychain destroy callback

@idryzhov
Copy link
Contributor

While it should work and convenient for the developers, it can be very suboptimal. For example, you have a staticd frr-rt:control-plane-protocol instance with 100k routes, and you delete this instance. Current code handles it in a single operation, which I guess is much faster than executing 100k individual callbacks (actually much much more because there are dozens of individual leafs in each static route and each will be deleted individually).

I would at least test the time difference for this scenario as it can be really huge. Maybe it makes sense to make recursive deletion optional, to use in cases where thousands of child nodes are not expected.

Copy link
Contributor

@idryzhov idryzhov left a comment

Choose a reason for hiding this comment

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

Left a comment above that should be at least discussed before merging this.

@choppsv1 choppsv1 force-pushed the chopps/fix-yang-config-destroy branch from 1d54f5d to abcb177 Compare February 13, 2025 04:28
@frrbot frrbot bot added the staticd label Feb 13, 2025
@github-actions github-actions bot added size/M and removed size/S labels Feb 13, 2025
@choppsv1 choppsv1 force-pushed the chopps/fix-yang-config-destroy branch from abcb177 to be33c2d Compare February 13, 2025 04:29
@choppsv1 choppsv1 marked this pull request as draft February 13, 2025 06:13
@choppsv1 choppsv1 force-pushed the chopps/fix-yang-config-destroy branch 2 times, most recently from a8b32e2 to 707c547 Compare February 13, 2025 08:28
@idryzhov idryzhov dismissed their stale review February 14, 2025 18:10

Looks fine with an optional flag. Not approving yet because the PR is in draft state.

@choppsv1 choppsv1 marked this pull request as ready for review February 14, 2025 18:11
Previously the code was only calling the child destroy callbacks if the target
deleted node was a non-presence container. We now add a flag to the callback
structure to instruct northbound to perform the rescursive delete for code that
wishes for this to happen.

- Fix wrong relative path lookup in keychain destroy callback

Signed-off-by: Christian Hopps <chopps@labn.net>
@choppsv1 choppsv1 force-pushed the chopps/fix-yang-config-destroy branch from 707c547 to d03ecf4 Compare February 14, 2025 18:15
@github-actions github-actions bot added the rebase PR needs rebase label Feb 14, 2025
@Jafaral Jafaral merged commit 4315f2e into FRRouting:master Feb 18, 2025
13 checks passed
@Jafaral
Copy link
Member

Jafaral commented Feb 18, 2025

@Mergifyio backport dev/10.3 stable/10.2

Copy link

mergify bot commented Feb 18, 2025

backport dev/10.3 stable/10.2

✅ Backports have been created

Jafaral added a commit that referenced this pull request Feb 18, 2025
lib: nb: call child destroy CBs when YANG container is deleted (backport #18082)
Jafaral added a commit that referenced this pull request Feb 18, 2025
lib: nb: call child destroy CBs when YANG container is deleted (backport #18082)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants