)]}'
{"specs/approved/indexable-json-fields.rst":[{"author":{"_account_id":18893,"name":"Miles Gould","email":"mgould@redhat.com","username":"pozorvlak"},"change_message_id":"c0b6b0d131e51ab11bb82bb05a70d447085faea4","unresolved":false,"context_lines":[{"line_number":17,"context_line":"Problem description"},{"line_number":18,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Ironic currently store some data as JSON in the database, this was done by"},{"line_number":21,"context_line":"design and have served us well until recently where a consensus decision"},{"line_number":22,"context_line":"was made for having a way to filter data stored into some of these"},{"line_number":23,"context_line":"fields via the Ironic API. In order to be able to filter resources in a"}],"source_content_type":"text/x-rst","patch_set":2,"id":"7a740942_cd7382e6","line":20,"updated":"2015-12-04 17:31:51.000000000","message":"\"store\" -\u003e \"stores\"","commit_id":"c619d7d9da835a34c831d27af09af204964c7760"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"8b1cb1f6deb99ec9ddcac775326f881e3e0c16ef","unresolved":false,"context_lines":[{"line_number":17,"context_line":"Problem description"},{"line_number":18,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Ironic currently store some data as JSON in the database, this was done by"},{"line_number":21,"context_line":"design and have served us well until recently where a consensus decision"},{"line_number":22,"context_line":"was made for having a way to filter data stored into some of these"},{"line_number":23,"context_line":"fields via the Ironic API. In order to be able to filter resources in a"}],"source_content_type":"text/x-rst","patch_set":2,"id":"7a740942_706345dd","line":20,"in_reply_to":"7a740942_cd7382e6","updated":"2015-12-04 17:34:28.000000000","message":"Done","commit_id":"c619d7d9da835a34c831d27af09af204964c7760"},{"author":{"_account_id":18893,"name":"Miles Gould","email":"mgould@redhat.com","username":"pozorvlak"},"change_message_id":"c0b6b0d131e51ab11bb82bb05a70d447085faea4","unresolved":false,"context_lines":[{"line_number":18,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Ironic currently store some data as JSON in the database, this was done by"},{"line_number":21,"context_line":"design and have served us well until recently where a consensus decision"},{"line_number":22,"context_line":"was made for having a way to filter data stored into some of these"},{"line_number":23,"context_line":"fields via the Ironic API. In order to be able to filter resources in a"},{"line_number":24,"context_line":"performant way Ironic needs the data of those JSON fields to be indexable."}],"source_content_type":"text/x-rst","patch_set":2,"id":"7a740942_2d4b2689","line":21,"updated":"2015-12-04 17:31:51.000000000","message":"\"have\" -\u003e \"has\"\n\"where\" -\u003e \"when\"","commit_id":"c619d7d9da835a34c831d27af09af204964c7760"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"8b1cb1f6deb99ec9ddcac775326f881e3e0c16ef","unresolved":false,"context_lines":[{"line_number":18,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Ironic currently store some data as JSON in the database, this was done by"},{"line_number":21,"context_line":"design and have served us well until recently where a consensus decision"},{"line_number":22,"context_line":"was made for having a way to filter data stored into some of these"},{"line_number":23,"context_line":"fields via the Ironic API. In order to be able to filter resources in a"},{"line_number":24,"context_line":"performant way Ironic needs the data of those JSON fields to be indexable."}],"source_content_type":"text/x-rst","patch_set":2,"id":"7a740942_905ef110","line":21,"in_reply_to":"7a740942_2d4b2689","updated":"2015-12-04 17:34:28.000000000","message":"Done","commit_id":"c619d7d9da835a34c831d27af09af204964c7760"},{"author":{"_account_id":18893,"name":"Miles Gould","email":"mgould@redhat.com","username":"pozorvlak"},"change_message_id":"c0b6b0d131e51ab11bb82bb05a70d447085faea4","unresolved":false,"context_lines":[{"line_number":28,"context_line":""},{"line_number":29,"context_line":"This spec proposes separating the node\u0027s ``properties`` and"},{"line_number":30,"context_line":"``driver_info`` JSON fields into separated database tables. Both fields"},{"line_number":31,"context_line":"contains information that would come handy if able to filter to use for"},{"line_number":32,"context_line":"scheduling and inspecting purpose."},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"Since many nodes are likely to have the same field names for"}],"source_content_type":"text/x-rst","patch_set":2,"id":"7a740942_0d3f4ad7","line":31,"updated":"2015-12-04 17:31:51.000000000","message":"\"come handy\" -\u003e \"come in handy\"\n\"if able to filter to use\" -\u003e \"if it could be used to filter\"","commit_id":"c619d7d9da835a34c831d27af09af204964c7760"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"8b1cb1f6deb99ec9ddcac775326f881e3e0c16ef","unresolved":false,"context_lines":[{"line_number":28,"context_line":""},{"line_number":29,"context_line":"This spec proposes separating the node\u0027s ``properties`` and"},{"line_number":30,"context_line":"``driver_info`` JSON fields into separated database tables. Both fields"},{"line_number":31,"context_line":"contains information that would come handy if able to filter to use for"},{"line_number":32,"context_line":"scheduling and inspecting purpose."},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"Since many nodes are likely to have the same field names for"}],"source_content_type":"text/x-rst","patch_set":2,"id":"7a740942_b0b0cd44","line":31,"in_reply_to":"7a740942_0d3f4ad7","updated":"2015-12-04 17:34:28.000000000","message":"Done","commit_id":"c619d7d9da835a34c831d27af09af204964c7760"},{"author":{"_account_id":18893,"name":"Miles Gould","email":"mgould@redhat.com","username":"pozorvlak"},"change_message_id":"c0b6b0d131e51ab11bb82bb05a70d447085faea4","unresolved":false,"context_lines":[{"line_number":29,"context_line":"This spec proposes separating the node\u0027s ``properties`` and"},{"line_number":30,"context_line":"``driver_info`` JSON fields into separated database tables. Both fields"},{"line_number":31,"context_line":"contains information that would come handy if able to filter to use for"},{"line_number":32,"context_line":"scheduling and inspecting purpose."},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"Since many nodes are likely to have the same field names for"},{"line_number":35,"context_line":"``properties`` (e.g cpus, memory, disk etc...) and ``driver_info`` (e.g"}],"source_content_type":"text/x-rst","patch_set":2,"id":"7a740942_6d304e02","line":32,"updated":"2015-12-04 17:31:51.000000000","message":"\"purpose\" -\u003e \"purposes\"","commit_id":"c619d7d9da835a34c831d27af09af204964c7760"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"8b1cb1f6deb99ec9ddcac775326f881e3e0c16ef","unresolved":false,"context_lines":[{"line_number":29,"context_line":"This spec proposes separating the node\u0027s ``properties`` and"},{"line_number":30,"context_line":"``driver_info`` JSON fields into separated database tables. Both fields"},{"line_number":31,"context_line":"contains information that would come handy if able to filter to use for"},{"line_number":32,"context_line":"scheduling and inspecting purpose."},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"Since many nodes are likely to have the same field names for"},{"line_number":35,"context_line":"``properties`` (e.g cpus, memory, disk etc...) and ``driver_info`` (e.g"}],"source_content_type":"text/x-rst","patch_set":2,"id":"7a740942_70ba6525","line":32,"in_reply_to":"7a740942_6d304e02","updated":"2015-12-04 17:34:28.000000000","message":"Done","commit_id":"c619d7d9da835a34c831d27af09af204964c7760"},{"author":{"_account_id":18893,"name":"Miles Gould","email":"mgould@redhat.com","username":"pozorvlak"},"change_message_id":"c0b6b0d131e51ab11bb82bb05a70d447085faea4","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":"Since many nodes are likely to have the same field names for"},{"line_number":35,"context_line":"``properties`` (e.g cpus, memory, disk etc...) and ``driver_info`` (e.g"},{"line_number":36,"context_line":"credentials, deploy kernel, deploy ramdisk etc...) this spec propose"},{"line_number":37,"context_line":"creating separate tables for ``properties`` and ``driver_info`` names"},{"line_number":38,"context_line":"and cross-join tables between nodes and the new tables."},{"line_number":39,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"7a740942_4d1c7277","line":36,"updated":"2015-12-04 17:31:51.000000000","message":"\"propose\" -\u003e \"proposes\"","commit_id":"c619d7d9da835a34c831d27af09af204964c7760"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"8b1cb1f6deb99ec9ddcac775326f881e3e0c16ef","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":"Since many nodes are likely to have the same field names for"},{"line_number":35,"context_line":"``properties`` (e.g cpus, memory, disk etc...) and ``driver_info`` (e.g"},{"line_number":36,"context_line":"credentials, deploy kernel, deploy ramdisk etc...) this spec propose"},{"line_number":37,"context_line":"creating separate tables for ``properties`` and ``driver_info`` names"},{"line_number":38,"context_line":"and cross-join tables between nodes and the new tables."},{"line_number":39,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"7a740942_90b59132","line":36,"in_reply_to":"7a740942_4d1c7277","updated":"2015-12-04 17:34:28.000000000","message":"Done","commit_id":"c619d7d9da835a34c831d27af09af204964c7760"},{"author":{"_account_id":18893,"name":"Miles Gould","email":"mgould@redhat.com","username":"pozorvlak"},"change_message_id":"c0b6b0d131e51ab11bb82bb05a70d447085faea4","unresolved":false,"context_lines":[{"line_number":60,"context_line":"Alternatives"},{"line_number":61,"context_line":"------------"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"None. Indexing the fields in the database is performatic but it would be"},{"line_number":64,"context_line":"possible to do the filtering (whether in Ironic or on the client side)"},{"line_number":65,"context_line":"by loading all nodes and introspecting the JSON blobs. Although this is"},{"line_number":66,"context_line":"very inefficient."}],"source_content_type":"text/x-rst","patch_set":2,"id":"7a740942_d036b9e6","line":63,"updated":"2015-12-04 17:31:51.000000000","message":"\"performatic\" -\u003e \"performant\", I think - are you saying that it\u0027s a good thing? If it\u0027s a bad thing, you might mean \"problematic\".","commit_id":"c619d7d9da835a34c831d27af09af204964c7760"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"8b1cb1f6deb99ec9ddcac775326f881e3e0c16ef","unresolved":false,"context_lines":[{"line_number":60,"context_line":"Alternatives"},{"line_number":61,"context_line":"------------"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"None. Indexing the fields in the database is performatic but it would be"},{"line_number":64,"context_line":"possible to do the filtering (whether in Ironic or on the client side)"},{"line_number":65,"context_line":"by loading all nodes and introspecting the JSON blobs. Although this is"},{"line_number":66,"context_line":"very inefficient."}],"source_content_type":"text/x-rst","patch_set":2,"id":"7a740942_50d40946","line":63,"in_reply_to":"7a740942_d036b9e6","updated":"2015-12-04 17:34:28.000000000","message":"Reading it again it sounds a bit odd, I will rephrase that paragraph","commit_id":"c619d7d9da835a34c831d27af09af204964c7760"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"daef36e194a2d5b260aaca0c25abe579c12abaa6","unresolved":false,"context_lines":[{"line_number":35,"context_line":"``properties`` (e.g cpus, memory, disk etc...) and ``driver_info`` (e.g"},{"line_number":36,"context_line":"credentials, deploy kernel, deploy ramdisk etc...) this spec proposes"},{"line_number":37,"context_line":"creating separate tables for ``properties`` and ``driver_info`` names"},{"line_number":38,"context_line":"and cross-join tables between nodes and the new tables."},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"The database tables layout are:"},{"line_number":41,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"7a740942_94b8e1c9","line":38,"updated":"2015-12-07 15:29:01.000000000","message":"Now Ironic accepts any parameters names in driver_info, so I can add driver_info/qwertyu\u003dasdfgghh. Does changes for this spec imply any king of validation for parameter\u0027s names (we have COMMON_PROPERTIES for each interface)?","commit_id":"cdd14b0ba8c53b9e0af3b502343c3ad6aa3e70de"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"e975a9e75462c68d84ea9a1aef3e1c1a2f68ed3d","unresolved":false,"context_lines":[{"line_number":35,"context_line":"``properties`` (e.g cpus, memory, disk etc...) and ``driver_info`` (e.g"},{"line_number":36,"context_line":"credentials, deploy kernel, deploy ramdisk etc...) this spec proposes"},{"line_number":37,"context_line":"creating separate tables for ``properties`` and ``driver_info`` names"},{"line_number":38,"context_line":"and cross-join tables between nodes and the new tables."},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"The database tables layout are:"},{"line_number":41,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"7a740942_fe711177","line":38,"updated":"2015-12-07 11:55:17.000000000","message":"how are these tables populated? how are they cleaned up?","commit_id":"cdd14b0ba8c53b9e0af3b502343c3ad6aa3e70de"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"4bf1406297dbad37fca44a5e8146866e3f388c80","unresolved":false,"context_lines":[{"line_number":35,"context_line":"``properties`` (e.g cpus, memory, disk etc...) and ``driver_info`` (e.g"},{"line_number":36,"context_line":"credentials, deploy kernel, deploy ramdisk etc...) this spec proposes"},{"line_number":37,"context_line":"creating separate tables for ``properties`` and ``driver_info`` names"},{"line_number":38,"context_line":"and cross-join tables between nodes and the new tables."},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"The database tables layout are:"},{"line_number":41,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"7a740942_556830b9","line":38,"in_reply_to":"7a740942_94b8e1c9","updated":"2015-12-07 16:55:30.000000000","message":"Hi Yuryi,\n\nNo, Ironic will continue to accept any parameters names in driver_info and properties, just like today. The drivers can then validate what is inserted on those fields (like today as well)","commit_id":"cdd14b0ba8c53b9e0af3b502343c3ad6aa3e70de"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"4bf1406297dbad37fca44a5e8146866e3f388c80","unresolved":false,"context_lines":[{"line_number":35,"context_line":"``properties`` (e.g cpus, memory, disk etc...) and ``driver_info`` (e.g"},{"line_number":36,"context_line":"credentials, deploy kernel, deploy ramdisk etc...) this spec proposes"},{"line_number":37,"context_line":"creating separate tables for ``properties`` and ``driver_info`` names"},{"line_number":38,"context_line":"and cross-join tables between nodes and the new tables."},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"The database tables layout are:"},{"line_number":41,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"7a740942_c5f0f993","line":38,"in_reply_to":"7a740942_fe711177","updated":"2015-12-07 16:55:30.000000000","message":"Will extend the paragraph, but basically we are going to use [0] the association proxies by sqlalchemy for it\n\n[0] http://docs.sqlalchemy.org/en/latest/orm/extensions/associationproxy.html#composite-association-proxies","commit_id":"cdd14b0ba8c53b9e0af3b502343c3ad6aa3e70de"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"e975a9e75462c68d84ea9a1aef3e1c1a2f68ed3d","unresolved":false,"context_lines":[{"line_number":51,"context_line":""},{"line_number":52,"context_line":"**node_driver_info** (node_id INT, driver_info_id INT, FOREIGN KEY (node_id,"},{"line_number":53,"context_line":"                      driver_info_id), PRIMARY KEY (node_id, driver_info_id),"},{"line_number":54,"context_line":"                      INDEX (driver_info_id), field_value TEXT)"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"This spec also will implement migration scripts to move the data from"},{"line_number":57,"context_line":"those fields into the new tables."}],"source_content_type":"text/x-rst","patch_set":4,"id":"7a740942_9e6a4d80","line":54,"updated":"2015-12-07 11:55:17.000000000","message":"\u0027field_value\u0027 is a serialized JSON on both cases, right? worth clarifying here.","commit_id":"cdd14b0ba8c53b9e0af3b502343c3ad6aa3e70de"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"4bf1406297dbad37fca44a5e8146866e3f388c80","unresolved":false,"context_lines":[{"line_number":51,"context_line":""},{"line_number":52,"context_line":"**node_driver_info** (node_id INT, driver_info_id INT, FOREIGN KEY (node_id,"},{"line_number":53,"context_line":"                      driver_info_id), PRIMARY KEY (node_id, driver_info_id),"},{"line_number":54,"context_line":"                      INDEX (driver_info_id), field_value TEXT)"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"This spec also will implement migration scripts to move the data from"},{"line_number":57,"context_line":"those fields into the new tables."}],"source_content_type":"text/x-rst","patch_set":4,"id":"7a740942_450ac97a","line":54,"in_reply_to":"7a740942_9e6a4d80","updated":"2015-12-07 16:55:30.000000000","message":"++ yes they are, will add","commit_id":"cdd14b0ba8c53b9e0af3b502343c3ad6aa3e70de"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"e975a9e75462c68d84ea9a1aef3e1c1a2f68ed3d","unresolved":false,"context_lines":[{"line_number":64,"context_line":"  and introspecting the JSON blobs (in Ironic or on the client side),"},{"line_number":65,"context_line":"  although this is very inefficient."},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"* Some databases (e.g postgresql and mysql) does have support for a"},{"line_number":68,"context_line":"  native JSON type. But, since we use an ORM I don\u0027t think we are able"},{"line_number":69,"context_line":"  to use it generically."},{"line_number":70,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"7a740942_be6709b6","line":67,"updated":"2015-12-07 11:55:17.000000000","message":"nit: s/does/do/","commit_id":"cdd14b0ba8c53b9e0af3b502343c3ad6aa3e70de"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"4bf1406297dbad37fca44a5e8146866e3f388c80","unresolved":false,"context_lines":[{"line_number":64,"context_line":"  and introspecting the JSON blobs (in Ironic or on the client side),"},{"line_number":65,"context_line":"  although this is very inefficient."},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"* Some databases (e.g postgresql and mysql) does have support for a"},{"line_number":68,"context_line":"  native JSON type. But, since we use an ORM I don\u0027t think we are able"},{"line_number":69,"context_line":"  to use it generically."},{"line_number":70,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"7a740942_256d3d31","line":67,"in_reply_to":"7a740942_be6709b6","updated":"2015-12-07 16:55:30.000000000","message":"Done","commit_id":"cdd14b0ba8c53b9e0af3b502343c3ad6aa3e70de"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"daef36e194a2d5b260aaca0c25abe579c12abaa6","unresolved":false,"context_lines":[{"line_number":164,"context_line":""},{"line_number":165,"context_line":"* Create the ``properties``, ``node_properties``, ``driver_info`` and"},{"line_number":166,"context_line":"  ``node_driver_info`` tables."},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"* Create a migration script to move the data from the node\u0027s"},{"line_number":169,"context_line":"  ``properties`` and ``driver_info`` columns into their respective"},{"line_number":170,"context_line":"  tables."}],"source_content_type":"text/x-rst","patch_set":4,"id":"7a740942_f92a808f","line":167,"updated":"2015-12-07 15:29:01.000000000","message":"Also modify Ironic DB API code.","commit_id":"cdd14b0ba8c53b9e0af3b502343c3ad6aa3e70de"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"e975a9e75462c68d84ea9a1aef3e1c1a2f68ed3d","unresolved":false,"context_lines":[{"line_number":187,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"* Migration scripts will be provided to create the new tables and move"},{"line_number":190,"context_line":"  the data around."},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"Documentation Impact"},{"line_number":193,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":4,"id":"7a740942_5e0705ca","line":190,"updated":"2015-12-07 11:55:17.000000000","message":"please expand it. do you expect one-time or online migration of data? will downtime of the whole claster be required?","commit_id":"cdd14b0ba8c53b9e0af3b502343c3ad6aa3e70de"},{"author":{"_account_id":10697,"name":"Thiago Paiva Brito","email":"thiagop@lsd.ufcg.edu.br","username":"thiagop","inactive":true},"change_message_id":"c8a6bbd945d66afa7d32eabd2184d104b1c97707","unresolved":false,"context_lines":[{"line_number":46,"context_line":""},{"line_number":47,"context_line":"**labels** (id INT PRIMARY KEY, name VARCHAR(255), UNIQUE(name))"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"**node_properties** (node_id INT, property_id INT, FOREIGN KEY (node_id,"},{"line_number":50,"context_line":"                     property_id), PRIMARY KEY (node_id, property_id),"},{"line_number":51,"context_line":"                     INDEX (property_id), value TEXT)"},{"line_number":52,"context_line":""}],"source_content_type":"text/x-rst","patch_set":6,"id":"5a710552_ae7961fe","line":49,"updated":"2015-12-15 14:03:56.000000000","message":"I found it difficult to picture how the table will look like with this syntax. Maybe because I\u0027m well used to see CREATE TABLE statements...\n\nAlso, I\u0027m not seeing clearly to which table the foreign keys points to.","commit_id":"46eb7bc29e7a11f9120d45d8a03c3381eb297403"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"c0458678bd757c86dd7fabf9c7730f7cd79feed3","unresolved":false,"context_lines":[{"line_number":46,"context_line":""},{"line_number":47,"context_line":"**labels** (id INT PRIMARY KEY, name VARCHAR(255), UNIQUE(name))"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"**node_properties** (node_id INT, property_id INT, FOREIGN KEY (node_id,"},{"line_number":50,"context_line":"                     property_id), PRIMARY KEY (node_id, property_id),"},{"line_number":51,"context_line":"                     INDEX (property_id), value TEXT)"},{"line_number":52,"context_line":""}],"source_content_type":"text/x-rst","patch_set":6,"id":"5a710552_542162fa","line":49,"in_reply_to":"5a710552_ae7961fe","updated":"2015-12-15 17:56:45.000000000","message":"Maybe I should write it as FOREIGN KEY (nodes.id, labels.id) ?","commit_id":"46eb7bc29e7a11f9120d45d8a03c3381eb297403"},{"author":{"_account_id":10697,"name":"Thiago Paiva Brito","email":"thiagop@lsd.ufcg.edu.br","username":"thiagop","inactive":true},"change_message_id":"c8a6bbd945d66afa7d32eabd2184d104b1c97707","unresolved":false,"context_lines":[{"line_number":64,"context_line":""},{"line_number":65,"context_line":"  SELECT node_id WHERE"},{"line_number":66,"context_line":"      property_id\u003d(SELECT id FROM labels WHERE name\u003d\u0027cpus\u0027) AND"},{"line_number":67,"context_line":"      value \u003d \u00278\u0027"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"As for the migration, a migration script will be provided to create"}],"source_content_type":"text/x-rst","patch_set":6,"id":"5a710552_1949e15f","line":67,"updated":"2015-12-15 14:03:56.000000000","message":"Thank God sqlalchemy will abstract that for us... This example is also a little weird. Maybe something like:\n\nSELECT\n    node_id\nFROM\n    node_properties np\nRIGHT OUTER JOIN\n   labels l ON np.property_id \u003d l.id\nWHERE\n    np.value \u003d \u00278\u0027","commit_id":"46eb7bc29e7a11f9120d45d8a03c3381eb297403"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"c0458678bd757c86dd7fabf9c7730f7cd79feed3","unresolved":false,"context_lines":[{"line_number":64,"context_line":""},{"line_number":65,"context_line":"  SELECT node_id WHERE"},{"line_number":66,"context_line":"      property_id\u003d(SELECT id FROM labels WHERE name\u003d\u0027cpus\u0027) AND"},{"line_number":67,"context_line":"      value \u003d \u00278\u0027"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"As for the migration, a migration script will be provided to create"}],"source_content_type":"text/x-rst","patch_set":6,"id":"5a710552_d45a3283","line":67,"in_reply_to":"5a710552_1949e15f","updated":"2015-12-15 17:56:45.000000000","message":"Right, yeah sqlalchemy will do the hard work. This statement is just so one can visualize as it will look like.","commit_id":"46eb7bc29e7a11f9120d45d8a03c3381eb297403"},{"author":{"_account_id":10697,"name":"Thiago Paiva Brito","email":"thiagop@lsd.ufcg.edu.br","username":"thiagop","inactive":true},"change_message_id":"c8a6bbd945d66afa7d32eabd2184d104b1c97707","unresolved":false,"context_lines":[{"line_number":68,"context_line":""},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"As for the migration, a migration script will be provided to create"},{"line_number":71,"context_line":"the new tables and the data will be migrated on-the-fly. What the spec"},{"line_number":72,"context_line":"proposes is to keep the old ``properties`` and ``driver_info`` column"},{"line_number":73,"context_line":"from the Node model and once an update is done in these columns we will"},{"line_number":74,"context_line":"migrate the data to the new tables. For new nodes created after the upgrade,"}],"source_content_type":"text/x-rst","patch_set":6,"id":"5a710552_99b5d1ce","line":71,"updated":"2015-12-15 14:03:56.000000000","message":"Wouldn\u0027t be easier to make a migration script for that? Even for backwards migration. I think the question here is: why on-the-fly migration is necessary?","commit_id":"46eb7bc29e7a11f9120d45d8a03c3381eb297403"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"c0458678bd757c86dd7fabf9c7730f7cd79feed3","unresolved":false,"context_lines":[{"line_number":68,"context_line":""},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"As for the migration, a migration script will be provided to create"},{"line_number":71,"context_line":"the new tables and the data will be migrated on-the-fly. What the spec"},{"line_number":72,"context_line":"proposes is to keep the old ``properties`` and ``driver_info`` column"},{"line_number":73,"context_line":"from the Node model and once an update is done in these columns we will"},{"line_number":74,"context_line":"migrate the data to the new tables. For new nodes created after the upgrade,"}],"source_content_type":"text/x-rst","patch_set":6,"id":"5a710552_3435b6f6","line":71,"in_reply_to":"5a710552_99b5d1ce","updated":"2015-12-15 17:56:45.000000000","message":"That was my first idea as well but talking to jroll and devananda on IRC we decided to migrate it on-the-fly to not force operators to do a huge migration at upgrade time, see the conversation at [0]\n\n[0] http://eavesdrop.openstack.org/irclogs/%23openstack-ironic/%23openstack-ironic.2015-12-10.log.html#t2015-12-10T17:58:34","commit_id":"46eb7bc29e7a11f9120d45d8a03c3381eb297403"},{"author":{"_account_id":10697,"name":"Thiago Paiva Brito","email":"thiagop@lsd.ufcg.edu.br","username":"thiagop","inactive":true},"change_message_id":"c8a6bbd945d66afa7d32eabd2184d104b1c97707","unresolved":false,"context_lines":[{"line_number":93,"context_line":"* Some databases (e.g postgresql and mysql) do have support for a"},{"line_number":94,"context_line":"  native JSON type. But, since we use an ORM I don\u0027t think we are able"},{"line_number":95,"context_line":"  to use it generically."},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"Data model impact"},{"line_number":98,"context_line":"-----------------"},{"line_number":99,"context_line":""}],"source_content_type":"text/x-rst","patch_set":6,"id":"5a710552_d9659945","line":96,"updated":"2015-12-15 14:03:56.000000000","message":"Just throwing it on the air, NoSQL databases deal way better with json search and indexing.","commit_id":"46eb7bc29e7a11f9120d45d8a03c3381eb297403"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"f008ee6d85fc2c6d30429eccac08e1ce8a125393","unresolved":false,"context_lines":[{"line_number":93,"context_line":"* Some databases (e.g postgresql and mysql) do have support for a"},{"line_number":94,"context_line":"  native JSON type. But, since we use an ORM I don\u0027t think we are able"},{"line_number":95,"context_line":"  to use it generically."},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"Data model impact"},{"line_number":98,"context_line":"-----------------"},{"line_number":99,"context_line":""}],"source_content_type":"text/x-rst","patch_set":6,"id":"5a710552_3442a43f","line":96,"in_reply_to":"5a710552_d9659945","updated":"2015-12-15 14:08:56.000000000","message":"PostgreSQL does it just as well, and does not have various scalability and reliability problems ;)","commit_id":"46eb7bc29e7a11f9120d45d8a03c3381eb297403"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"f81b31606c1c940d08059a215ce5c7922739e375","unresolved":false,"context_lines":[{"line_number":97,"context_line":"Data model impact"},{"line_number":98,"context_line":"-----------------"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"Four new tables will be added: ``properties``, ``node_properties``,"},{"line_number":101,"context_line":"``driver_info`` and ``node_driver_info``."},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"State Machine Impact"}],"source_content_type":"text/x-rst","patch_set":6,"id":"5a710552_66a04b44","line":100,"updated":"2015-12-16 10:25:13.000000000","message":"But only 3 in \"Proposed change\".","commit_id":"46eb7bc29e7a11f9120d45d8a03c3381eb297403"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"591ba9a76ded8dc0b0d2d7da8b074208848dfafa","unresolved":false,"context_lines":[{"line_number":27,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"This spec proposes separating the node\u0027s ``properties`` and"},{"line_number":30,"context_line":"``driver_info`` JSON fields into separated database tables. Both fields"},{"line_number":31,"context_line":"contains information that would come in handy if it could be able to"},{"line_number":32,"context_line":"filter for scheduling and inspecting purposes."},{"line_number":33,"context_line":""}],"source_content_type":"text/x-rst","patch_set":7,"id":"3a7e1126_2ab54130","line":30,"updated":"2015-12-17 19:22:00.000000000","message":"s/separated/separate/","commit_id":"19d06d9102a448c401ad7aa2c2dff729e48437b6"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"8ca1496d190fc33d5aaaae5d49b8439925b8a88d","unresolved":false,"context_lines":[{"line_number":27,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"This spec proposes separating the node\u0027s ``properties`` and"},{"line_number":30,"context_line":"``driver_info`` JSON fields into separated database tables. Both fields"},{"line_number":31,"context_line":"contains information that would come in handy if it could be able to"},{"line_number":32,"context_line":"filter for scheduling and inspecting purposes."},{"line_number":33,"context_line":""}],"source_content_type":"text/x-rst","patch_set":7,"id":"3a7e1126_92563ccd","line":30,"in_reply_to":"3a7e1126_2ab54130","updated":"2015-12-22 16:09:03.000000000","message":"Done","commit_id":"19d06d9102a448c401ad7aa2c2dff729e48437b6"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"591ba9a76ded8dc0b0d2d7da8b074208848dfafa","unresolved":false,"context_lines":[{"line_number":28,"context_line":""},{"line_number":29,"context_line":"This spec proposes separating the node\u0027s ``properties`` and"},{"line_number":30,"context_line":"``driver_info`` JSON fields into separated database tables. Both fields"},{"line_number":31,"context_line":"contains information that would come in handy if it could be able to"},{"line_number":32,"context_line":"filter for scheduling and inspecting purposes."},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"Since many nodes are likely to have the same field names for"}],"source_content_type":"text/x-rst","patch_set":7,"id":"3a7e1126_eaec192b","line":31,"updated":"2015-12-17 19:22:00.000000000","message":"s/contains/contain/","commit_id":"19d06d9102a448c401ad7aa2c2dff729e48437b6"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"8ca1496d190fc33d5aaaae5d49b8439925b8a88d","unresolved":false,"context_lines":[{"line_number":28,"context_line":""},{"line_number":29,"context_line":"This spec proposes separating the node\u0027s ``properties`` and"},{"line_number":30,"context_line":"``driver_info`` JSON fields into separated database tables. Both fields"},{"line_number":31,"context_line":"contains information that would come in handy if it could be able to"},{"line_number":32,"context_line":"filter for scheduling and inspecting purposes."},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"Since many nodes are likely to have the same field names for"}],"source_content_type":"text/x-rst","patch_set":7,"id":"3a7e1126_b25b38f6","line":31,"in_reply_to":"3a7e1126_eaec192b","updated":"2015-12-22 16:09:03.000000000","message":"Done","commit_id":"19d06d9102a448c401ad7aa2c2dff729e48437b6"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"591ba9a76ded8dc0b0d2d7da8b074208848dfafa","unresolved":false,"context_lines":[{"line_number":51,"context_line":"                     INDEX (property_id), value TEXT)"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"**node_driver_info** (node_id INT, driver_info_id INT, FOREIGN KEY (node_id,"},{"line_number":54,"context_line":"                      driver_info_id), PRIMARY KEY (node_id, driver_info_id),"},{"line_number":55,"context_line":"                      INDEX (driver_info_id), value TEXT)"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"It worth noting that the ``value`` field from the ``node_properties``"}],"source_content_type":"text/x-rst","patch_set":7,"id":"3a7e1126_bd12d660","line":54,"updated":"2015-12-17 19:22:00.000000000","message":"shouldn\u0027t FOREIGN key be nodes.id, labels.id?","commit_id":"19d06d9102a448c401ad7aa2c2dff729e48437b6"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"8ca1496d190fc33d5aaaae5d49b8439925b8a88d","unresolved":false,"context_lines":[{"line_number":51,"context_line":"                     INDEX (property_id), value TEXT)"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"**node_driver_info** (node_id INT, driver_info_id INT, FOREIGN KEY (node_id,"},{"line_number":54,"context_line":"                      driver_info_id), PRIMARY KEY (node_id, driver_info_id),"},{"line_number":55,"context_line":"                      INDEX (driver_info_id), value TEXT)"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"It worth noting that the ``value`` field from the ``node_properties``"}],"source_content_type":"text/x-rst","patch_set":7,"id":"3a7e1126_126b2c87","line":54,"in_reply_to":"3a7e1126_bd12d660","updated":"2015-12-22 16:09:03.000000000","message":"yes, forgot to update it :-(","commit_id":"19d06d9102a448c401ad7aa2c2dff729e48437b6"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"591ba9a76ded8dc0b0d2d7da8b074208848dfafa","unresolved":false,"context_lines":[{"line_number":54,"context_line":"                      driver_info_id), PRIMARY KEY (node_id, driver_info_id),"},{"line_number":55,"context_line":"                      INDEX (driver_info_id), value TEXT)"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"It worth noting that the ``value`` field from the ``node_properties``"},{"line_number":58,"context_line":"and ``node_driver_info`` tables will hold a serialized JSON string, we"},{"line_number":59,"context_line":"need it because nested dictionaries are already supported in the API."},{"line_number":60,"context_line":"For example, `root device hints`_ already make use of it."}],"source_content_type":"text/x-rst","patch_set":7,"id":"3a7e1126_0afde539","line":57,"updated":"2015-12-17 19:22:00.000000000","message":"s/It/It is/","commit_id":"19d06d9102a448c401ad7aa2c2dff729e48437b6"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"8ca1496d190fc33d5aaaae5d49b8439925b8a88d","unresolved":false,"context_lines":[{"line_number":54,"context_line":"                      driver_info_id), PRIMARY KEY (node_id, driver_info_id),"},{"line_number":55,"context_line":"                      INDEX (driver_info_id), value TEXT)"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"It worth noting that the ``value`` field from the ``node_properties``"},{"line_number":58,"context_line":"and ``node_driver_info`` tables will hold a serialized JSON string, we"},{"line_number":59,"context_line":"need it because nested dictionaries are already supported in the API."},{"line_number":60,"context_line":"For example, `root device hints`_ already make use of it."}],"source_content_type":"text/x-rst","patch_set":7,"id":"3a7e1126_920ddcea","line":57,"in_reply_to":"3a7e1126_0afde539","updated":"2015-12-22 16:09:03.000000000","message":"Done","commit_id":"19d06d9102a448c401ad7aa2c2dff729e48437b6"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"591ba9a76ded8dc0b0d2d7da8b074208848dfafa","unresolved":false,"context_lines":[{"line_number":55,"context_line":"                      INDEX (driver_info_id), value TEXT)"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"It worth noting that the ``value`` field from the ``node_properties``"},{"line_number":58,"context_line":"and ``node_driver_info`` tables will hold a serialized JSON string, we"},{"line_number":59,"context_line":"need it because nested dictionaries are already supported in the API."},{"line_number":60,"context_line":"For example, `root device hints`_ already make use of it."},{"line_number":61,"context_line":""}],"source_content_type":"text/x-rst","patch_set":7,"id":"3a7e1126_2a8f81cd","line":58,"updated":"2015-12-17 19:22:00.000000000","message":"s/will/could/ right? They aren\u0027t all serialized JSON strings, just some of them.","commit_id":"19d06d9102a448c401ad7aa2c2dff729e48437b6"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"8ca1496d190fc33d5aaaae5d49b8439925b8a88d","unresolved":false,"context_lines":[{"line_number":55,"context_line":"                      INDEX (driver_info_id), value TEXT)"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"It worth noting that the ``value`` field from the ``node_properties``"},{"line_number":58,"context_line":"and ``node_driver_info`` tables will hold a serialized JSON string, we"},{"line_number":59,"context_line":"need it because nested dictionaries are already supported in the API."},{"line_number":60,"context_line":"For example, `root device hints`_ already make use of it."},{"line_number":61,"context_line":""}],"source_content_type":"text/x-rst","patch_set":7,"id":"3a7e1126_b2125808","line":58,"in_reply_to":"3a7e1126_2a8f81cd","updated":"2015-12-22 16:09:03.000000000","message":"They will, because we are going to use the JsonEncodedType type from oslo.db [0][1]\n\n[0] https://github.com/openstack/oslo.db/blob/7a52dcf17f94c5df0a64caeedfb90b4c2c4ad255/oslo_db/sqlalchemy/types.py#L34-L35\n\n[1] https://review.openstack.org/#/c/252531/4/ironic/db/sqlalchemy/models.py (LINE 117)","commit_id":"19d06d9102a448c401ad7aa2c2dff729e48437b6"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"e6c9eb8625d364b45345d748e4e4d570a1d4fc19","unresolved":false,"context_lines":[{"line_number":55,"context_line":"                      INDEX (driver_info_id), value TEXT)"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"It worth noting that the ``value`` field from the ``node_properties``"},{"line_number":58,"context_line":"and ``node_driver_info`` tables will hold a serialized JSON string, we"},{"line_number":59,"context_line":"need it because nested dictionaries are already supported in the API."},{"line_number":60,"context_line":"For example, `root device hints`_ already make use of it."},{"line_number":61,"context_line":""}],"source_content_type":"text/x-rst","patch_set":7,"id":"1a7b0d38_68315aec","line":58,"in_reply_to":"3a7e1126_b2125808","updated":"2015-12-22 19:04:49.000000000","message":"OH.","commit_id":"19d06d9102a448c401ad7aa2c2dff729e48437b6"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"04f49b3824a27994d2da6fcbad31dc1bdd2de887","unresolved":false,"context_lines":[{"line_number":63,"context_line":"node id based on properties and/or driver_info the query will look like::"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"  SELECT node_id WHERE"},{"line_number":66,"context_line":"      property_id\u003d(SELECT id FROM labels WHERE name\u003d\u0027cpus\u0027) AND"},{"line_number":67,"context_line":"      value \u003d \u00278\u0027"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":""}],"source_content_type":"text/x-rst","patch_set":7,"id":"1a7b0d38_48201ef8","line":66,"updated":"2015-12-22 19:10:54.000000000","message":"This sample query is missing the FROM statement","commit_id":"19d06d9102a448c401ad7aa2c2dff729e48437b6"},{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"change_message_id":"c22f5d342da1b330aeac7288d2fdaef2cabe27fb","unresolved":false,"context_lines":[{"line_number":64,"context_line":""},{"line_number":65,"context_line":"  SELECT node_id WHERE"},{"line_number":66,"context_line":"      property_id\u003d(SELECT id FROM labels WHERE name\u003d\u0027cpus\u0027) AND"},{"line_number":67,"context_line":"      value \u003d \u00278\u0027"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"As for the migration, a migration script will be provided to create"}],"source_content_type":"text/x-rst","patch_set":7,"id":"1a7b0d38_7e72707e","line":67,"updated":"2015-12-22 19:46:00.000000000","message":"Lucas is correct that MySQL can\u0027t index an entire TEXT field, but we can (and should) use a \"prefix index\" on the `value` column. For example: INDEX (property_id, value(20))\n\nThe whole row will still need to be fetched from the data page, to retrieve and compate the entire TEXT field, but the prefix index will allow for quicker searching by improving the cardinality of the index. Exactly what length of prefix index is optimal will depend on the data being stored -- I\u0027m only guessing at a length of \"20\" characters (based on experience, 10 is too few, but the improvement drops off after 15 - 20 in most data sets). \nHowever, with this being a JSON field, and not a simple string value, it\u0027s more complicated. For example, searching for nodes with a cpu_arch of \u0027x86_64\u0027 becomes the following query:\n\n  WHERE property_id\u003d(SELECT ...) AND\n    value \u003d \u0027\"x86_64\"\u0027;\n\nbecause the JSON-encoded string of \u0027x86_64\u0027 is actually \u0027\"x86_64\"\u0027. (yes, json adds the quotes).\n\nWe will need to json-encode the string being searched, so that it matches the data stored in the DB.\n\nWe also should avoid wildcard searches -- not only for the performance reasons, but because the LIKE operator is unaware of JSON structure. The query: \n\n  WHERE property_id\u003d(SELECT ...) AND\n    value LIKE \u0027%x86_64%\u0027;\n\nis not useful because it would match a JSON value of \u0027{\"supports\": \"x86_64\"}\u0027 just as blindly as a value of \u0027{\"incompatible_with\": \"x86_64\"}\u0027","commit_id":"19d06d9102a448c401ad7aa2c2dff729e48437b6"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"aac4e306c9137bad4b059ee3574e746773399153","unresolved":false,"context_lines":[{"line_number":64,"context_line":""},{"line_number":65,"context_line":"  SELECT node_id WHERE"},{"line_number":66,"context_line":"      property_id\u003d(SELECT id FROM labels WHERE name\u003d\u0027cpus\u0027) AND"},{"line_number":67,"context_line":"      value \u003d \u00278\u0027"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"As for the migration, a migration script will be provided to create"}],"source_content_type":"text/x-rst","patch_set":7,"id":"3a7e1126_1c59b35a","line":67,"updated":"2015-12-17 17:20:06.000000000","message":"Naive question: will this actually be fast if we aren\u0027t indexing `value`?","commit_id":"19d06d9102a448c401ad7aa2c2dff729e48437b6"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"1ac16187939edc31e4eedd136e79b2595f18d962","unresolved":false,"context_lines":[{"line_number":64,"context_line":""},{"line_number":65,"context_line":"  SELECT node_id WHERE"},{"line_number":66,"context_line":"      property_id\u003d(SELECT id FROM labels WHERE name\u003d\u0027cpus\u0027) AND"},{"line_number":67,"context_line":"      value \u003d \u00278\u0027"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"As for the migration, a migration script will be provided to create"}],"source_content_type":"text/x-rst","patch_set":7,"id":"da6ed579_dc201afa","line":67,"in_reply_to":"1a7b0d38_7e72707e","updated":"2016-01-12 18:42:03.000000000","message":"Thanks devananda for the explanation, just to quickly lay down my findinds, it seems that prefix index is a mysql-only thing. It\u0027s supported by sqlalchemy [0] but I\u0027m afraid it means that other engines won\u0027t have the same performance when querying nodes in Ironic.\n\n(There\u0027s a stackoverflow post about postgres [1], but it involves using wildcards which is what we want to avoid according deva\u0027s comment above).\n\n\n[0] http://docs.sqlalchemy.org/en/latest/dialects/mysql.html#index-length\n\n[1] http://stackoverflow.com/questions/21823949/how-to-add-a-prefix-length-index-in-postgresql","commit_id":"19d06d9102a448c401ad7aa2c2dff729e48437b6"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"8ca1496d190fc33d5aaaae5d49b8439925b8a88d","unresolved":false,"context_lines":[{"line_number":64,"context_line":""},{"line_number":65,"context_line":"  SELECT node_id WHERE"},{"line_number":66,"context_line":"      property_id\u003d(SELECT id FROM labels WHERE name\u003d\u0027cpus\u0027) AND"},{"line_number":67,"context_line":"      value \u003d \u00278\u0027"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"As for the migration, a migration script will be provided to create"}],"source_content_type":"text/x-rst","patch_set":7,"id":"3a7e1126_358c127f","line":67,"in_reply_to":"3a7e1126_1c59b35a","updated":"2015-12-22 16:09:03.000000000","message":"I will probably defer this question to someone that knows more databases than I do. (@deva ?)\n\nBut, my concern with indexing value is because it\u0027s a TEXT field and I think it\u0027s not a good idea/possible to acually index a field that contains an unlimited amount of text.","commit_id":"19d06d9102a448c401ad7aa2c2dff729e48437b6"},{"author":{"_account_id":18893,"name":"Miles Gould","email":"mgould@redhat.com","username":"pozorvlak"},"change_message_id":"160a6e29752b57accfba0cb4c58e6a94c2a7c01d","unresolved":false,"context_lines":[{"line_number":64,"context_line":""},{"line_number":65,"context_line":"  SELECT node_id WHERE"},{"line_number":66,"context_line":"      property_id\u003d(SELECT id FROM labels WHERE name\u003d\u0027cpus\u0027) AND"},{"line_number":67,"context_line":"      value \u003d \u00278\u0027"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"As for the migration, a migration script will be provided to create"}],"source_content_type":"text/x-rst","patch_set":7,"id":"1a7b0d38_8d929856","line":67,"in_reply_to":"3a7e1126_358c127f","updated":"2015-12-22 18:42:26.000000000","message":"It\u0027s definitely possible: https://dev.mysql.com/doc/refman/5.5/en/column-indexes.html http://www.postgresql.org/docs/9.1/static/textsearch-tables.html. It should help with equality tests like this or simple LIKE queries, but won\u0027t help if we want to do more complex tests on structured JSON. http://dev.mysql.com/doc/refman/5.7/en/index-btree-hash.html","commit_id":"19d06d9102a448c401ad7aa2c2dff729e48437b6"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"8456514b7ef05bb8013ea6a4ae8519d83e44da3d","unresolved":false,"context_lines":[{"line_number":64,"context_line":""},{"line_number":65,"context_line":"  SELECT node_id WHERE"},{"line_number":66,"context_line":"      property_id\u003d(SELECT id FROM labels WHERE name\u003d\u0027cpus\u0027) AND"},{"line_number":67,"context_line":"      value \u003d \u00278\u0027"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"As for the migration, a migration script will be provided to create"}],"source_content_type":"text/x-rst","patch_set":7,"id":"da6ed579_5ce8aa7c","line":67,"in_reply_to":"da6ed579_dc201afa","updated":"2016-01-12 18:43:34.000000000","message":"It also makes me wonder if we want to go ahead with this spec. Perhaps we should look for alternatives, e.g knowing which fields we would like the filter API to query on, we can remove those values from properties and add as a column for the Node\u0027s object (Node.cpus, Node.memory_mb etc...)","commit_id":"19d06d9102a448c401ad7aa2c2dff729e48437b6"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"aac4e306c9137bad4b059ee3574e746773399153","unresolved":false,"context_lines":[{"line_number":72,"context_line":"proposes is to keep the old ``properties`` and ``driver_info`` column"},{"line_number":73,"context_line":"from the Node model and once an update is done in these columns we will"},{"line_number":74,"context_line":"migrate the data to the new tables. For new nodes created after the upgrade,"},{"line_number":75,"context_line":"they will already use the new tables."},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"A script will also be provided to migrate all data to the new tables at"},{"line_number":78,"context_line":"once, operators ***must** run this script before updating Ironic to the"}],"source_content_type":"text/x-rst","patch_set":7,"id":"3a7e1126_3f5ee112","line":75,"updated":"2015-12-17 17:20:06.000000000","message":"I know what the plan is, but for others that don\u0027t, maybe we want to elaborate that:\n\n1) when the data is migrated, the old columns will be set to NULL or {} or \"\" or whatever we choose.\n\n2) Reads will read from the old column, if the value is (whatever we decide in (1)) it will read from the new tables.","commit_id":"19d06d9102a448c401ad7aa2c2dff729e48437b6"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"591ba9a76ded8dc0b0d2d7da8b074208848dfafa","unresolved":false,"context_lines":[{"line_number":72,"context_line":"proposes is to keep the old ``properties`` and ``driver_info`` column"},{"line_number":73,"context_line":"from the Node model and once an update is done in these columns we will"},{"line_number":74,"context_line":"migrate the data to the new tables. For new nodes created after the upgrade,"},{"line_number":75,"context_line":"they will already use the new tables."},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"A script will also be provided to migrate all data to the new tables at"},{"line_number":78,"context_line":"once, operators ***must** run this script before updating Ironic to the"}],"source_content_type":"text/x-rst","patch_set":7,"id":"3a7e1126_40bf49fb","line":75,"in_reply_to":"3a7e1126_3f5ee112","updated":"2015-12-17 19:22:00.000000000","message":"+1","commit_id":"19d06d9102a448c401ad7aa2c2dff729e48437b6"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"8ca1496d190fc33d5aaaae5d49b8439925b8a88d","unresolved":false,"context_lines":[{"line_number":72,"context_line":"proposes is to keep the old ``properties`` and ``driver_info`` column"},{"line_number":73,"context_line":"from the Node model and once an update is done in these columns we will"},{"line_number":74,"context_line":"migrate the data to the new tables. For new nodes created after the upgrade,"},{"line_number":75,"context_line":"they will already use the new tables."},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"A script will also be provided to migrate all data to the new tables at"},{"line_number":78,"context_line":"once, operators ***must** run this script before updating Ironic to the"}],"source_content_type":"text/x-rst","patch_set":7,"id":"3a7e1126_52c9b459","line":75,"in_reply_to":"3a7e1126_40bf49fb","updated":"2015-12-22 16:09:03.000000000","message":"Done","commit_id":"19d06d9102a448c401ad7aa2c2dff729e48437b6"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"591ba9a76ded8dc0b0d2d7da8b074208848dfafa","unresolved":false,"context_lines":[{"line_number":77,"context_line":"A script will also be provided to migrate all data to the new tables at"},{"line_number":78,"context_line":"once, operators ***must** run this script before updating Ironic to the"},{"line_number":79,"context_line":"N release were the old ``properties`` and ``driver_info`` columns will"},{"line_number":80,"context_line":"be dropped."},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"Downgrade **will not** be supported and this is aligned with the OpenStack"},{"line_number":83,"context_line":"views on `Downward SQL Schema Migrations`_."}],"source_content_type":"text/x-rst","patch_set":7,"id":"3a7e1126_a01ced13","line":80,"updated":"2015-12-17 19:22:00.000000000","message":"This isn\u0027t clear to me. Are you providing two different scripts? One at line 70, and this one? For this one, it seems like if you run a script that migrates all the data, that same script will delete node.properties \u0026 node.driver_info columns at the same time.\n\nwrt N release -- we\u0027re going to follow the standard deprecation process [1], right?\n\n[1] https://github.com/openstack/governance/blob/master/reference/tags/assert_follows-standard-deprecation.rst","commit_id":"19d06d9102a448c401ad7aa2c2dff729e48437b6"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"8ca1496d190fc33d5aaaae5d49b8439925b8a88d","unresolved":false,"context_lines":[{"line_number":77,"context_line":"A script will also be provided to migrate all data to the new tables at"},{"line_number":78,"context_line":"once, operators ***must** run this script before updating Ironic to the"},{"line_number":79,"context_line":"N release were the old ``properties`` and ``driver_info`` columns will"},{"line_number":80,"context_line":"be dropped."},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"Downgrade **will not** be supported and this is aligned with the OpenStack"},{"line_number":83,"context_line":"views on `Downward SQL Schema Migrations`_."}],"source_content_type":"text/x-rst","patch_set":7,"id":"3a7e1126_b2b9f87b","line":80,"in_reply_to":"3a7e1126_a01ced13","updated":"2015-12-22 16:09:03.000000000","message":"Yes two scripts. The first one will create the new tables but the data will remain at the node\u0027s properties and driver_info columns until they are updated and the data migrate on the fly.\n\nThe second one (in this paragraph) will make sure all data was migrated to the new tables so we can get rid of the properties and driver_info columns from the nodes.\n\nre deprecation process, it doesn\u0027t seem to be needed because it\u0027s only for \"end-user-visible or operator-visible features\" right? This spec is just about the data/struct of the database that\u0027s not visible in the API.","commit_id":"19d06d9102a448c401ad7aa2c2dff729e48437b6"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"e6c9eb8625d364b45345d748e4e4d570a1d4fc19","unresolved":false,"context_lines":[{"line_number":77,"context_line":"A script will also be provided to migrate all data to the new tables at"},{"line_number":78,"context_line":"once, operators ***must** run this script before updating Ironic to the"},{"line_number":79,"context_line":"N release were the old ``properties`` and ``driver_info`` columns will"},{"line_number":80,"context_line":"be dropped."},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"Downgrade **will not** be supported and this is aligned with the OpenStack"},{"line_number":83,"context_line":"views on `Downward SQL Schema Migrations`_."}],"source_content_type":"text/x-rst","patch_set":7,"id":"1a7b0d38_8820464b","line":80,"in_reply_to":"3a7e1126_b2b9f87b","updated":"2015-12-22 19:04:49.000000000","message":"I will wait for you to document the \u0027plan\u0027 first before I ask about the scripts/any deprecation.","commit_id":"19d06d9102a448c401ad7aa2c2dff729e48437b6"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"aac4e306c9137bad4b059ee3574e746773399153","unresolved":false,"context_lines":[{"line_number":157,"context_line":""},{"line_number":158,"context_line":"None. The work described in this spec is just plumbing work, once in"},{"line_number":159,"context_line":"place new features can be implemented on top of it that will impact on"},{"line_number":160,"context_line":"the performance."},{"line_number":161,"context_line":""},{"line_number":162,"context_line":""},{"line_number":163,"context_line":"Other deployer impact"}],"source_content_type":"text/x-rst","patch_set":7,"id":"3a7e1126_7f47891d","line":160,"updated":"2015-12-17 17:20:06.000000000","message":"There will be a couple of (IMO, small) performance impacts here:\n\n1) Additional writes when migrating data\n\n2) An extra JOIN on node reads (maybe we can make this lazy for less impact, though Nova probably does most of the reads and needs these so I\u0027m not sure how much it helps.","commit_id":"19d06d9102a448c401ad7aa2c2dff729e48437b6"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"8ca1496d190fc33d5aaaae5d49b8439925b8a88d","unresolved":false,"context_lines":[{"line_number":157,"context_line":""},{"line_number":158,"context_line":"None. The work described in this spec is just plumbing work, once in"},{"line_number":159,"context_line":"place new features can be implemented on top of it that will impact on"},{"line_number":160,"context_line":"the performance."},{"line_number":161,"context_line":""},{"line_number":162,"context_line":""},{"line_number":163,"context_line":"Other deployer impact"}],"source_content_type":"text/x-rst","patch_set":7,"id":"3a7e1126_2a47814c","line":160,"in_reply_to":"3a7e1126_7f47891d","updated":"2015-12-22 16:09:03.000000000","message":"Done","commit_id":"19d06d9102a448c401ad7aa2c2dff729e48437b6"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"e6c9eb8625d364b45345d748e4e4d570a1d4fc19","unresolved":false,"context_lines":[{"line_number":189,"context_line":"----------"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"* Create the ``labels``, ``node_properties`` and  ``node_driver_info``"},{"line_number":192,"context_line":"  tables."},{"line_number":193,"context_line":""},{"line_number":194,"context_line":"* Update the Node model to load the data either from the old columns or"},{"line_number":195,"context_line":"  new tables depending whether it was already migrated or not."}],"source_content_type":"text/x-rst","patch_set":7,"id":"1a7b0d38_689cfa69","line":192,"updated":"2015-12-22 19:04:49.000000000","message":"this is your first script, right?","commit_id":"19d06d9102a448c401ad7aa2c2dff729e48437b6"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"aac4e306c9137bad4b059ee3574e746773399153","unresolved":false,"context_lines":[{"line_number":196,"context_line":""},{"line_number":197,"context_line":"* Modify Ironic DB API code when creating and updating the node to"},{"line_number":198,"context_line":"  migrate the data on-the-fly."},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"Dependencies"},{"line_number":201,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":202,"context_line":""}],"source_content_type":"text/x-rst","patch_set":7,"id":"3a7e1126_5f73ad80","line":199,"updated":"2015-12-17 17:20:06.000000000","message":"Write the data migration script for ops to use?","commit_id":"19d06d9102a448c401ad7aa2c2dff729e48437b6"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"8ca1496d190fc33d5aaaae5d49b8439925b8a88d","unresolved":false,"context_lines":[{"line_number":196,"context_line":""},{"line_number":197,"context_line":"* Modify Ironic DB API code when creating and updating the node to"},{"line_number":198,"context_line":"  migrate the data on-the-fly."},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"Dependencies"},{"line_number":201,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":202,"context_line":""}],"source_content_type":"text/x-rst","patch_set":7,"id":"3a7e1126_0a4c056f","line":199,"in_reply_to":"3a7e1126_5f73ad80","updated":"2015-12-22 16:09:03.000000000","message":"Done","commit_id":"19d06d9102a448c401ad7aa2c2dff729e48437b6"}]}
