Hi, I am facing performance issue while using leafref in my yang model.
Following is a simpler version similar to the yang model I am using
list a1{
key name;
leaf name {
type string;
}
list a2{
key id;
leaf id {
type uint16;
}
container a3{
container a4{
leaf mirror {
type leafref {
path "/M:b1/M:stringTOindex[M:vname = current()/../../../../name]/M:a2/M:id";
}
}
}
}
}
}
container b1{
list stringTOindex {
key vname;
leaf vname {
type string;
}
list a2{
key id;
leaf id {
type uint16;
}
container a3{
container a4{
leaf mirror {
type uint16;
}
}
}
}
}
I have created 2 entries of a1. e.g v1 and v2.
The same will be set in the list as b1.stringTOindex[0].vname=v1 and b1.stringTOindex[1].vname=v2
For v1 and v2; i have following config
a1[0].name = v1
a1[1].name = v2
a1[1].a2[0].id = 10
a1[1].a2[1].id = 20
a1[1].a2[2].id = 30
Now, when i run “no command” for v1 e,g “no a1 v1”; it iterates though v2 also till the mirror leaves for all the 3 ids. In such case, for thousands of a1 entries; to delete 1 entry; it will go through all other entries.
If i remove the leafref in mirror leaf I dont see the iteration. To fix this temporarily; I have added validate function. However, it does not give me the cli display options while doing tab at mirror.
So, i need help to understand and fix this issue. Why leafref is making it iterate through all the existing a1 enties; where as we are concerned about id inside a particular a1 entry.
Following is the snippet of the log
confd commit progress db=running usid=18 thandle=139: validate: validation over the change set done
confd commit progress db=running usid=18 thandle=139: validate: run dependency-triggered validation...
get_next request for callpoint a1View path /A:B/a1
get_next succeeded for callpoint a1View path /A:B/a1
get_next request for callpoint a1View path /A:B/a1{v2}/a2
get_next succeeded for callpoint a1View path /A:B/a1{v2}/a2
get_elem request for callpoint a1View path /A:B/a1{v2}/a2{10}/a3/a4/mirror
get_elem succeeded for callpoint a1View path /A:B/a1{v2}/a2{10}/a3/a4/mirror
get_next request for callpoint a1View path /A:B/a1{v2}/a2
get_next succeeded for callpoint a1View path /A:B/a1{v2}/a2
get_elem request for callpoint a1View path /A:B/a1{v2}/a2{20}/a3/a4/mirror
get_elem succeeded for callpoint a1View path /A:B/a1{v2}/a2{20}//a3/a4/mirror
get_next request for callpoint a1View path /A:B/a1{v2}/a2
get_next succeeded for callpoint a1View path /A:B/a1{v2}/a2
get_elem request for callpoint a1View path /A:B/a1{v2}/a2{30}//a3/a4/mirror
get_elem succeeded for callpoint a1View path /A:B/a1{v2}/a2{30}/a3/a4/mirror
get_next request for callpoint a1View path /A:B/a1{v2}/a2
get_next succeeded for callpoint a1View path /A:B/a1{v2}/a2
get_next request for callpoint a1View path /A:B/a1
get_next succeeded for callpoint a1View path /A:B/a1
confd commit progress db=running usid=18 thandle=139: validate: dependency-triggered validation done