-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Interface validation failures when issuing "interface VlanXYZ" command #5718
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
Comments
After removing the running-config changes in if_update_to_new_vrf() function, lib/if.c, this issue is no longer seen (the below code under HACK comment was removed). I see that the running-config does show correct VRF binding, even after removing this code. But, not sure what else would break by removing this change. Any inputs/suggestions? /*
|
@santoshdoke thanks for reporting this issue. I have a pending optimization commit that completely ditches the |
Hi @rwestphal, any updates on this? |
Hi @santoshdoke, can you, please, check if my PR #5999 fixes your issue? |
Commit ccd43ad introduced a hash table in the northbound layer to optimize the management of users pointers associated to YANG configuration nodes (like containers and lists). While that optimization was enormously effective, it introduced the following two problems: * Increased memory usage of 264 bytes per configuration node. This might not seem like much, but it can account for hundreds of megabytes for large configurations (e.g. thousands of route-maps and ACLs). * Inconsistencies in the hash table when configuration changes come from the kernel (bypassing the normal transactional process). This in turns leads to problems like the northbound rejecting valid configuration changes. The solution consists of reverting parts of commit ccd43ad (the hash table bits) and introducing the yang_dnode_replace() function. This function was designed to replace one YANG data node by another one, doing the least amount of work possible. The idea is to optimize the common use case of reading one configuration command at time when parsing the startup configuration. Normally replacing one configuration with 1000 commands by another one with 1001 commands meant freeing the first one and duplicating the second, both expensive operations. Now we compare config A with config B and change only the parts of A that need to be changed. The nice side effect of this optimization is that the existing user pointers in the original configuration are not lost during the replace operation. In other words, we can use the 'priv' pointer of the 'lyd_node' structure again since they are persistent now. This means the 'running_config_entries' hash table isn't necessary anymore and can be removed. Fixes FRRouting#5718. Signed-off-by: Renato Westphal <[email protected]>
Commit ccd43ad introduced a hash table in the northbound layer to optimize the management of users pointers associated to YANG configuration nodes (like containers and lists). While that optimization was enormously effective, it introduced the following two problems: * Increased memory usage of 264 bytes per configuration node. This might not seem like much, but it can account for hundreds of megabytes for large configurations (e.g. thousands of route-maps and ACLs). * Inconsistencies in the hash table when configuration changes come from the kernel (bypassing the normal transactional process). This in turns leads to problems like the northbound rejecting valid configuration changes. The solution consists of reverting parts of commit ccd43ad (the hash table bits) and introducing the yang_dnode_replace() function. This function was designed to replace one YANG data node by another one, doing the least amount of work possible. The idea is to optimize the common use case of reading one configuration command at time when parsing the startup configuration. Normally replacing one configuration with 1000 commands by another one with 1001 commands meant freeing the first one and duplicating the second, both expensive operations. Now we compare config A with config B and change only the parts of A that need to be changed. The nice side effect of this optimization is that the existing user pointers in the original configuration are not lost during the replace operation. In other words, we can use the 'priv' pointer of the 'lyd_node' structure again since they are persistent now. This means the 'running_config_entries' hash table isn't necessary anymore and can be removed. Fixes FRRouting#5718. Signed-off-by: Renato Westphal <[email protected]>
Commit ccd43ad introduced a hash table in the northbound layer to optimize the management of users pointers associated to YANG configuration nodes (like containers and lists). While that optimization was enormously effective, it introduced the following two problems: * Increased memory usage of 264 bytes per configuration node. This might not seem like much, but it can account for hundreds of megabytes for large configurations (e.g. thousands of route-maps and ACLs). * Inconsistencies in the hash table when configuration changes come from the kernel (bypassing the normal transactional process). This in turns leads to problems like the northbound rejecting valid configuration changes. The solution consists of reverting parts of commit ccd43ad (the hash table bits) and introducing the yang_dnode_replace() function. This function was designed to replace one YANG data node by another one, doing the least amount of work possible. The idea is to optimize the common use case of reading one configuration command at time when parsing the startup configuration. Normally replacing one configuration with 1000 commands by another one with 1001 commands meant freeing the first one and duplicating the second, both expensive operations. Now we compare config A with config B and change only the parts of A that need to be changed. The nice side effect of this optimization is that the existing user pointers in the original configuration are not lost during the replace operation. In other words, we can use the 'priv' pointer of the 'lyd_node' structure again since they are persistent now. This means the 'running_config_entries' hash table isn't necessary anymore and can be removed. Fixes FRRouting#5718. Signed-off-by: Renato Westphal <[email protected]>
As discussed on the #yang channel, it turns out this problem was caused by a bug in the libyang cache mechanism (please see CESNET/libyang#1048). The solution is to update to the latest libyang from the Thanks @santoshdoke and @idryzhov for reporting and helping to fix this problem. I'll close this issue now. |
When issuing interface command, a validation error is seen intermittently. This is on FRR 7.2 stable version + fix from #5513.
interface Vlan1301
% Configuration failed: validation error.
#zebra[40]: lib_interface_destroy: only inactive interfaces can be deleted
#zebra[40]: [EC 100663331] nb_callback_configuration: error processing configuration change: error [validation error] event [validate] operation [destroy] xpath [/frr-interface:lib/interface[name='Vlan1301'][vrf='Vrf_RED']]
(put "x" in "[ ]" if you already tried following)
[x ] Did you check if this is a duplicate issue?
[ ] Did you test it on the latest FRRouting/frr master branch?
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Interface command should succeed.
Versions
Additional context
Validation failure is from this back trace. Since the interface is active, the lib_interface_destroy() returns failure. Not sure if this the interface destroy is expected to be called for "interface Vlan1301" command. Suspect there may be some timing issue with VRF update (fix in 5513) and the running config diffs.
(gdb) bt
#0 lib_interface_destroy (event=NB_EV_VALIDATE, dnode=0x555dcacf2cb0) at lib/if.c:1444
#1 0x00007f488f190ad0 in nb_callback_configuration (event=event@entry=NB_EV_VALIDATE,
#2 0x00007f488f190c1d in nb_candidate_validate_changes (changes=changes@entry=0x7fff878ae1b0,
#3 0x00007f488f190e74 in nb_candidate_commit_prepare (candidate=0x555dcaac33d0,
#4 0x00007f488f191166 in nb_candidate_commit (candidate=,
#5 0x00007f488f193d7c in nb_cli_apply_changes (vty=vty@entry=0x555dcacf3df0,
#6 0x00007f488f17e650 in interface_magic (self=, argc=,
#7 interface (self=, vty=0x555dcacf3df0, argc=,
#8 0x00007f488f167e8d in cmd_execute_command_real (vline=vline@entry=0x555dcab2e5a0,
#9 0x00007f488f16a0cf in cmd_execute_command (vline=vline@entry=0x555dcab2e5a0,
#10 0x00007f488f16a235 in cmd_execute (vty=vty@entry=0x555dcacf3df0,
#11 0x00007f488f1ba912 in vty_command (vty=vty@entry=0x555dcacf3df0,
#12 0x00007f488f1bab96 in vty_execute (vty=vty@entry=0x555dcacf3df0) at lib/vty.c:1285
---Type to continue, or q to quit---
#13 0x00007f488f1bd4ec in vtysh_read (thread=) at lib/vty.c:2119
#14 0x00007f488f1b5550 in thread_call (thread=thread@entry=0x7fff878b0de0) at lib/thread.c:1540
#15 0x00007f488f1858a8 in frr_run (master=0x555dcaa4b9c0) at lib/libfrr.c:1054
#16 0x0000555dca19accb in main (argc=10, argv=0x7fff878b11e8) at zebra/main.c:480
The text was updated successfully, but these errors were encountered: