Re: [netmod] Backward Compatibility Question

Kent Watsen <kwatsen@juniper.net> Mon, 02 October 2017 16:31 UTC

Return-Path: <kwatsen@juniper.net>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 61D231344C6 for <netmod@ietfa.amsl.com>; Mon, 2 Oct 2017 09:31:39 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.02
X-Spam-Level:
X-Spam-Status: No, score=-2.02 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=juniper.net
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Bd3V95smBhY9 for <netmod@ietfa.amsl.com>; Mon, 2 Oct 2017 09:31:37 -0700 (PDT)
Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0124.outbound.protection.outlook.com [104.47.40.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 261E313234B for <netmod@ietf.org>; Mon, 2 Oct 2017 09:31:37 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=juniper.net; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=h1t4K2kFAX/vsoMgQfvcs1nyVnWhlwPInAU+i1Z1zug=; b=B+7xhPApIPWe1epNhmRFmUf435tv5hqc1eYpiya/JzYxE+gwEzaabHL6zjtgR2d1YhPhAVAw3YjsrXg4USkvUUnZjXpvrTYh7tKJRz8gjBA2f7T6h93J84qv1Jc/0nau1oYKcF5iHKedc42grfnrs80dkclwD7iGwJ7tkwWCZG0=
Received: from BLUPR05MB275.namprd05.prod.outlook.com (10.141.22.149) by BLUPR05MB273.namprd05.prod.outlook.com (10.141.22.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.35.3; Mon, 2 Oct 2017 16:31:35 +0000
Received: from BLUPR05MB275.namprd05.prod.outlook.com ([10.141.22.149]) by BLUPR05MB275.namprd05.prod.outlook.com ([10.141.22.149]) with mapi id 15.20.0035.010; Mon, 2 Oct 2017 16:31:35 +0000
From: Kent Watsen <kwatsen@juniper.net>
To: JOEY BOYD <joey.boyd@adtran.com>, "'netmod@ietf.org'" <netmod@ietf.org>
Thread-Topic: [netmod] Backward Compatibility Question
Thread-Index: AQHTO5vpie9AP8VEQcaGGyl32renDQ==
Date: Mon, 02 Oct 2017 16:31:35 +0000
Message-ID: <F0EED155-D776-4B3A-9C95-6F7682244AD7@juniper.net>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
user-agent: Microsoft-MacOutlook/f.20.0.170309
x-originating-ip: [66.129.241.12]
x-ms-publictraffictype: Email
x-microsoft-exchange-diagnostics: 1; BLUPR05MB273; 6:ta3QCUK3dpLIDGdhtPmiKFNhqvrHgT3RRGVajHKAIXKM4hUlY8ss2DGZK2G6L3jEFh4/oghUAk7hHioB6UZniqpZKlql+vqZUMQMjn0VisnkXNw/LCkbYzJ6l07iH0t2k70/hoPaQwk2USo/BWaymqIwexXliSafrl7Vw33f740rRCpm9+7AzUfcOuyjRyQSR5BfqZvpYE6f9LSUsd/GCbHgj5/oltUppml+7DZCQmxVbcs9FjtVYHZlLdraa9P9huwQ9olKO3jIkuOiR6fsEhmyX13EgKac2qJ9s/gsXBgotpr8vEAcvBukfhiPtIfJFsaaQlI3exDBHwQbVV1o/Q==; 5:Xe7wSvNuLP6uu30WcmBSvCfOkTCtNq4nP4rRRjWk/huKgYE1GdIIJsHVJNHz4nPvr3/pG0PCKwYZtx9iES+oVocw9wCmxLa/wNlqlrO0o/brb+Gg8Obi0Pe1+yYUbCMgVDhBkDmXB5glzTby3UQXzw==; 24:ehXNMDaWdyiKjTT4LREJEN9CLJs/xwh7eC7gfF3vBSftKmnxlzgrfSV5GFCjLS+4eDq35jR4D6SfP7O+GOMoyRUuB/H90ridKiWBwuwC2Bk=; 7:k2M0G6GG0iBDirMyvqysX+afx5xH1Tc8J2T3o1NlGgVOqTkqCPdOSW8O+uT9fZQz5LaZPsi+JEuyY2WwjIucQn3Fa4VzTz1plp8Rt3qd+ZWxTwWYN+ANB/1OTAt5QKRwA0HxzrCnsl+Amc0pJZVXW+u8olcHHkLbgfGAPGsy5/w/206uMci2engjDV7tTenMvQlCLj/Y8mc8XfP05pUmzoCPjFoUqF2XI7yN7Fi/ei0=
x-ms-exchange-antispam-srfa-diagnostics: SSOS;
x-ms-office365-filtering-correlation-id: 011f3cc0-151a-400f-7010-08d509b30c8c
x-ms-office365-filtering-ht: Tenant
x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(48565401081)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:BLUPR05MB273;
x-ms-traffictypediagnostic: BLUPR05MB273:
authentication-results: spf=none (sender IP is ) smtp.mailfrom=kwatsen@juniper.net;
x-exchange-antispam-report-test: UriScan:(10436049006162);
x-microsoft-antispam-prvs: <BLUPR05MB2734B535F6FCBDA201E0E48A57D0@BLUPR05MB273.namprd05.prod.outlook.com>
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(10201501046)(100000703101)(100105400095)(12181511122)(6055026)(6041248)(20161123558100)(20161123555025)(20161123562025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BLUPR05MB273; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BLUPR05MB273;
x-forefront-prvs: 0448A97BF2
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(39860400002)(346002)(376002)(377454003)(189002)(53754006)(13464003)(199003)(6116002)(66066001)(97736004)(102836003)(36756003)(3846002)(3660700001)(58126008)(83506001)(110136005)(966005)(53936002)(2906002)(189998001)(3280700002)(478600001)(6246003)(86362001)(575784001)(83716003)(14454004)(25786009)(229853002)(561944003)(77096006)(105586002)(106356001)(33656002)(82746002)(5660300001)(81156014)(2900100001)(68736007)(8936002)(8676002)(54356999)(53546010)(305945005)(7736002)(6306002)(99286003)(6506006)(81166006)(50986999)(6486002)(6436002)(316002)(6512007)(101416001)(491001); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR05MB273; H:BLUPR05MB275.namprd05.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en;
received-spf: None (protection.outlook.com: juniper.net does not designate permitted sender hosts)
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: text/plain; charset="utf-8"
Content-ID: <FFBED7F02ABE3C47BA342C0D7E671B20@namprd05.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: juniper.net
X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Oct 2017 16:31:35.6338 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: bea78b3c-4cdb-4130-854a-1d193232e5f4
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR05MB273
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/J0tH4ZM7akMnzY9trVYVfbjyyKU>
Subject: Re: [netmod] Backward Compatibility Question
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 02 Oct 2017 16:31:39 -0000

Hi Joey,

Your proposal looks fine to me, since it doesn't change the semantics of the data model.  Note that https://tools.ietf.org/html/rfc7950#section-11 says:

   o  Any set of data definition nodes may be replaced with another set
      of syntactically and semantically equivalent nodes.  For example,
      a set of leafs may be replaced by a "uses" statement of a grouping
      with the same leafs.

Kent

--

Hello,

Does anyone have thoughts on this?

Regards,
Joey

-----Original Message-----
From: JOEY BOYD 
Sent: Wednesday, September 27, 2017 9:06 AM
To: 'netmod@ietf.org'
Subject: Backward Compatibility Question

Hi all,

Suppose I had a published YANG model with the following leaf.


  leaf thing1 {
    type uint8;
    description
      "Thing 1.";
  }

Later, I realize that I wish I had modeled this in a choice as I now have a mutually exclusive option to 'thing1' which I want to add to the model.

  leaf thing2 {
    type empty;
    description
      "Thing 2.";
  }

This is a very simplified example but should be sufficient to demonstrate the problem. 

If I look at the XML representation of 'thing1', it looks like this.

<thing1>123</thing1>

If I were to move 'thing1' into a choice with a single case, it would look like this.

choice things {
  case thing1 {
    leaf thing1 {
      type uint8;
      description
        "Thing 1.";
    }
  }
}

Looking to the XML representation, it looks the same as before.

<thing1>123</thing1>

To me, this means that taking a single node or set of nodes and moving them under a case within a new choice statement is a backward compatible change. This assumes, of course, any mandatory or default behavior is preserved. I now can add 'thing2' to the existing model as an option to 'thing1'.

choice things {
  case thing1 {
    leaf thing1 {
      type uint8;
      description
        "Thing 1.";
    }
  }
  case thing2 {
    leaf thing2 {
      type empty;
      description
        "Thing 2.";
    }
  }
}

Do you agree with this analysis or am I missing something?

Best regards,
Joey

_______________________________________________
netmod mailing list
netmod@ietf.org
https://urldefense.proofpoint.com/v2/url?u=https-3A__www.ietf.org_mailman_listinfo_netmod&d=DwICAg&c=HAkYuh63rsuhr6Scbfh0UjBXeMK-ndb3voDTXcWzoCI&r=9zkP0xnJUvZGJ9EPoOH7Yhqn2gsBYaGTvjISlaJdcZo&m=vi3qkFb6HjmIlHo1rXJ2EV-Px58aFLqNc_L6hFsiug4&s=RBiaGoEWCnihPqGVmD6nyVoG_-2vlalhOsqwUjsSRqg&e=