)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"1ee2d46cbae730a6ef229469d2645d6fb146c613","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"31c971e0_ad14570f","updated":"2023-11-09 15:22:04.000000000","message":"recheck","commit_id":"bca99f196b3bf18f4c5f0bf3a06c23f39cc909f4"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"44f67c00ffe615134c3e7dd2e796ef101bd034ce","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"27083eda_bac6e536","updated":"2023-12-21 07:05:55.000000000","message":"recheck multiple 503 errors","commit_id":"7606ca9f63618741f991da5265fe72c4b394993a"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"10aee323a9ee61ad2fb38418f910a7823c3b10f2","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"accc7cb2_8e565a5a","updated":"2024-01-17 18:06:41.000000000","message":"Thank you Dan!!","commit_id":"9f489a26be801f8d4ab02fac3e71c415c7812763"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"3df8eb4db9820bdc60876ec92c7bb720a59d9d41","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"5ec98d31_944475df","updated":"2024-01-17 16:00:37.000000000","message":"b","commit_id":"9f489a26be801f8d4ab02fac3e71c415c7812763"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"efdf0de28f1e24490448e05e92df8e769361a120","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"41b2fc7c_b6108a81","updated":"2024-02-09 09:59:53.000000000","message":"Thank you for review!","commit_id":"1a1044a70895d81f35d7d8fb3d5d744fc9c7485a"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"7a44aef68eac4d4b1aee2c73b0745bea06535b6e","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"742146e8_0b1a0fa1","updated":"2024-02-08 17:48:53.000000000","message":"Thank you for the inputs Dan!","commit_id":"1a1044a70895d81f35d7d8fb3d5d744fc9c7485a"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"3020abfceb93a7f4ab132f02bd533f07d97cb2e2","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":10,"id":"89f0c6bf_e8112a8b","updated":"2024-02-09 14:55:05.000000000","message":"-1 for the misspelled variable and a further improvement suggestion.","commit_id":"e9b5b4e651fc8dcb86db509f34eb893727aa2b84"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"7f205e9d026c58866bc16da9991d12fdb9687e16","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":10,"id":"d6303c9a_7fc22737","updated":"2024-02-09 19:54:52.000000000","message":"Please refer to inline comment for multi-table delete/update query","commit_id":"e9b5b4e651fc8dcb86db509f34eb893727aa2b84"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"1f52ffc664b713fe76eb7d11bdb37fc40583985a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":10,"id":"7b6fe36b_ba895770","updated":"2024-02-09 15:09:01.000000000","message":"Thank you for the inputs!","commit_id":"e9b5b4e651fc8dcb86db509f34eb893727aa2b84"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"de7602ed7843a2059aeab820ab253445c6277ee1","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"2b7f8b0f_cc685929","updated":"2024-02-12 09:29:17.000000000","message":"Will revert back update and delete APIs with old way (not to use join query)","commit_id":"47fa16e7ba5907e865b353201e335aea2bdbd4bb"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"1dc03e4d69e6af11c909c9fb3e132253cbe1eb60","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":12,"id":"c225ce94_1cba0a84","updated":"2024-02-13 18:43:10.000000000","message":"Definitely looking better and more efficient. One more suggestion, unless you had a reason not to do it?","commit_id":"a3113fa8daa56fab078a86cf9c73aa4bc3e4c595"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"45250c69ca327937e6195a484f1338d47c9ea3cb","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":12,"id":"f96fcbf1_d1b57e49","updated":"2024-02-13 18:29:46.000000000","message":"Thank you for inputs Dan, made changes as per suggestion.","commit_id":"a3113fa8daa56fab078a86cf9c73aa4bc3e4c595"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"f20169ed1334d5629bdb6ffd4c9992634d3580bd","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":13,"id":"005351ac_8c6856ce","updated":"2024-02-14 17:02:36.000000000","message":"Nice, looks pretty tight now :)","commit_id":"8614245fcd6e52dd00c1402d57afa895636837f9"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"10069555ffe8ad6be6b5a31efc765ccc8728f264","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":14,"id":"f55f0aa5_49f1f05d","updated":"2024-02-15 17:49:17.000000000","message":"Thank you for review Dan!","commit_id":"10d663d04d93b58806d083b479a33425e1fc19d0"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"9f2a31b1b30e3b902d0faee03757c1b484085e36","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":14,"id":"6027b9de_665321dc","updated":"2024-02-27 10:03:37.000000000","message":"recheck","commit_id":"10d663d04d93b58806d083b479a33425e1fc19d0"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"128e31fbf39f541af60c2ffd4f8738749ed34f9c","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":14,"id":"6a98162e_f86eb8bd","updated":"2024-02-23 10:41:22.000000000","message":"recheck","commit_id":"10d663d04d93b58806d083b479a33425e1fc19d0"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"1d0097e5344525a65719f07a278580362b7dd9b8","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":14,"id":"8244931d_60c5e4e4","updated":"2024-02-23 20:04:34.000000000","message":"recheck","commit_id":"10d663d04d93b58806d083b479a33425e1fc19d0"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"831f34437c446f2dc0e57cf7958ebcb7fda06783","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":14,"id":"aea11c5c_e7184f2a","updated":"2024-02-22 03:54:16.000000000","message":"recheck","commit_id":"10d663d04d93b58806d083b479a33425e1fc19d0"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"b63592a8c738f0f1f64af1b2e8bd4ae687675bcf","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":14,"id":"e7bb79b3_51e2c612","updated":"2024-02-22 06:42:55.000000000","message":"recheck","commit_id":"10d663d04d93b58806d083b479a33425e1fc19d0"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"53b15c3d9037267b49f09cad710b88e4ab2db290","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":14,"id":"eb2121a1_9873f5dc","updated":"2024-02-27 06:19:59.000000000","message":"recheck","commit_id":"10d663d04d93b58806d083b479a33425e1fc19d0"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"523e0048125a61303475cd7e075ef6cee8b330e4","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":14,"id":"54a307cb_c22a3c80","updated":"2024-02-26 20:48:12.000000000","message":"recheck multiple failures","commit_id":"10d663d04d93b58806d083b479a33425e1fc19d0"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"b1ac1c429fe676c4b4b5d4e26ba09ad2d3980e1c","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":14,"id":"213a70fb_50823251","updated":"2024-02-26 18:28:44.000000000","message":"recheck nova-ceph-multistore failed on server tests","commit_id":"10d663d04d93b58806d083b479a33425e1fc19d0"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"d99e66f043de735224f640c22b113c5b20f2b05b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":14,"id":"88ecd40f_38468279","updated":"2024-02-27 01:50:23.000000000","message":"recheck timeout","commit_id":"10d663d04d93b58806d083b479a33425e1fc19d0"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"0a1fbace362977c221b7c4030496cccb34e09075","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":14,"id":"cedec2b2_5a4f57bd","updated":"2024-02-22 11:23:27.000000000","message":"recheck, http server from where image is downloaded was not reachable.\n\nglance_store._drivers.http [None req-031a7159-23e2-4bf0-ba1d-e208ea74dbae tempest-ImageLocationsTest-960547437 tempest-ImageLocationsTest-960547437-project-member] The HTTP URL is invalid: HTTPConnectionPool(host\u003d\u0027download.cirros-cloud.net\u0027, port\u003d80): Max retries exceeded with url: /0.3.1/cirros-0.3.1-x86_64-uec.tar.gz (Caused by NewConnectionError(\u0027\u003curllib3.connection.HTTPConnection object at 0x7efd15930e50\u003e: Failed to establish a new connection: [Errno -3] Lookup timed out\u0027))","commit_id":"10d663d04d93b58806d083b479a33425e1fc19d0"}],"glance/db/sqlalchemy/api.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"1f453a28a6deb9a48f49ae08020b047104dc791e","unresolved":true,"context_lines":[{"line_number":2551,"context_line":"            \u0027hits\u0027: last_hit_count + 1,"},{"line_number":2552,"context_line":"            \u0027last_accessed\u0027: last_accessed}"},{"line_number":2553,"context_line":""},{"line_number":2554,"context_line":"        cached_image.update(values)"},{"line_number":2555,"context_line":"    return cached_image"}],"source_content_type":"text/x-python","patch_set":9,"id":"320f998d_7f0d7fef","line":2554,"updated":"2024-02-08 15:51:02.000000000","message":"This is lossy because two hits at the same time will race to update the table. I think you want to just let the DB do this atomically right? Something like:\n\n```\nUPDATE cached_images SET hits\u003dhits+1,last_accessed\u003d$date WHERE image_id\u003d$image_id AND node_reference_id\u003d$id\n```","commit_id":"1a1044a70895d81f35d7d8fb3d5d744fc9c7485a"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"efdf0de28f1e24490448e05e92df8e769361a120","unresolved":false,"context_lines":[{"line_number":2551,"context_line":"            \u0027hits\u0027: last_hit_count + 1,"},{"line_number":2552,"context_line":"            \u0027last_accessed\u0027: last_accessed}"},{"line_number":2553,"context_line":""},{"line_number":2554,"context_line":"        cached_image.update(values)"},{"line_number":2555,"context_line":"    return cached_image"}],"source_content_type":"text/x-python","patch_set":9,"id":"34046195_5e2b93af","line":2554,"in_reply_to":"02cc56b0_b940cf88","updated":"2024-02-09 09:59:53.000000000","message":"Done","commit_id":"1a1044a70895d81f35d7d8fb3d5d744fc9c7485a"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"7a44aef68eac4d4b1aee2c73b0745bea06535b6e","unresolved":true,"context_lines":[{"line_number":2551,"context_line":"            \u0027hits\u0027: last_hit_count + 1,"},{"line_number":2552,"context_line":"            \u0027last_accessed\u0027: last_accessed}"},{"line_number":2553,"context_line":""},{"line_number":2554,"context_line":"        cached_image.update(values)"},{"line_number":2555,"context_line":"    return cached_image"}],"source_content_type":"text/x-python","patch_set":9,"id":"02cc56b0_b940cf88","line":2554,"in_reply_to":"320f998d_7f0d7fef","updated":"2024-02-08 17:48:53.000000000","message":"Yes, I will update it (will find out how to do this in sqlalchemy)","commit_id":"1a1044a70895d81f35d7d8fb3d5d744fc9c7485a"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"3020abfceb93a7f4ab132f02bd533f07d97cb2e2","unresolved":true,"context_lines":[{"line_number":2408,"context_line":"    values \u003d {\u0027node_reference_url\u0027: node_reference_url}"},{"line_number":2409,"context_line":""},{"line_number":2410,"context_line":"    with session.begin():"},{"line_number":2411,"context_line":"        node_refernece \u003d models.NodeReference()"},{"line_number":2412,"context_line":"        node_refernece.update(values.copy())"},{"line_number":2413,"context_line":"        try:"},{"line_number":2414,"context_line":"            node_refernece.save(session\u003dsession)"}],"source_content_type":"text/x-python","patch_set":10,"id":"e9ede930_3b217232","line":2411,"range":{"start_line":2411,"start_character":8,"end_line":2411,"end_character":22},"updated":"2024-02-09 14:55:05.000000000","message":"You misspelled \"node_reference\" (several times) :)","commit_id":"e9b5b4e651fc8dcb86db509f34eb893727aa2b84"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"7f205e9d026c58866bc16da9991d12fdb9687e16","unresolved":false,"context_lines":[{"line_number":2408,"context_line":"    values \u003d {\u0027node_reference_url\u0027: node_reference_url}"},{"line_number":2409,"context_line":""},{"line_number":2410,"context_line":"    with session.begin():"},{"line_number":2411,"context_line":"        node_refernece \u003d models.NodeReference()"},{"line_number":2412,"context_line":"        node_refernece.update(values.copy())"},{"line_number":2413,"context_line":"        try:"},{"line_number":2414,"context_line":"            node_refernece.save(session\u003dsession)"}],"source_content_type":"text/x-python","patch_set":10,"id":"f7dd234f_d17339e2","line":2411,"range":{"start_line":2411,"start_character":8,"end_line":2411,"end_character":22},"in_reply_to":"00e94d67_2cce3f59","updated":"2024-02-09 19:54:52.000000000","message":"Done","commit_id":"e9b5b4e651fc8dcb86db509f34eb893727aa2b84"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"1f52ffc664b713fe76eb7d11bdb37fc40583985a","unresolved":true,"context_lines":[{"line_number":2408,"context_line":"    values \u003d {\u0027node_reference_url\u0027: node_reference_url}"},{"line_number":2409,"context_line":""},{"line_number":2410,"context_line":"    with session.begin():"},{"line_number":2411,"context_line":"        node_refernece \u003d models.NodeReference()"},{"line_number":2412,"context_line":"        node_refernece.update(values.copy())"},{"line_number":2413,"context_line":"        try:"},{"line_number":2414,"context_line":"            node_refernece.save(session\u003dsession)"}],"source_content_type":"text/x-python","patch_set":10,"id":"00e94d67_2cce3f59","line":2411,"range":{"start_line":2411,"start_character":8,"end_line":2411,"end_character":22},"in_reply_to":"e9ede930_3b217232","updated":"2024-02-09 15:09:01.000000000","message":"that is my speciality 😊, will correct them in next PS","commit_id":"e9b5b4e651fc8dcb86db509f34eb893727aa2b84"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"3020abfceb93a7f4ab132f02bd533f07d97cb2e2","unresolved":true,"context_lines":[{"line_number":2427,"context_line":"            query \u003d query.filter_by("},{"line_number":2428,"context_line":"                image_id\u003dimage_id,"},{"line_number":2429,"context_line":"                node_reference_id\u003dnode_reference[\u0027node_reference_id\u0027])"},{"line_number":2430,"context_line":"            return query.one()[0]"},{"line_number":2431,"context_line":"        except sa_orm.exc.NoResultFound:"},{"line_number":2432,"context_line":"            msg \u003d _(\"Referenced %s is not cached on\""},{"line_number":2433,"context_line":"                    \" %s.\" % (image_id, node_reference_url))"}],"source_content_type":"text/x-python","patch_set":10,"id":"096ed047_99654da1","line":2430,"updated":"2024-02-09 14:55:05.000000000","message":"So this is fine, but it requires two database hits in order to get a single integer from the DB. Why not join and query for the thing you want? I always have to look up SQLa syntax, but in SQL this is a single operation:\n```\nSELECT hits FROM cached_images LEFT JOIN node_reference ON cached_images.node_reference_id\u003dnode_reference.id\nWHERE node_reference.node_reference_url\u003d$refurl\n```\n\nSame for all the examples below. I\u0027m just thinking that this caching stuff should be as fast and light as it can be, IMHO, and not generate a bunch of additional load if possible.","commit_id":"e9b5b4e651fc8dcb86db509f34eb893727aa2b84"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"1f52ffc664b713fe76eb7d11bdb37fc40583985a","unresolved":true,"context_lines":[{"line_number":2427,"context_line":"            query \u003d query.filter_by("},{"line_number":2428,"context_line":"                image_id\u003dimage_id,"},{"line_number":2429,"context_line":"                node_reference_id\u003dnode_reference[\u0027node_reference_id\u0027])"},{"line_number":2430,"context_line":"            return query.one()[0]"},{"line_number":2431,"context_line":"        except sa_orm.exc.NoResultFound:"},{"line_number":2432,"context_line":"            msg \u003d _(\"Referenced %s is not cached on\""},{"line_number":2433,"context_line":"                    \" %s.\" % (image_id, node_reference_url))"}],"source_content_type":"text/x-python","patch_set":10,"id":"6dd24e43_b95507ff","line":2430,"in_reply_to":"096ed047_99654da1","updated":"2024-02-09 15:09:01.000000000","message":"++, will update it next PS","commit_id":"e9b5b4e651fc8dcb86db509f34eb893727aa2b84"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"aa4605ac8313d89fce1a7a20d5d8f831337f0be3","unresolved":true,"context_lines":[{"line_number":2427,"context_line":"            query \u003d query.filter_by("},{"line_number":2428,"context_line":"                image_id\u003dimage_id,"},{"line_number":2429,"context_line":"                node_reference_id\u003dnode_reference[\u0027node_reference_id\u0027])"},{"line_number":2430,"context_line":"            return query.one()[0]"},{"line_number":2431,"context_line":"        except sa_orm.exc.NoResultFound:"},{"line_number":2432,"context_line":"            msg \u003d _(\"Referenced %s is not cached on\""},{"line_number":2433,"context_line":"                    \" %s.\" % (image_id, node_reference_url))"}],"source_content_type":"text/x-python","patch_set":10,"id":"46566f01_c7a5e7a4","line":2430,"in_reply_to":"427c112e_4d1e7e15","updated":"2024-02-12 15:12:38.000000000","message":"https://paste.opendev.org/show/b1rRzBPzPORJCJmqqZGU/ and \n\nhttps://zuul.opendev.org/t/openstack/build/9d726ca4dfde4035810ae970d383eabc/log/job-output.txt#4576","commit_id":"e9b5b4e651fc8dcb86db509f34eb893727aa2b84"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"a0d7729400c58922b0af8633010546bb6caa931a","unresolved":true,"context_lines":[{"line_number":2427,"context_line":"            query \u003d query.filter_by("},{"line_number":2428,"context_line":"                image_id\u003dimage_id,"},{"line_number":2429,"context_line":"                node_reference_id\u003dnode_reference[\u0027node_reference_id\u0027])"},{"line_number":2430,"context_line":"            return query.one()[0]"},{"line_number":2431,"context_line":"        except sa_orm.exc.NoResultFound:"},{"line_number":2432,"context_line":"            msg \u003d _(\"Referenced %s is not cached on\""},{"line_number":2433,"context_line":"                    \" %s.\" % (image_id, node_reference_url))"}],"source_content_type":"text/x-python","patch_set":10,"id":"8fd96699_97b745b9","line":2430,"in_reply_to":"46566f01_c7a5e7a4","updated":"2024-02-12 15:24:32.000000000","message":"Oh, it supports multi-table operations, just not on update apparently.\n\nLooks like it should be implemented now:\n\nhttps://www.sqlite.org/lang_update.html#update_from\n\nBut maybe SQLa doesn\u0027t support it or know about it? This only mentions mysql and postgres:\n\nhttps://docs.sqlalchemy.org/en/20/tutorial/data_update.html#update-from\n\nSo I guess that\u0027s it. Bummer.\n\nI think there are other ways to do the thing you\u0027re trying to do, like a subquery which might behave differently and then work in both. It would be unfortunate to not be able to make this a single-shot database operation just because our functional tests can\u0027t do it :/","commit_id":"e9b5b4e651fc8dcb86db509f34eb893727aa2b84"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"7f205e9d026c58866bc16da9991d12fdb9687e16","unresolved":true,"context_lines":[{"line_number":2427,"context_line":"            query \u003d query.filter_by("},{"line_number":2428,"context_line":"                image_id\u003dimage_id,"},{"line_number":2429,"context_line":"                node_reference_id\u003dnode_reference[\u0027node_reference_id\u0027])"},{"line_number":2430,"context_line":"            return query.one()[0]"},{"line_number":2431,"context_line":"        except sa_orm.exc.NoResultFound:"},{"line_number":2432,"context_line":"            msg \u003d _(\"Referenced %s is not cached on\""},{"line_number":2433,"context_line":"                    \" %s.\" % (image_id, node_reference_url))"}],"source_content_type":"text/x-python","patch_set":10,"id":"c0c56a6b_764035ff","line":2430,"in_reply_to":"6dd24e43_b95507ff","updated":"2024-02-09 19:54:52.000000000","message":"Made the changes but for delete/update I have skipped functional test as sqlite does not support multi-table operations.","commit_id":"e9b5b4e651fc8dcb86db509f34eb893727aa2b84"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"14ec8b73761b80fca88812167f98153af0be7f41","unresolved":true,"context_lines":[{"line_number":2427,"context_line":"            query \u003d query.filter_by("},{"line_number":2428,"context_line":"                image_id\u003dimage_id,"},{"line_number":2429,"context_line":"                node_reference_id\u003dnode_reference[\u0027node_reference_id\u0027])"},{"line_number":2430,"context_line":"            return query.one()[0]"},{"line_number":2431,"context_line":"        except sa_orm.exc.NoResultFound:"},{"line_number":2432,"context_line":"            msg \u003d _(\"Referenced %s is not cached on\""},{"line_number":2433,"context_line":"                    \" %s.\" % (image_id, node_reference_url))"}],"source_content_type":"text/x-python","patch_set":10,"id":"96d13cf1_e58b7fc8","line":2430,"in_reply_to":"8fd96699_97b745b9","updated":"2024-02-12 16:49:15.000000000","message":"So, should I roll it back or skip the tests?","commit_id":"e9b5b4e651fc8dcb86db509f34eb893727aa2b84"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"45250c69ca327937e6195a484f1338d47c9ea3cb","unresolved":false,"context_lines":[{"line_number":2427,"context_line":"            query \u003d query.filter_by("},{"line_number":2428,"context_line":"                image_id\u003dimage_id,"},{"line_number":2429,"context_line":"                node_reference_id\u003dnode_reference[\u0027node_reference_id\u0027])"},{"line_number":2430,"context_line":"            return query.one()[0]"},{"line_number":2431,"context_line":"        except sa_orm.exc.NoResultFound:"},{"line_number":2432,"context_line":"            msg \u003d _(\"Referenced %s is not cached on\""},{"line_number":2433,"context_line":"                    \" %s.\" % (image_id, node_reference_url))"}],"source_content_type":"text/x-python","patch_set":10,"id":"281d9403_f92db5fb","line":2430,"in_reply_to":"96d13cf1_e58b7fc8","updated":"2024-02-13 18:29:46.000000000","message":"Done","commit_id":"e9b5b4e651fc8dcb86db509f34eb893727aa2b84"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"954d92fb0cc7bc0efc5735f98c878d434b47c0d1","unresolved":true,"context_lines":[{"line_number":2427,"context_line":"            query \u003d query.filter_by("},{"line_number":2428,"context_line":"                image_id\u003dimage_id,"},{"line_number":2429,"context_line":"                node_reference_id\u003dnode_reference[\u0027node_reference_id\u0027])"},{"line_number":2430,"context_line":"            return query.one()[0]"},{"line_number":2431,"context_line":"        except sa_orm.exc.NoResultFound:"},{"line_number":2432,"context_line":"            msg \u003d _(\"Referenced %s is not cached on\""},{"line_number":2433,"context_line":"                    \" %s.\" % (image_id, node_reference_url))"}],"source_content_type":"text/x-python","patch_set":10,"id":"427c112e_4d1e7e15","line":2430,"in_reply_to":"c0c56a6b_764035ff","updated":"2024-02-12 14:52:38.000000000","message":"Um what? It should definitely support joins :) Got a link or something?","commit_id":"e9b5b4e651fc8dcb86db509f34eb893727aa2b84"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"3020abfceb93a7f4ab132f02bd533f07d97cb2e2","unresolved":true,"context_lines":[{"line_number":2546,"context_line":"        session.query(models.CachedImages).filter_by("},{"line_number":2547,"context_line":"            image_id\u003dimage_id).filter_by("},{"line_number":2548,"context_line":"            node_reference_id\u003dnode_reference[\u0027node_reference_id\u0027]).update({"},{"line_number":2549,"context_line":"                \u0027hits\u0027: models.CachedImages.hits + 1,"},{"line_number":2550,"context_line":"                \u0027last_accessed\u0027: last_accessed"},{"line_number":2551,"context_line":"            })"}],"source_content_type":"text/x-python","patch_set":10,"id":"c22eaed7_bd895e61","line":2549,"updated":"2024-02-09 14:55:05.000000000","message":"Nice :)","commit_id":"e9b5b4e651fc8dcb86db509f34eb893727aa2b84"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"7f205e9d026c58866bc16da9991d12fdb9687e16","unresolved":false,"context_lines":[{"line_number":2546,"context_line":"        session.query(models.CachedImages).filter_by("},{"line_number":2547,"context_line":"            image_id\u003dimage_id).filter_by("},{"line_number":2548,"context_line":"            node_reference_id\u003dnode_reference[\u0027node_reference_id\u0027]).update({"},{"line_number":2549,"context_line":"                \u0027hits\u0027: models.CachedImages.hits + 1,"},{"line_number":2550,"context_line":"                \u0027last_accessed\u0027: last_accessed"},{"line_number":2551,"context_line":"            })"}],"source_content_type":"text/x-python","patch_set":10,"id":"19f19e70_f088a2d4","line":2549,"in_reply_to":"c22eaed7_bd895e61","updated":"2024-02-09 19:54:52.000000000","message":"Done","commit_id":"e9b5b4e651fc8dcb86db509f34eb893727aa2b84"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"1dc03e4d69e6af11c909c9fb3e132253cbe1eb60","unresolved":true,"context_lines":[{"line_number":2469,"context_line":""},{"line_number":2470,"context_line":"        query \u003d session.query(models.CachedImages)"},{"line_number":2471,"context_line":"        query \u003d query.filter("},{"line_number":2472,"context_line":"            models.CachedImages.node_reference_id.in_(node_id))"},{"line_number":2473,"context_line":""},{"line_number":2474,"context_line":"        query.delete(synchronize_session\u003dFalse)"},{"line_number":2475,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"a1b08e6e_1a142797","line":2472,"updated":"2024-02-13 18:43:10.000000000","message":"So, I think that if you use `scalar_subquery()` you can avoid the `in` check and use `\u003d` which is less work by the DB. It\u0027s just more efficient than a query that checks against a list, especially since it will always be length 1.","commit_id":"a3113fa8daa56fab078a86cf9c73aa4bc3e4c595"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"10069555ffe8ad6be6b5a31efc765ccc8728f264","unresolved":false,"context_lines":[{"line_number":2469,"context_line":""},{"line_number":2470,"context_line":"        query \u003d session.query(models.CachedImages)"},{"line_number":2471,"context_line":"        query \u003d query.filter("},{"line_number":2472,"context_line":"            models.CachedImages.node_reference_id.in_(node_id))"},{"line_number":2473,"context_line":""},{"line_number":2474,"context_line":"        query.delete(synchronize_session\u003dFalse)"},{"line_number":2475,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"ffb223a8_576fd469","line":2472,"in_reply_to":"967ffe14_f7111c1a","updated":"2024-02-15 17:49:17.000000000","message":"Done","commit_id":"a3113fa8daa56fab078a86cf9c73aa4bc3e4c595"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"345d7fa216fa4cacd38537605d07eeae9ad00447","unresolved":true,"context_lines":[{"line_number":2469,"context_line":""},{"line_number":2470,"context_line":"        query \u003d session.query(models.CachedImages)"},{"line_number":2471,"context_line":"        query \u003d query.filter("},{"line_number":2472,"context_line":"            models.CachedImages.node_reference_id.in_(node_id))"},{"line_number":2473,"context_line":""},{"line_number":2474,"context_line":"        query.delete(synchronize_session\u003dFalse)"},{"line_number":2475,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"967ffe14_f7111c1a","line":2472,"in_reply_to":"a1b08e6e_1a142797","updated":"2024-02-13 18:49:21.000000000","message":"Ack, will try it tomorrow!!","commit_id":"a3113fa8daa56fab078a86cf9c73aa4bc3e4c595"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"1dc03e4d69e6af11c909c9fb3e132253cbe1eb60","unresolved":true,"context_lines":[{"line_number":2485,"context_line":"        query \u003d query.filter("},{"line_number":2486,"context_line":"            models.CachedImages.image_id \u003d\u003d image_id)"},{"line_number":2487,"context_line":"        query \u003d query.filter("},{"line_number":2488,"context_line":"            models.CachedImages.node_reference_id.in_(node_id))"},{"line_number":2489,"context_line":""},{"line_number":2490,"context_line":"        query.delete(synchronize_session\u003dFalse)"},{"line_number":2491,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"08c423f1_bb8d54d4","line":2488,"updated":"2024-02-13 18:43:10.000000000","message":"Same here.","commit_id":"a3113fa8daa56fab078a86cf9c73aa4bc3e4c595"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"10069555ffe8ad6be6b5a31efc765ccc8728f264","unresolved":false,"context_lines":[{"line_number":2485,"context_line":"        query \u003d query.filter("},{"line_number":2486,"context_line":"            models.CachedImages.image_id \u003d\u003d image_id)"},{"line_number":2487,"context_line":"        query \u003d query.filter("},{"line_number":2488,"context_line":"            models.CachedImages.node_reference_id.in_(node_id))"},{"line_number":2489,"context_line":""},{"line_number":2490,"context_line":"        query.delete(synchronize_session\u003dFalse)"},{"line_number":2491,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"11109854_b5189760","line":2488,"in_reply_to":"08c423f1_bb8d54d4","updated":"2024-02-15 17:49:17.000000000","message":"Done","commit_id":"a3113fa8daa56fab078a86cf9c73aa4bc3e4c595"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"1dc03e4d69e6af11c909c9fb3e132253cbe1eb60","unresolved":true,"context_lines":[{"line_number":2577,"context_line":"        query \u003d query.filter("},{"line_number":2578,"context_line":"            models.CachedImages.image_id \u003d\u003d image_id)"},{"line_number":2579,"context_line":"        query \u003d query.filter("},{"line_number":2580,"context_line":"            models.CachedImages.node_reference_id.in_(node_id))"},{"line_number":2581,"context_line":""},{"line_number":2582,"context_line":"        query.update({"},{"line_number":2583,"context_line":"            \u0027hits\u0027: models.CachedImages.hits + 1,"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a9d9c30_c353beec","line":2580,"updated":"2024-02-13 18:43:10.000000000","message":"and here","commit_id":"a3113fa8daa56fab078a86cf9c73aa4bc3e4c595"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"10069555ffe8ad6be6b5a31efc765ccc8728f264","unresolved":false,"context_lines":[{"line_number":2577,"context_line":"        query \u003d query.filter("},{"line_number":2578,"context_line":"            models.CachedImages.image_id \u003d\u003d image_id)"},{"line_number":2579,"context_line":"        query \u003d query.filter("},{"line_number":2580,"context_line":"            models.CachedImages.node_reference_id.in_(node_id))"},{"line_number":2581,"context_line":""},{"line_number":2582,"context_line":"        query.update({"},{"line_number":2583,"context_line":"            \u0027hits\u0027: models.CachedImages.hits + 1,"}],"source_content_type":"text/x-python","patch_set":12,"id":"e3456682_5d28e62f","line":2580,"in_reply_to":"1a9d9c30_c353beec","updated":"2024-02-15 17:49:17.000000000","message":"Done","commit_id":"a3113fa8daa56fab078a86cf9c73aa4bc3e4c595"}],"glance/tests/functional/db/test_sqlalchemy.py":[{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"f632ad5a9129db5dfe7ccf401b52a24883b96202","unresolved":true,"context_lines":[{"line_number":211,"context_line":"            for image in self.images:"},{"line_number":212,"context_line":"                self.db_api.insert_cache_details("},{"line_number":213,"context_line":"                    self.adm_context, \u0027node_url_1\u0027,"},{"line_number":214,"context_line":"                    image[\u0027id\u0027], image[\u0027size\u0027], hits\u003d3)"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"    def test_node_reference_get_by_url(self):"},{"line_number":217,"context_line":"        node_reference \u003d self.db_api.node_reference_get_by_url("}],"source_content_type":"text/x-python","patch_set":6,"id":"269afb10_433bbcbc","line":214,"updated":"2024-01-17 09:30:29.000000000","message":"@dan I need your help in resolving functional test. it is failing with integrity error for cached_images.id but it is auto_increment field and same is working for node_reference_id. (It is working well in the environment but failing only here).","commit_id":"9f489a26be801f8d4ab02fac3e71c415c7812763"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"10aee323a9ee61ad2fb38418f910a7823c3b10f2","unresolved":true,"context_lines":[{"line_number":211,"context_line":"            for image in self.images:"},{"line_number":212,"context_line":"                self.db_api.insert_cache_details("},{"line_number":213,"context_line":"                    self.adm_context, \u0027node_url_1\u0027,"},{"line_number":214,"context_line":"                    image[\u0027id\u0027], image[\u0027size\u0027], hits\u003d3)"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"    def test_node_reference_get_by_url(self):"},{"line_number":217,"context_line":"        node_reference \u003d self.db_api.node_reference_get_by_url("}],"source_content_type":"text/x-python","patch_set":6,"id":"b72258cb_daed8ea0","line":214,"in_reply_to":"14b36505_5aa66945","updated":"2024-01-17 18:06:41.000000000","message":"It worked, thank you!","commit_id":"9f489a26be801f8d4ab02fac3e71c415c7812763"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"3df8eb4db9820bdc60876ec92c7bb720a59d9d41","unresolved":true,"context_lines":[{"line_number":211,"context_line":"            for image in self.images:"},{"line_number":212,"context_line":"                self.db_api.insert_cache_details("},{"line_number":213,"context_line":"                    self.adm_context, \u0027node_url_1\u0027,"},{"line_number":214,"context_line":"                    image[\u0027id\u0027], image[\u0027size\u0027], hits\u003d3)"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"    def test_node_reference_get_by_url(self):"},{"line_number":217,"context_line":"        node_reference \u003d self.db_api.node_reference_get_by_url("}],"source_content_type":"text/x-python","patch_set":6,"id":"14b36505_5aa66945","line":214,"in_reply_to":"269afb10_433bbcbc","updated":"2024-01-17 16:00:37.000000000","message":"```\ndiff --git a/glance/db/sqlalchemy/models.py b/glance/db/sqlalchemy/models.py\nindex 50daf453b..aebd6ba44 100644\n--- a/glance/db/sqlalchemy/models.py\n+++ b/glance/db/sqlalchemy/models.py\n@@ -280,7 +280,7 @@ class CachedImages(BASE, models.ModelBase):\n         \u0027node_reference_id\u0027,\n         name\u003d\u0027ix_cached_images_image_id_node_reference_id\u0027),)\n\n-    id \u003d Column(BigInteger(),\n+    id \u003d Column(BigInteger().with_variant(Integer, \u0027sqlite\u0027),\n                 primary_key\u003dTrue, autoincrement\u003dTrue,\n                 nullable\u003dFalse)\n     image_id \u003d Column(String(36), nullable\u003dFalse)\n```\nIt\u0027s a sqlite quirk: https://medium.com/@jorlugaqui/fixing-sqlalchemy-autoincrement-issue-for-sqlite-997300307bda\n\nThis change makes it work for me.","commit_id":"9f489a26be801f8d4ab02fac3e71c415c7812763"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"ba9e4f825439fae33440953a8c41fb742814134c","unresolved":false,"context_lines":[{"line_number":211,"context_line":"            for image in self.images:"},{"line_number":212,"context_line":"                self.db_api.insert_cache_details("},{"line_number":213,"context_line":"                    self.adm_context, \u0027node_url_1\u0027,"},{"line_number":214,"context_line":"                    image[\u0027id\u0027], image[\u0027size\u0027], hits\u003d3)"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"    def test_node_reference_get_by_url(self):"},{"line_number":217,"context_line":"        node_reference \u003d self.db_api.node_reference_get_by_url("}],"source_content_type":"text/x-python","patch_set":6,"id":"ab6bf363_3670aee3","line":214,"in_reply_to":"b72258cb_daed8ea0","updated":"2024-01-17 18:38:20.000000000","message":"Done","commit_id":"9f489a26be801f8d4ab02fac3e71c415c7812763"}]}
