Subject: Re: [yang-doctors] require-instance statement in 6020 bis

From: Benoit Claise <[email-masked]>
Date: Wed, 29 Jun 2016 07:29:59 +0200

On 6/11/2016 8:59 AM, Martin Bjorklund wrote:
> Mahesh Jethanandani <[email-masked]> wrote:
>> I am curious why we decided that if the type is “instance-identifier”
>> or “leafref”, that the require-instance statement would take a default
>> value of true. That as the draft says, is that even if the statement
>> is not present, require-instance will be true. It also means that
>> require-instance is there really to turn off doing a check.
>>
>>  From an implementation perspective, it means that if the referred to
>> node does not exist in the request itself, the system has to make a
>> query into the running db for every leafref or
>> instance-identifier. That is an expensive operation to perform,
>> particularly if there are large instances of leafref. I can understand
>> that it is the safe thing to do, but it is expensive.
> A naive implementation that always checks all references will be
> expensive, yes.  But this area is wide open for various
> optimizations...
>
> Even w/ require-instance false, the node is a reference to something.
> This means that the instrumentation code still needs to check if the
> referred to node exists, and if it doesn't exit, it needs to do something
> well-defined - which btw needs to be documented.  [NOTE: this should
> be a yang-doctor review check - make sure that the behavior for any
> require-instance false node is well defined.]
Should it be part of RFC6087bis, if not already?
*Guidelines for Authors and _Reviewers _of YANG Data Model Documents*

Regards, Benoit
>
>
>
> /martin
>
>> Would it have made sense to make require-instance be set to default of
>> false, and have model specifically request for it to be true where it
>> needed the check? Have implementations tried measuring the impact of
>> this change?
>>
>> Mahesh Jethanandani
>> [email-masked]
>>
>>
>>
>>
>>
> _______________________________________________
> yang-doctors mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/yang-doctors