Skip to content

Read tables in insertion order in ConfigDBConnector.mod_config() #1043

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jmlu-arista
Copy link

When the SWSS SDK was ported to C++, one of the effects is that the map of tables passed in to mod_config() is now converted to a std::map by SWIG. Iteration over std::map always happens in lexical order of the table names, which causes issues for frrcfgd when one table depend on the contents of the another (e.g. PREFIX depends on PREFIX_SET, but PREFIX sorts before PREFIX_SET.)

This adds an overload to mod_config() that takes in an unsorted_map of the config data, along with a vector specifying the order in which to read the tables. The Python implementation is adjusted to always use the new function, to preserve the dictionary insertion order.

Fixes sonic-net/sonic-buildimage#22974

When the SWSS SDK was ported to C++, one of the effects is that the map of tables passed in to mod_config() is now converted to a std::map by SWIG. Iteration over std::map always happens in lexical order of the table names, which causes issues for frrcfgd when one table depend on the contents of the another (e.g. PREFIX depends on PREFIX_SET, but PREFIX sorts before PREFIX_SET.)

This adds an overload to mod_config() that takes in an unsorted_map of the config data, along with a vector specifying the order in which to read the tables. The Python implementation is adjusted to always use the new function, to preserve the dictionary insertion order.

Fixes sonic-net/sonic-buildimage#22974
Copy link

linux-foundation-easycla bot commented Jul 15, 2025

CLA Signed


The committers listed above are authorized under a signed CLA.

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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.

Bug: frrcfgd fails to apply config if PREFIX_SET and PREFIX tables are updated together
2 participants