Commit 95ce88c
CVL Infra Enhancments and Fixes
1. Enhancement - Support TABLE keys modelled as container
2. Enhancement - DBAL CountKeysPattern API
3. Optimisation: removing libyang syntax checks for Full entry delete
4. Enhancement - CVL support for SONiC YANG table with distinct YANG
4.1 Enhancement - For multi-list tables correct Redis pattern and sep
are matched and picked.
4.2 Fix - The cvl code to build table expression based on YANG list name
instead of table name.
4.3 Fix - CVL maintains tableInfo using a LIST name, fixed the
inconsistent
4.4 Enhancement - code to lookup using list name instead of table name.
4.5 Fix - recognition of table and fields if the table contains mutiple
lists and if table name as prefix is not present in any of the list
name
5. Optimisation: removing extra checks in CVL for non existing fields
for update operation
6. Fixes: CVL does not honours "not equal" operator in must expression
predicate
7. Fixes: clear depDataCache along with semantic cache, when CVL
validation completes for clen state.
```text
CVL maintains a separate cache to check if dependent data is already
to
the semantic cache. If the entry is present in this cache, the
semantic
cache is not updated.
When we clear clear the semantic cache after every
ValidateEditConfig
we also need to clear depDataCache.
```
8. Fixes: clear Xpath engine cache.
```text
CVL maintains a seesion level cache for semantic validation, this
cache generates entry for table each time they are operated on.
As a result this cache contains duplicate entries for a table
and in some cases it creates a stale entries for leaf, if they are
deleted in the Latest request.
```
9 Fixes: stale entries in semantic documents
```text
CVL maintains a cache of semantic document at the session level.
If Delete for an entry is successful, the cache
still contains a deleted entry, this is resulting in must expression
failure for count cases, the logic in count() considers this entry
in to
consideration. Therefore cache is cleared for the deleted entry.
- Also modified addYangDataForMustExp() to avoid using global cache
and use CVL wrapper for DBAL.
- Modified fetchTableDataToTmpCache() to use CVL wrapper for DBAL's
pipeline.
```
10: Fixes: Incorrect match for depdata in checkDeleteInRequestCache
```text
For find in request key, case - T2*|K1. If the non-delete
configuration exists
for dependent data in the Requestcache, its getting matched, and cvl
considers
its already present in deleteCache and therefore ignores validation.
modified the condition to match only if entry is deleted.
Further enhanced the code for find in request hash-field case -
T2*|K2:{H1: K1}
to match correcly for UPDATE cases. Also in case of leaflist.
```
11: Enhancement: Use DBAL's CVL wrapper for pipeline - All pipelines
were modified use CVL's DB wrapper.
12: Enhancement: Use CVL's DB wrapper in validateLeafref and fixes for
multi-key table instance
13: Fixes - handle incremental build and stale files removal - Fixed yin
generator
```text
Tool does not write if the file is not modified and writes only when
yin modified or added as new.
Also it removes any stale yin files (if present)
```
14. Enhancement: min-elements support for leaf-list
15. Enhancement - Advanced search functions in cvl DBAccess
16. Go test enhancements
17. Update the test YANGs with more complex cases.
18. Enhancement: changes to the count and filter lua scripts to check
both the db and candidate config data; modified the count and lookup
19. Enhancement: Added Pipe query support for HGetAll, HGet, HMGet;
NewValidationSession, cvlDBAccess changes, removing
validatedDataQuery
20. Fixes: Modify the session cache type from interface to
map[string]interface in the custom validations, and used specific
cache key name to access its own cache to avoid overwriting the same
cache object by other module validation code
21. Enhancement: Added DB access adapter like APIs for redis APIs in CVL
layer to access the DB access methods from the CVL layer.
22. Fixes: Added support for NULL field in the Keys, Exists API, fixed
merging issue in HGetAll, HGet, HMGet in case of delete operation
type
23. Fixes: Made changes to handle the redis.Nil error returned by redis
client API.
24. Fixes: Leafref check should check for all DELETE and CREATE of
referred configs in request cache.
25. Fixes: Removed DB ping call in CVL whenever a new DB client is
created.
26. Enhacement: Debugging and log enhancement.
27. Enhancement: CVL logs to appear in Rest-server logs.
28. Improved CVL performance for bulk configs like ACL rules creation.
```text
For evaluation of leafref, When and Must expressions, CVL queries
dependent data and merge with config data and prepares im-memory XML
to
be evaluated by XPath engine. The 'addDependentData" call was adding
same dependent data multiple whenever it has to evaluate leafref,
when
or must expression. When multiple ACL Rules within same Acl-set are
configured in single request, CVL was adding Acl-set multiple times
dues
to which XML size becomes too huge and XPath engines takes long to
evaluate. For 750 Acl rules creation there is 95% improvement in
performance.
```
29. Added support for multiple custom validation callbacks per node in
CVL
30. Fixes: or Replace operations, before performing semantic validation
on Update request, delete fields from yang tree that are provided
with Delete request.
31. Enhancement: Added new extension to define dependency between
tables.
```text
This new extension 'dependent-on <list-name>' has to be used when
dependencies between tables can't
be defined using leafref.
This has to be added under list.
It should not be used under container or leaf/leaf-list nodes.
Only one list-name can be added to this extension.
```
32. Fixes: When mandatory node is getting deleted during cascade-delete,
entire entry to be deleted. So find dependent entries in this entry
and mark them too for delete.
33. Fixed memory leak observed in CVL CGo code that uses libyang third
party library for Syntax validation.
Co-authored-by: Mohammed Faraaz C <[email protected]>
Co-authored-by: Sachin Holla <[email protected]>
Co-authored-by: Balachandar Mani <[email protected]>
Co-authored-by: Mayank Maheshwari <[email protected]>
Co-authored-by: Shyam Mohan <[email protected]>1 parent a16b59b commit 95ce88c
File tree
56 files changed
+6424
-3865
lines changed- cvl
- common
- custom_validation
- internal
- util
- yparser
- testdata/schema
- tests
- tools
- models/yang/sonic/common
- patches
- translib
- db
- transformer
- utils
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
56 files changed
+6424
-3865
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
94 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
95 | 97 | | |
96 | 98 | | |
97 | 99 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
25 | 31 | | |
26 | 32 | | |
27 | | - | |
28 | | - | |
| 33 | + | |
| 34 | + | |
29 | 35 | | |
30 | 36 | | |
31 | 37 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
38 | 42 | | |
39 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
40 | 48 | | |
41 | | - | |
| 49 | + | |
42 | 50 | | |
43 | 51 | | |
44 | 52 | | |
45 | 53 | | |
46 | | - | |
47 | | - | |
48 | 54 | | |
49 | 55 | | |
50 | 56 | | |
51 | 57 | | |
52 | | - | |
53 | | - | |
54 | | - | |
| 58 | + | |
55 | 59 | | |
56 | 60 | | |
57 | 61 | | |
58 | 62 | | |
59 | 63 | | |
60 | | - | |
| 64 | + | |
61 | 65 | | |
62 | 66 | | |
63 | 67 | | |
64 | 68 | | |
65 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
66 | 74 | | |
67 | 75 | | |
68 | 76 | | |
69 | 77 | | |
70 | | - | |
| 78 | + | |
71 | 79 | | |
72 | 80 | | |
73 | 81 | | |
74 | 82 | | |
75 | 83 | | |
76 | 84 | | |
77 | | - | |
78 | | - | |
79 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
80 | 95 | | |
81 | 96 | | |
82 | 97 | | |
83 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
84 | 102 | | |
85 | 103 | | |
86 | 104 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
29 | | - | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
| |||
101 | 102 | | |
102 | 103 | | |
103 | 104 | | |
104 | | - | |
| 105 | + | |
| 106 | + | |
105 | 107 | | |
106 | 108 | | |
107 | 109 | | |
| |||
112 | 114 | | |
113 | 115 | | |
114 | 116 | | |
115 | | - | |
| 117 | + | |
116 | 118 | | |
117 | 119 | | |
118 | 120 | | |
| |||
137 | 139 | | |
138 | 140 | | |
139 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
0 commit comments