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

Transformer enhancements and bug fixes #35

Merged
merged 1 commit into from Nov 11, 2020

Conversation

kwangsuk
Copy link
Contributor

@kwangsuk kwangsuk commented Nov 4, 2020

  1. Optimize transformer for GET performance
  • For any request URI and its children, table-name & db-key are queried for the first time and cached internally by the transformer infra. This cache block will be subsequently referred by the infra to avoid redundant callback invocations while the yang model tree is being traversed for GET operation. The cache block is local & valid for a single transaction.
  • Data from Redis DB is queried only once for a table & cached in the infra for further reference. This cache is local & valid for a single transaction
  1. On-change, sample based subscription support for gNMI
    On receipt of subscription request uri, the transformer infra translates it to corresponding Redis Db-table and key, using YANG extensions and provides this info along with other subscription parameters to the translib, which takes care of sending notifications on-change of table/key. YANG extensions introduced : "subscribe-preference", "subscribe-on-change", "subscribe-min-interval".
  2. rpc callback support
    RPC statements defined in both OpenConfig and SONiC yang can be annotated with YANG extension “rpc-callback” to invoke the callback to take an action for the given rpc node
  3. YANG default value support
    Infra has been enhanced to fill the oc yang defaults by referring internal yang-metadata for terminal nodes, if it is not present in the request payload. These defaults will be pushed along with other payload data when a resource is created.
  4. RFC compliance support - resource check etc.
    Parent resource is checked for CRUD and GET requests for the incoming URI, before processing the request. If the parent resource is not available in DB, the transaction is rejected with 404 / "Resource not found" error.
  5. Cascade delete to de-configure all related nodes
    Cascade delete enables dependent config clean up for a DELETE request, based on SONiC yang table dependency.
    YANG extension "cascade-delete" can be annotated to a node that can be deleted along with all dependent nodes.
  6. value xfmr callback
    The value-xfmr callback supports data conversion before writing into the DB for CRUD request and after reading from DB for GET request. Value-xfmr annotated for a leaf will also be invoked, for all other leaves having a leaf-ref to it.
    The value-xfmr callback is valid only for the SONIC yang.
  7. Operation and tables ordering, dependent tables watch list
    For a set of DB table/instances, grouped by operation, resulting from processing a request URI, infra supports the following :
  • CRUD Operation ordering,
  • sequencing tables before operating based on sonic-yang/Redis dependencies
  • providing translib, with a list of Redis-tables to watch for changes, when performing operations on dependent tables.
  1. Yang model capability
    Provide yang module name, organization and version information to translib in order to serve model capability request.
  2. Miscellaneous bug fixes

@renukamanavalan renukamanavalan merged commit 4acb2c3 into sonic-net:master Nov 11, 2020
@kwangsuk kwangsuk deleted the transformer_update branch November 13, 2020 17:14
dell-engops pushed a commit to project-arlo/sonic-mgmt-common that referenced this pull request Nov 9, 2022
* Fix for SNC-15818 and SNC-16412

* Self review comments

Co-authored-by: Gokulnath Raja <g_raja@dell.com>
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.

None yet

2 participants