)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"3e2c8b5501be1ebed0120064963f1ea0c44a224f","unresolved":true,"context_lines":[{"line_number":4,"context_line":"Commit:     Mridula Joshi \u003cmrjoshi@redhat.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2022-05-18 11:01:00 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Update proposal for duplication image download"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"From PTG meeting, we update the solution of this proposal"},{"line_number":10,"context_line":"by writing the file to cache in chunks instead of writing"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"35ae2aad_826aee99","line":7,"range":{"start_line":7,"start_character":0,"end_line":7,"end_character":46},"updated":"2022-06-16 14:04:36.000000000","message":"If you have to put up a new patch set, I think this would be better as:\n\n   Update \"Eliminate Redundant Downloads\" proposal","commit_id":"31769b7b14726d9908534c4130cfb7a90d17d187"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"21f586e051c6d8810fdfd43fa59d682f1c0a75cb","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"dea9518c_4ab2c756","updated":"2022-05-02 23:30:04.000000000","message":"I\u0027m really glad you\u0027re interested in working on this!\n\nSome formatting issues and questions noted inline.","commit_id":"e268efb6e0064404f3ac2ba0bc59d8b7bcf2fe33"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"99badb829cea32e67664a79473b5da8783405fb5","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"e4bf2d5a_c9a7b299","updated":"2022-05-05 11:20:15.000000000","message":"Thanks Brian for looking through this. I hope my response inline is sufficient for your question of the approach.","commit_id":"e268efb6e0064404f3ac2ba0bc59d8b7bcf2fe33"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"3d8e8921ccf97a940e78af702acf5ff723cdd7d5","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"70ec2c64_a714be7e","updated":"2022-05-12 13:14:20.000000000","message":"@Erno: your response is fine, I\u0027d just like to see it documented in the spec.","commit_id":"8ec4cb88c4fd19d9772c4bd296134395ae59729d"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"5f64833a5a70bb7e0ebcd34cd0c956c3639d4bf0","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"260a9eab_76c970b3","updated":"2022-05-13 16:51:21.000000000","message":"Comment inline.","commit_id":"8ec4cb88c4fd19d9772c4bd296134395ae59729d"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"3cec9c49f6ea819b8bb00bdbafe2ed1757f9f8e5","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"579c96fc_3bdfc9d8","updated":"2025-10-01 07:57:43.000000000","message":"Hi Dan, thank you for the inputs, tried to answer your inline queries here.","commit_id":"31769b7b14726d9908534c4130cfb7a90d17d187"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e4ef426853bcff67b2d7d9c1b371845833f2c836","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"3fae23d9_6bc70fdd","updated":"2022-10-18 17:50:31.000000000","message":"I\u0027m assuming this needs to *at least* be amended to move it to antelope. I\u0027m putting my comments in here, having just looked at it for the first time. We might want to consider some of these points for the antelope spec(s) instead of just bumping it to the next release unchanged.","commit_id":"31769b7b14726d9908534c4130cfb7a90d17d187"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"3e2c8b5501be1ebed0120064963f1ea0c44a224f","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"f2befb41_a5e0c12c","updated":"2022-06-16 14:04:36.000000000","message":"I\u0027m still a bit skeptical that the failure-during-partial-problem isn\u0027t a problem, but if it doesn\u0027t bother anyone else, that\u0027s fine.  Either way, this proposal should be an improvement over what we currently have.","commit_id":"31769b7b14726d9908534c4130cfb7a90d17d187"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"cc1dc21ea0e6edf84fea58d0f7a10546935cc764","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"e1ad5298_b1a43907","updated":"2022-06-28 15:07:12.000000000","message":"Lets go ahead with this!!","commit_id":"31769b7b14726d9908534c4130cfb7a90d17d187"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"3fb89158596059639bb8c92afe5ac933ba8a61df","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"cde98261_6ec889db","updated":"2022-06-22 12:56:32.000000000","message":"Not against it, but are we really using Cucumber instead of English in specs now? This feels a bit confusing to me.","commit_id":"31769b7b14726d9908534c4130cfb7a90d17d187"},{"author":{"_account_id":33765,"name":"Mridula Joshi","email":"mrjoshi@redhat.com","username":"mrjoshi"},"change_message_id":"01a316b9b87dba629354d98ca63b88f5c7eff425","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"abf4edea_b0ba0fbc","updated":"2022-06-23 07:05:35.000000000","message":"Thanks for the review","commit_id":"31769b7b14726d9908534c4130cfb7a90d17d187"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"79ad357dcb12bddbdd9b7cf675bc87424a837f14","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"4b7248e2_6a932e54","updated":"2022-06-16 14:24:55.000000000","message":"This looks good to me as at least a start towards some improvement and we can always enhance it later if we receive some inputs from operator about the same.","commit_id":"31769b7b14726d9908534c4130cfb7a90d17d187"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"5df210262498e26a07dbcd3caccdcd268fc375b8","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"f83f3d51_bbfc0031","updated":"2022-05-18 11:50:05.000000000","message":"Works for me","commit_id":"31769b7b14726d9908534c4130cfb7a90d17d187"}],"specs/victoria/approved/glance/duplicate-downloads.rst":[{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"9092ac8a4b99d244fdbf0d5893295807249e3251","unresolved":false,"context_lines":[{"line_number":93,"context_line":"downloading directly from the store and a subset of those teeing"},{"line_number":94,"context_line":"data to the same location on the filesystem."},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"Ideally, any image download request that is received, regardless"},{"line_number":97,"context_line":"of cache state, would both encounter the same interface and"},{"line_number":98,"context_line":"execute the same code path to retrieve the image. We currently"},{"line_number":99,"context_line":"adhere to the former (i.e. consistent interface), but not the"},{"line_number":100,"context_line":"latter (i.e. we return different iterators based on cache state)."},{"line_number":101,"context_line":"This introduces unnecessary complexity into the system."},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"The proposed solution is for the first download request to instead of writing"},{"line_number":104,"context_line":"the whole file to the cache, we write the file to cache in chunks. Then, the"}],"source_content_type":"text/x-rst","patch_set":2,"id":"ff570b3c_fe014706","line":101,"range":{"start_line":96,"start_character":0,"end_line":101,"end_character":55},"updated":"2020-06-10 12:48:11.000000000","message":"This is not valid according our current plan.","commit_id":"46e37a967791f1a91494e401598acb74fb9a93c8"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"9092ac8a4b99d244fdbf0d5893295807249e3251","unresolved":false,"context_lines":[{"line_number":259,"context_line":"Assignee(s)"},{"line_number":260,"context_line":"-----------"},{"line_number":261,"context_line":""},{"line_number":262,"context_line":"Primary assignee: unassigned"},{"line_number":263,"context_line":""},{"line_number":264,"context_line":"Reviewers"},{"line_number":265,"context_line":"---------"}],"source_content_type":"text/x-rst","patch_set":2,"id":"ff570b3c_937484d2","line":262,"range":{"start_line":262,"start_character":18,"end_line":262,"end_character":28},"updated":"2020-06-10 12:48:11.000000000","message":"This would be you.","commit_id":"46e37a967791f1a91494e401598acb74fb9a93c8"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"9092ac8a4b99d244fdbf0d5893295807249e3251","unresolved":false,"context_lines":[{"line_number":264,"context_line":"Reviewers"},{"line_number":265,"context_line":"---------"},{"line_number":266,"context_line":""},{"line_number":267,"context_line":"Core reviewer(s): unassigned"},{"line_number":268,"context_line":""},{"line_number":269,"context_line":""},{"line_number":270,"context_line":"Work Items"}],"source_content_type":"text/x-rst","patch_set":2,"id":"ff570b3c_b37b88bc","line":267,"range":{"start_line":267,"start_character":18,"end_line":267,"end_character":28},"updated":"2020-06-10 12:48:11.000000000","message":"can add at least me here.","commit_id":"46e37a967791f1a91494e401598acb74fb9a93c8"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"9092ac8a4b99d244fdbf0d5893295807249e3251","unresolved":false,"context_lines":[{"line_number":272,"context_line":""},{"line_number":273,"context_line":"1. Add tests"},{"line_number":274,"context_line":"2. Update the cache methods in the drivers"},{"line_number":275,"context_line":"3. Add multi-process / thread safe cache worker(s) to middleware"},{"line_number":276,"context_line":"4. Update the cache request handler"},{"line_number":277,"context_line":"5. Update the cache response handler"},{"line_number":278,"context_line":"6. Update the docs"}],"source_content_type":"text/x-rst","patch_set":2,"id":"ff570b3c_73ac5035","line":275,"range":{"start_line":275,"start_character":0,"end_line":275,"end_character":64},"updated":"2020-06-10 12:48:11.000000000","message":"This is not required.","commit_id":"46e37a967791f1a91494e401598acb74fb9a93c8"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"3806b7b94258d480b25b9af0ca75d8aaf5519ea7","unresolved":false,"context_lines":[{"line_number":94,"context_line":"data to the same location on the filesystem."},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"The proposed solution is for the first download request to instead of writing"},{"line_number":97,"context_line":"the whole file to the cache, we write the file to cache in chunks. Then, the"},{"line_number":98,"context_line":"subsequent download requests read from the chunks that have been written. Once"},{"line_number":99,"context_line":"the subsequent request finishes reading all the available chunks in the cache,"},{"line_number":100,"context_line":"it will wait for the next available chunk written to the cache by the first"}],"source_content_type":"text/x-rst","patch_set":3,"id":"ff570b3c_1cd995f3","line":97,"range":{"start_line":97,"start_character":59,"end_line":97,"end_character":65},"updated":"2020-06-11 05:22:57.000000000","message":"Do we need to describe what is the chunk size, is it configurable?\n\nHow much waiting time for next chunk? what happens while waiting if original image is deleted?\n\nAlso at the moment we have dependency of glance-cache-manage tool to delete cached images, so we need to modify delete operation as well.\n\nWe also need to mention that upon upgrade cache needs to be cleaned before using this new behavior (new upgrade check).","commit_id":"4193c470f746497bb1bc0b044d3e135000f005bc"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"66c3c5ef75d23bd76d741c9134e8054f2f4e9cc5","unresolved":false,"context_lines":[{"line_number":94,"context_line":"data to the same location on the filesystem."},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"The proposed solution is for the first download request to instead of writing"},{"line_number":97,"context_line":"the whole file to the cache, we write the file to cache in chunks. Then, the"},{"line_number":98,"context_line":"subsequent download requests read from the chunks that have been written. Once"},{"line_number":99,"context_line":"the subsequent request finishes reading all the available chunks in the cache,"},{"line_number":100,"context_line":"it will wait for the next available chunk written to the cache by the first"}],"source_content_type":"text/x-rst","patch_set":3,"id":"bf51134e_fe70b50a","line":97,"range":{"start_line":97,"start_character":59,"end_line":97,"end_character":65},"in_reply_to":"bf51134e_deec75f5","updated":"2020-06-23 14:34:50.000000000","message":"Makes sense","commit_id":"4193c470f746497bb1bc0b044d3e135000f005bc"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"b213ace6faf0947adfd30120a4c7b1337da32b81","unresolved":false,"context_lines":[{"line_number":94,"context_line":"data to the same location on the filesystem."},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"The proposed solution is for the first download request to instead of writing"},{"line_number":97,"context_line":"the whole file to the cache, we write the file to cache in chunks. Then, the"},{"line_number":98,"context_line":"subsequent download requests read from the chunks that have been written. Once"},{"line_number":99,"context_line":"the subsequent request finishes reading all the available chunks in the cache,"},{"line_number":100,"context_line":"it will wait for the next available chunk written to the cache by the first"}],"source_content_type":"text/x-rst","patch_set":3,"id":"ff570b3c_9d4d9c9b","line":97,"range":{"start_line":97,"start_character":59,"end_line":97,"end_character":65},"in_reply_to":"ff570b3c_1cd995f3","updated":"2020-06-11 12:54:56.000000000","message":"\u003e Do we need to describe what is the chunk size, is it configurable?\n\nI\u0027d rather not make it configurable at least initially like discussed during the PTG session. I think the choosing the right chuk size needs bit of experimenting but somewhere around 500MB-1GB should be sufficient.\n \u003e \n \u003e How much waiting time for next chunk? what happens while waiting if\n \u003e original image is deleted?\n\nHow long is piece of string? So obviously this depends how well the store performs, how utilized and fast the networks are etc. If we decide to keep the chunk size around or below a gig, I wouldn\u0027t expect wait times averaging more than few seconds between chunks even in busy systems. The client doesn\u0027t need to even know that we\u0027re waiting. As long as we stay below any tcp connection timeouts (which is by default 60 seconds, I think). The client just sees small pause on the data stream, which is by spec and gets naturally handled in the connection control. We do not send \"chunks\" to the client but uniform datastream like we do currently, we just combind the cached chunks from the disk so this is transparent to the client.\n\nI think if you currently delete image while it\u0027s downloading the downloads will fail and that will continue to be the case.\n \u003e \n \u003e Also at the moment we have dependency of glance-cache-manage tool\n \u003e to delete cached images, so we need to modify delete operation as\n \u003e well.\n\nYes, the work item 2 is to make sure that the driver cache methods are modified to be able to deal with the chunked caching.\n \u003e \n \u003e We also need to mention that upon upgrade cache needs to be cleaned\n \u003e before using this new behavior (new upgrade check).\n\nThis is not necessary with the simplified chunked caching where we do not combine the cache to single file at the end. (That part was removed from the plans due to the complexity and i/o-load it causes without real benefits.)","commit_id":"4193c470f746497bb1bc0b044d3e135000f005bc"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"a7682c4e1039821b6a797a46282193dad9fa2b9a","unresolved":false,"context_lines":[{"line_number":94,"context_line":"data to the same location on the filesystem."},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"The proposed solution is for the first download request to instead of writing"},{"line_number":97,"context_line":"the whole file to the cache, we write the file to cache in chunks. Then, the"},{"line_number":98,"context_line":"subsequent download requests read from the chunks that have been written. Once"},{"line_number":99,"context_line":"the subsequent request finishes reading all the available chunks in the cache,"},{"line_number":100,"context_line":"it will wait for the next available chunk written to the cache by the first"}],"source_content_type":"text/x-rst","patch_set":3,"id":"ff570b3c_d3e8a3b4","line":97,"range":{"start_line":97,"start_character":59,"end_line":97,"end_character":65},"in_reply_to":"ff570b3c_9d4d9c9b","updated":"2020-06-11 14:02:49.000000000","message":"So for the last part regarding cleaning of cache;\n\nIf we don\u0027t do this the legacy cache images will be single file and new cached images will be chunked files in folder named with image-id.\n\nSo either we need to tweek the reading logic accordingly?","commit_id":"4193c470f746497bb1bc0b044d3e135000f005bc"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"8e8e9064acf1de4fc2f2491876cee4e8f769a7d4","unresolved":false,"context_lines":[{"line_number":94,"context_line":"data to the same location on the filesystem."},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"The proposed solution is for the first download request to instead of writing"},{"line_number":97,"context_line":"the whole file to the cache, we write the file to cache in chunks. Then, the"},{"line_number":98,"context_line":"subsequent download requests read from the chunks that have been written. Once"},{"line_number":99,"context_line":"the subsequent request finishes reading all the available chunks in the cache,"},{"line_number":100,"context_line":"it will wait for the next available chunk written to the cache by the first"}],"source_content_type":"text/x-rst","patch_set":3,"id":"bf51134e_deec75f5","line":97,"range":{"start_line":97,"start_character":59,"end_line":97,"end_character":65},"in_reply_to":"ff570b3c_d3e8a3b4","updated":"2020-06-13 13:57:02.000000000","message":"Well the reading logic will need to be tweaked anyways to be able to serve the images for those requests that came when the caching was in flight. That means not doing it is not causing any extra work, just simplifying and keeping the I/Os under control.","commit_id":"4193c470f746497bb1bc0b044d3e135000f005bc"}],"specs/zed/approved/glance/duplicate-downloads.rst":[{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"21f586e051c6d8810fdfd43fa59d682f1c0a75cb","unresolved":true,"context_lines":[{"line_number":94,"context_line":"data to the same location on the filesystem."},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"The proposed solution is for the first download request to instead of writing"},{"line_number":97,"context_line":"the whole file to the cache, we write the file to cache in chunks. Then, the"},{"line_number":98,"context_line":"subsequent download requests read from the chunks that have been written. Once"},{"line_number":99,"context_line":"the subsequent request finishes reading all the available chunks in the cache,"},{"line_number":100,"context_line":"it will wait for the next available chunk written to the cache by the first"},{"line_number":101,"context_line":"request. It will keep doing this until the first request finishes all the"}],"source_content_type":"text/x-rst","patch_set":5,"id":"a9025f89_54b27e6e","line":98,"range":{"start_line":97,"start_character":67,"end_line":98,"end_character":73},"updated":"2022-05-02 23:30:04.000000000","message":"Suppose that during download, the image is deleted.  Then the caching will fail, and you will get a failed download for the original + all subsequent requests (as you should), but note that you have used up a lot of network bandwidth for no purpose.  Why not block on subsequent requests until you know that the download to the cache will succeed, instead of reading chunks as they become available?","commit_id":"e268efb6e0064404f3ac2ba0bc59d8b7bcf2fe33"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"3d8e8921ccf97a940e78af702acf5ff723cdd7d5","unresolved":true,"context_lines":[{"line_number":94,"context_line":"data to the same location on the filesystem."},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"The proposed solution is for the first download request to instead of writing"},{"line_number":97,"context_line":"the whole file to the cache, we write the file to cache in chunks. Then, the"},{"line_number":98,"context_line":"subsequent download requests read from the chunks that have been written. Once"},{"line_number":99,"context_line":"the subsequent request finishes reading all the available chunks in the cache,"},{"line_number":100,"context_line":"it will wait for the next available chunk written to the cache by the first"},{"line_number":101,"context_line":"request. It will keep doing this until the first request finishes all the"}],"source_content_type":"text/x-rst","patch_set":5,"id":"2a93eeaa_79f6e1a2","line":98,"range":{"start_line":97,"start_character":67,"end_line":98,"end_character":73},"in_reply_to":"02626546_bb7b56b3","updated":"2022-05-12 13:14:20.000000000","message":"Well, it\u0027s not just deletion; same thing will happen if the download to the cache is interrupted or something.  It\u0027s fine if we want to regard that as a low-likelihood occurrence, I\u0027d just like to see something in the spec saying that we considered the issue and rejected it.\n\nI guess the main point is that if you\u0027re going to boot 1K instances, you should make sure the image is cached before you do the boot.  On the other hand, since the cache is local to each glance node, that won\u0027t do an end user any good (assuming we\u0027re willing to expose the cache contents (or maybe only the images accessible to the end user making the request)) unless they know the cloud topology, i.e., which glance serves the computes where they want the instance build to land.","commit_id":"e268efb6e0064404f3ac2ba0bc59d8b7bcf2fe33"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"5a44f4ff9ef406f3e125f91352bcc082f6d9c6bb","unresolved":true,"context_lines":[{"line_number":94,"context_line":"data to the same location on the filesystem."},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"The proposed solution is for the first download request to instead of writing"},{"line_number":97,"context_line":"the whole file to the cache, we write the file to cache in chunks. Then, the"},{"line_number":98,"context_line":"subsequent download requests read from the chunks that have been written. Once"},{"line_number":99,"context_line":"the subsequent request finishes reading all the available chunks in the cache,"},{"line_number":100,"context_line":"it will wait for the next available chunk written to the cache by the first"},{"line_number":101,"context_line":"request. It will keep doing this until the first request finishes all the"}],"source_content_type":"text/x-rst","patch_set":5,"id":"7c80ad71_d3e316e3","line":98,"range":{"start_line":97,"start_character":67,"end_line":98,"end_character":73},"in_reply_to":"2a93eeaa_79f6e1a2","updated":"2022-05-12 15:19:56.000000000","message":"As Mridula kindly pointed out, this approach is listed 2nd at the Alternatives section already. Is that enough as indication it was considered?","commit_id":"e268efb6e0064404f3ac2ba0bc59d8b7bcf2fe33"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"5f64833a5a70bb7e0ebcd34cd0c956c3639d4bf0","unresolved":true,"context_lines":[{"line_number":94,"context_line":"data to the same location on the filesystem."},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"The proposed solution is for the first download request to instead of writing"},{"line_number":97,"context_line":"the whole file to the cache, we write the file to cache in chunks. Then, the"},{"line_number":98,"context_line":"subsequent download requests read from the chunks that have been written. Once"},{"line_number":99,"context_line":"the subsequent request finishes reading all the available chunks in the cache,"},{"line_number":100,"context_line":"it will wait for the next available chunk written to the cache by the first"},{"line_number":101,"context_line":"request. It will keep doing this until the first request finishes all the"}],"source_content_type":"text/x-rst","patch_set":5,"id":"03871ed7_a9a7805e","line":98,"range":{"start_line":97,"start_character":67,"end_line":98,"end_character":73},"in_reply_to":"7c80ad71_d3e316e3","updated":"2022-05-13 16:51:21.000000000","message":"Maybe I\u0027m not reading carefully enough, but with the exception of the config option, Alternative #2 sounds exactly like what you\u0027re proposing here ... especially the part that says \"It comes at the cost of all downloads occurring while an image is being cached depending on that single cache to be successful. This means a cache failure could result in more clients needing to retry, potentially after waiting for nearly the entire image to download\", which I take it is the reason why Alternative #2 was an alternative and not the proposed change when the spec was originally written.  So I think you do need to explain why you are OK with accepting this tradeoff.","commit_id":"e268efb6e0064404f3ac2ba0bc59d8b7bcf2fe33"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"99badb829cea32e67664a79473b5da8783405fb5","unresolved":true,"context_lines":[{"line_number":94,"context_line":"data to the same location on the filesystem."},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"The proposed solution is for the first download request to instead of writing"},{"line_number":97,"context_line":"the whole file to the cache, we write the file to cache in chunks. Then, the"},{"line_number":98,"context_line":"subsequent download requests read from the chunks that have been written. Once"},{"line_number":99,"context_line":"the subsequent request finishes reading all the available chunks in the cache,"},{"line_number":100,"context_line":"it will wait for the next available chunk written to the cache by the first"},{"line_number":101,"context_line":"request. It will keep doing this until the first request finishes all the"}],"source_content_type":"text/x-rst","patch_set":5,"id":"02626546_bb7b56b3","line":98,"range":{"start_line":97,"start_character":67,"end_line":98,"end_character":73},"in_reply_to":"a9025f89_54b27e6e","updated":"2022-05-05 11:20:15.000000000","message":"I have few reasons in mind why not to, but lets be realistic here. How often you expect this to happen? How often did you see people deleting their images before they got their instances up and running from it when you were part of operating public cloud? I can\u0027t recall a single occurence from my times that would have came to our attention, but you were part of much bigger deployment.\n\nI think the reasoning for caching in general is to speed up the boot process, not to slow it down. Based on your experience is what you proposed there common and big enough issue to make the trade off?\n\nPurely techincal; delaying the requests introduces another can of worms I\u0027m not sure we do want to open. We would need to have some keepalive introduced in case caching the full image takes longer than our timeouts are for the request.\n\nHow would we communicate to the user that their operation is delayed because we have cache enabled?\n\nI see your proposal only addressing if the image is deleted while we\u0027re caching it, not if it\u0027s deleted while we are serving it from cache (iirc delete will clean it from cache too, failing the inflight requests again), so should we hold on that request forever or just fail all downloads to start with? That would save all the bandwidth 😜\n\nAlso wondering how much extra complexities the \"hold up\" code would potentially bring and how would we track those connections.","commit_id":"e268efb6e0064404f3ac2ba0bc59d8b7bcf2fe33"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"21f586e051c6d8810fdfd43fa59d682f1c0a75cb","unresolved":true,"context_lines":[{"line_number":102,"context_line":"chunks."},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"For the first request:"},{"line_number":105,"context_line":".. code-block:: none"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    if the cache entry does not exist:"},{"line_number":108,"context_line":"        mark the image \"caching\""}],"source_content_type":"text/x-rst","patch_set":5,"id":"68908869_cbbef2d1","line":105,"range":{"start_line":105,"start_character":0,"end_line":105,"end_character":20},"updated":"2022-05-02 23:30:04.000000000","message":"you need to have a blank line before the code-block directive","commit_id":"e268efb6e0064404f3ac2ba0bc59d8b7bcf2fe33"},{"author":{"_account_id":33765,"name":"Mridula Joshi","email":"mrjoshi@redhat.com","username":"mrjoshi"},"change_message_id":"2dd9ad1077cc5789b15d72f66bb27036621ccdf8","unresolved":false,"context_lines":[{"line_number":102,"context_line":"chunks."},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"For the first request:"},{"line_number":105,"context_line":".. code-block:: none"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    if the cache entry does not exist:"},{"line_number":108,"context_line":"        mark the image \"caching\""}],"source_content_type":"text/x-rst","patch_set":5,"id":"528a2b00_12f4f5ef","line":105,"range":{"start_line":105,"start_character":0,"end_line":105,"end_character":20},"in_reply_to":"68908869_cbbef2d1","updated":"2022-05-12 10:04:06.000000000","message":"Done","commit_id":"e268efb6e0064404f3ac2ba0bc59d8b7bcf2fe33"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"253922ba08d5c4f25a43e6d85868839d72c319e3","unresolved":true,"context_lines":[{"line_number":108,"context_line":"        mark the image \"caching\""},{"line_number":109,"context_line":"        create a new folder in the cache directory with the image id"},{"line_number":110,"context_line":"        take the iterator from the download (like we are doing now)"},{"line_number":111,"context_line":"        write the data in 1GB chunks to cache"},{"line_number":112,"context_line":"        upon finish, mark the image \"cached\""},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"For the subsequent request:"}],"source_content_type":"text/x-rst","patch_set":5,"id":"b2254c17_db2c5024","line":111,"range":{"start_line":111,"start_character":26,"end_line":111,"end_character":29},"updated":"2022-04-27 05:18:14.000000000","message":"Should this be configurable and default value 1 GB?","commit_id":"e268efb6e0064404f3ac2ba0bc59d8b7bcf2fe33"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"83a5d33a0fb7feb6434f40608aeb0072f282d98d","unresolved":true,"context_lines":[{"line_number":108,"context_line":"        mark the image \"caching\""},{"line_number":109,"context_line":"        create a new folder in the cache directory with the image id"},{"line_number":110,"context_line":"        take the iterator from the download (like we are doing now)"},{"line_number":111,"context_line":"        write the data in 1GB chunks to cache"},{"line_number":112,"context_line":"        upon finish, mark the image \"cached\""},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"For the subsequent request:"}],"source_content_type":"text/x-rst","patch_set":5,"id":"705421a1_3907cf5b","line":111,"range":{"start_line":111,"start_character":26,"end_line":111,"end_character":29},"in_reply_to":"b2254c17_db2c5024","updated":"2022-04-27 11:28:44.000000000","message":"I\u0027m not convinced it should. I have strong feeling it would be yet another config option that no-one cares and changes from the default value cluttering our config files. As this is all Glance internal operation, we can easily make it configurable  later if we start getting requests from operators for it.","commit_id":"e268efb6e0064404f3ac2ba0bc59d8b7bcf2fe33"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"21f586e051c6d8810fdfd43fa59d682f1c0a75cb","unresolved":true,"context_lines":[{"line_number":112,"context_line":"        upon finish, mark the image \"cached\""},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"For the subsequent request:"},{"line_number":115,"context_line":".. code-block:: none"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    if the image is marked \"caching\" or \"cached\":"},{"line_number":118,"context_line":"        read the chunk from the cache until we get all the expected chunks"}],"source_content_type":"text/x-rst","patch_set":5,"id":"54353603_9cee093b","line":115,"range":{"start_line":115,"start_character":0,"end_line":115,"end_character":20},"updated":"2022-05-02 23:30:04.000000000","message":"you need to have a blank line before the code-block directive","commit_id":"e268efb6e0064404f3ac2ba0bc59d8b7bcf2fe33"},{"author":{"_account_id":33765,"name":"Mridula Joshi","email":"mrjoshi@redhat.com","username":"mrjoshi"},"change_message_id":"2dd9ad1077cc5789b15d72f66bb27036621ccdf8","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        upon finish, mark the image \"cached\""},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"For the subsequent request:"},{"line_number":115,"context_line":".. code-block:: none"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    if the image is marked \"caching\" or \"cached\":"},{"line_number":118,"context_line":"        read the chunk from the cache until we get all the expected chunks"}],"source_content_type":"text/x-rst","patch_set":5,"id":"dcf80b50_595cead0","line":115,"range":{"start_line":115,"start_character":0,"end_line":115,"end_character":20},"in_reply_to":"54353603_9cee093b","updated":"2022-05-12 10:04:06.000000000","message":"Done","commit_id":"e268efb6e0064404f3ac2ba0bc59d8b7bcf2fe33"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"253922ba08d5c4f25a43e6d85868839d72c319e3","unresolved":true,"context_lines":[{"line_number":282,"context_line":"Testing"},{"line_number":283,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"SEE Problem Description for scenarios to be tested."},{"line_number":286,"context_line":""},{"line_number":287,"context_line":""},{"line_number":288,"context_line":"Documentation Impact"}],"source_content_type":"text/x-rst","patch_set":5,"id":"0355e107_4f687103","line":285,"range":{"start_line":285,"start_character":0,"end_line":285,"end_character":51},"updated":"2022-04-27 05:18:14.000000000","message":"We need some unit and functional test for the same.\nAlso we can think on how we can verify this behavior using tempest as a follow up work.","commit_id":"e268efb6e0064404f3ac2ba0bc59d8b7bcf2fe33"},{"author":{"_account_id":33765,"name":"Mridula Joshi","email":"mrjoshi@redhat.com","username":"mrjoshi"},"change_message_id":"2dd9ad1077cc5789b15d72f66bb27036621ccdf8","unresolved":false,"context_lines":[{"line_number":282,"context_line":"Testing"},{"line_number":283,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"SEE Problem Description for scenarios to be tested."},{"line_number":286,"context_line":""},{"line_number":287,"context_line":""},{"line_number":288,"context_line":"Documentation Impact"}],"source_content_type":"text/x-rst","patch_set":5,"id":"1e40c4e3_711270ea","line":285,"range":{"start_line":285,"start_character":0,"end_line":285,"end_character":51},"in_reply_to":"0355e107_4f687103","updated":"2022-05-12 10:04:06.000000000","message":"Done","commit_id":"e268efb6e0064404f3ac2ba0bc59d8b7bcf2fe33"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"21f586e051c6d8810fdfd43fa59d682f1c0a75cb","unresolved":true,"context_lines":[{"line_number":294,"context_line":"References"},{"line_number":295,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":296,"context_line":""},{"line_number":297,"context_line":"None"}],"source_content_type":"text/x-rst","patch_set":5,"id":"aaafe51e_f206b66c","line":297,"range":{"start_line":297,"start_character":0,"end_line":297,"end_character":4},"updated":"2022-05-02 23:30:04.000000000","message":"Please include a reference to the original spec review:\n\nhttps://review.opendev.org/c/openstack/glance-specs/+/206120","commit_id":"e268efb6e0064404f3ac2ba0bc59d8b7bcf2fe33"},{"author":{"_account_id":33765,"name":"Mridula Joshi","email":"mrjoshi@redhat.com","username":"mrjoshi"},"change_message_id":"2dd9ad1077cc5789b15d72f66bb27036621ccdf8","unresolved":false,"context_lines":[{"line_number":294,"context_line":"References"},{"line_number":295,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":296,"context_line":""},{"line_number":297,"context_line":"None"}],"source_content_type":"text/x-rst","patch_set":5,"id":"1c9a355a_9f6e5f12","line":297,"range":{"start_line":297,"start_character":0,"end_line":297,"end_character":4},"in_reply_to":"aaafe51e_f206b66c","updated":"2022-05-12 10:04:06.000000000","message":"Done","commit_id":"e268efb6e0064404f3ac2ba0bc59d8b7bcf2fe33"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"a2f7739ca3b56e1a2b599e8a4a389b5dab0334ee","unresolved":true,"context_lines":[{"line_number":1,"context_line":".."},{"line_number":2,"context_line":" This work is licensed under a Creative Commons Attribution 3.0 Unported"},{"line_number":3,"context_line":" License."},{"line_number":4,"context_line":""}],"source_content_type":"text/x-rst","patch_set":8,"id":"b350a59c_7a7c0989","line":1,"updated":"2022-05-18 10:53:24.000000000","message":"I think you should use ``git mv`` to only highlight the changes from the original spec file if that was intended as every project has different preferences.","commit_id":"627ea3594693337988f4b724953e1e82e1dff6b8"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"3fb89158596059639bb8c92afe5ac933ba8a61df","unresolved":true,"context_lines":[{"line_number":22,"context_line":"Problem description"},{"line_number":23,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":".. code:: cucumber"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    Feature: Elasticity"},{"line_number":28,"context_line":""}],"source_content_type":"text/x-rst","patch_set":9,"id":"806e4302_e2e0e73c","line":25,"range":{"start_line":25,"start_character":10,"end_line":25,"end_character":18},"updated":"2022-06-22 12:56:32.000000000","message":"Do we use cucumber in specs now?","commit_id":"31769b7b14726d9908534c4130cfb7a90d17d187"},{"author":{"_account_id":33765,"name":"Mridula Joshi","email":"mrjoshi@redhat.com","username":"mrjoshi"},"change_message_id":"01a316b9b87dba629354d98ca63b88f5c7eff425","unresolved":true,"context_lines":[{"line_number":22,"context_line":"Problem description"},{"line_number":23,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":".. code:: cucumber"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    Feature: Elasticity"},{"line_number":28,"context_line":""}],"source_content_type":"text/x-rst","patch_set":9,"id":"f705eb46_e0612fc1","line":25,"range":{"start_line":25,"start_character":10,"end_line":25,"end_character":18},"in_reply_to":"806e4302_e2e0e73c","updated":"2022-06-23 07:05:35.000000000","message":"It is an existing spec and cucumber is used for better formatting purpose, so I left it as it is","commit_id":"31769b7b14726d9908534c4130cfb7a90d17d187"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e4ef426853bcff67b2d7d9c1b371845833f2c836","unresolved":true,"context_lines":[{"line_number":52,"context_line":"            When 2 concurrent requests for the image are made"},{"line_number":53,"context_line":"            And mid-download the client closes the first connection"},{"line_number":54,"context_line":"            Then only the first download request will fail"},{"line_number":55,"context_line":"            And the image will be cached on the Glance API node"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"        Scenario: Stream to all requests while caching"},{"line_number":58,"context_line":"            Given a Glance API node (1) with this feature deployed"}],"source_content_type":"text/x-rst","patch_set":9,"id":"3be48ad9_d244f1e1","line":55,"updated":"2022-10-18 17:50:31.000000000","message":"Is this describing what you want to happen after the change or what happens today?","commit_id":"31769b7b14726d9908534c4130cfb7a90d17d187"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"3cec9c49f6ea819b8bb00bdbafe2ed1757f9f8e5","unresolved":true,"context_lines":[{"line_number":52,"context_line":"            When 2 concurrent requests for the image are made"},{"line_number":53,"context_line":"            And mid-download the client closes the first connection"},{"line_number":54,"context_line":"            Then only the first download request will fail"},{"line_number":55,"context_line":"            And the image will be cached on the Glance API node"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"        Scenario: Stream to all requests while caching"},{"line_number":58,"context_line":"            Given a Glance API node (1) with this feature deployed"}],"source_content_type":"text/x-rst","patch_set":9,"id":"fc280483_695b3063","line":55,"in_reply_to":"3be48ad9_d244f1e1","updated":"2025-10-01 07:57:43.000000000","message":"IMO this is a desired behaviour after the change","commit_id":"31769b7b14726d9908534c4130cfb7a90d17d187"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e4ef426853bcff67b2d7d9c1b371845833f2c836","unresolved":true,"context_lines":[{"line_number":86,"context_line":""},{"line_number":87,"context_line":"Therefore, depending on the state of the cache, one of three"},{"line_number":88,"context_line":"iterators can be returned: an iterator to the cache (if the image"},{"line_number":89,"context_line":"is completely cached), an iterator to the store (if the image is"},{"line_number":90,"context_line":"partially cached), or a teeing iterator that streams from the"},{"line_number":91,"context_line":"store and writes to the cache (if the image is completely"},{"line_number":92,"context_line":"uncached). This approach is racey and can result in many responses"},{"line_number":93,"context_line":"downloading directly from the store and a subset of those teeing"}],"source_content_type":"text/x-rst","patch_set":9,"id":"a4ed6c98_b5676151","line":90,"range":{"start_line":89,"start_character":23,"end_line":90,"end_character":17},"updated":"2022-10-18 17:50:31.000000000","message":"Does this mean that if an image is partially-cached (i.e. a previous attempt failed) then it will never get finished via a tee?","commit_id":"31769b7b14726d9908534c4130cfb7a90d17d187"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"3cec9c49f6ea819b8bb00bdbafe2ed1757f9f8e5","unresolved":true,"context_lines":[{"line_number":86,"context_line":""},{"line_number":87,"context_line":"Therefore, depending on the state of the cache, one of three"},{"line_number":88,"context_line":"iterators can be returned: an iterator to the cache (if the image"},{"line_number":89,"context_line":"is completely cached), an iterator to the store (if the image is"},{"line_number":90,"context_line":"partially cached), or a teeing iterator that streams from the"},{"line_number":91,"context_line":"store and writes to the cache (if the image is completely"},{"line_number":92,"context_line":"uncached). This approach is racey and can result in many responses"},{"line_number":93,"context_line":"downloading directly from the store and a subset of those teeing"}],"source_content_type":"text/x-rst","patch_set":9,"id":"fb2fb131_55d3dd82","line":90,"range":{"start_line":89,"start_character":23,"end_line":90,"end_character":17},"in_reply_to":"a4ed6c98_b5676151","updated":"2025-10-01 07:57:43.000000000","message":"Yes","commit_id":"31769b7b14726d9908534c4130cfb7a90d17d187"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e4ef426853bcff67b2d7d9c1b371845833f2c836","unresolved":true,"context_lines":[{"line_number":89,"context_line":"is completely cached), an iterator to the store (if the image is"},{"line_number":90,"context_line":"partially cached), or a teeing iterator that streams from the"},{"line_number":91,"context_line":"store and writes to the cache (if the image is completely"},{"line_number":92,"context_line":"uncached). This approach is racey and can result in many responses"},{"line_number":93,"context_line":"downloading directly from the store and a subset of those teeing"},{"line_number":94,"context_line":"data to the same location on the filesystem."},{"line_number":95,"context_line":""}],"source_content_type":"text/x-rst","patch_set":9,"id":"9e08a919_5e2fc80d","line":92,"range":{"start_line":92,"start_character":28,"end_line":92,"end_character":33},"updated":"2022-10-18 17:50:31.000000000","message":"\"racy\"","commit_id":"31769b7b14726d9908534c4130cfb7a90d17d187"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"3cec9c49f6ea819b8bb00bdbafe2ed1757f9f8e5","unresolved":false,"context_lines":[{"line_number":89,"context_line":"is completely cached), an iterator to the store (if the image is"},{"line_number":90,"context_line":"partially cached), or a teeing iterator that streams from the"},{"line_number":91,"context_line":"store and writes to the cache (if the image is completely"},{"line_number":92,"context_line":"uncached). This approach is racey and can result in many responses"},{"line_number":93,"context_line":"downloading directly from the store and a subset of those teeing"},{"line_number":94,"context_line":"data to the same location on the filesystem."},{"line_number":95,"context_line":""}],"source_content_type":"text/x-rst","patch_set":9,"id":"8643be63_8c534dc9","line":92,"range":{"start_line":92,"start_character":28,"end_line":92,"end_character":33},"in_reply_to":"9e08a919_5e2fc80d","updated":"2025-10-01 07:57:43.000000000","message":"Acknowledged","commit_id":"31769b7b14726d9908534c4130cfb7a90d17d187"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"3fb89158596059639bb8c92afe5ac933ba8a61df","unresolved":true,"context_lines":[{"line_number":91,"context_line":"store and writes to the cache (if the image is completely"},{"line_number":92,"context_line":"uncached). This approach is racey and can result in many responses"},{"line_number":93,"context_line":"downloading directly from the store and a subset of those teeing"},{"line_number":94,"context_line":"data to the same location on the filesystem."},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"The proposed solution is for the first download request to instead of writing"},{"line_number":97,"context_line":"the whole file to the cache, we write the file to cache in chunks. Then, the"}],"source_content_type":"text/x-rst","patch_set":9,"id":"5caed24b_650a5448","line":94,"range":{"start_line":94,"start_character":33,"end_line":94,"end_character":43},"updated":"2022-06-22 12:56:32.000000000","message":"This could be a bullet list to make things clearer.","commit_id":"31769b7b14726d9908534c4130cfb7a90d17d187"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e4ef426853bcff67b2d7d9c1b371845833f2c836","unresolved":true,"context_lines":[{"line_number":91,"context_line":"store and writes to the cache (if the image is completely"},{"line_number":92,"context_line":"uncached). This approach is racey and can result in many responses"},{"line_number":93,"context_line":"downloading directly from the store and a subset of those teeing"},{"line_number":94,"context_line":"data to the same location on the filesystem."},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"The proposed solution is for the first download request to instead of writing"},{"line_number":97,"context_line":"the whole file to the cache, we write the file to cache in chunks. Then, the"}],"source_content_type":"text/x-rst","patch_set":9,"id":"d0b0c31c_ad9b05a4","line":94,"range":{"start_line":94,"start_character":33,"end_line":94,"end_character":43},"in_reply_to":"072cbc6f_808963b2","updated":"2022-10-18 17:50:31.000000000","message":"I also wonder what happens currently if we get two connections that are both attempting to tee-cache the file, and the *second* one is terminated by the client. I suspect maybe the first one will continue writing to the deleted file, but the one left by the second cacher will be left on the filesystem, incomplete. If the first one marks the image as cached in the sqlite DB, but does not realize its file on disk is not the actual one left reachable in the directory by the terminated second cacher, will we think we have a cached image that is in fact partial?","commit_id":"31769b7b14726d9908534c4130cfb7a90d17d187"},{"author":{"_account_id":33765,"name":"Mridula Joshi","email":"mrjoshi@redhat.com","username":"mrjoshi"},"change_message_id":"01a316b9b87dba629354d98ca63b88f5c7eff425","unresolved":true,"context_lines":[{"line_number":91,"context_line":"store and writes to the cache (if the image is completely"},{"line_number":92,"context_line":"uncached). This approach is racey and can result in many responses"},{"line_number":93,"context_line":"downloading directly from the store and a subset of those teeing"},{"line_number":94,"context_line":"data to the same location on the filesystem."},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"The proposed solution is for the first download request to instead of writing"},{"line_number":97,"context_line":"the whole file to the cache, we write the file to cache in chunks. Then, the"}],"source_content_type":"text/x-rst","patch_set":9,"id":"072cbc6f_808963b2","line":94,"range":{"start_line":94,"start_character":33,"end_line":94,"end_character":43},"in_reply_to":"5caed24b_650a5448","updated":"2022-06-23 07:05:35.000000000","message":"This is explained better at line #104","commit_id":"31769b7b14726d9908534c4130cfb7a90d17d187"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"3cec9c49f6ea819b8bb00bdbafe2ed1757f9f8e5","unresolved":true,"context_lines":[{"line_number":91,"context_line":"store and writes to the cache (if the image is completely"},{"line_number":92,"context_line":"uncached). This approach is racey and can result in many responses"},{"line_number":93,"context_line":"downloading directly from the store and a subset of those teeing"},{"line_number":94,"context_line":"data to the same location on the filesystem."},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"The proposed solution is for the first download request to instead of writing"},{"line_number":97,"context_line":"the whole file to the cache, we write the file to cache in chunks. Then, the"}],"source_content_type":"text/x-rst","patch_set":9,"id":"59afc0bd_715a5c74","line":94,"range":{"start_line":94,"start_character":33,"end_line":94,"end_character":43},"in_reply_to":"d0b0c31c_ad9b05a4","updated":"2025-10-01 07:57:43.000000000","message":"you are right, with current implementation we can have corrupted cache files with mixed data from multiple requests.","commit_id":"31769b7b14726d9908534c4130cfb7a90d17d187"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e4ef426853bcff67b2d7d9c1b371845833f2c836","unresolved":true,"context_lines":[{"line_number":99,"context_line":"the subsequent request finishes reading all the available chunks in the cache,"},{"line_number":100,"context_line":"it will wait for the next available chunk written to the cache by the first"},{"line_number":101,"context_line":"request. It will keep doing this until the first request finishes all the"},{"line_number":102,"context_line":"chunks."},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"For the first request:"},{"line_number":105,"context_line":""}],"source_content_type":"text/x-rst","patch_set":9,"id":"e0d73f44_04b71107","line":102,"updated":"2022-10-18 17:50:31.000000000","message":"From what I\u0027ve read here, I don\u0027t see the correlation between the chunking and the subsequent readers grabbing from the in-progress cache. If there\u0027s some dependency there, can you point it out?\n\nThe same thing can be done with a single file, and without needing to introduce the complexity of the \"is this whole or is this in pieces\" handling for the cache readers. Splitting the cached file into chunks may be useful for resuming interrupted cache operations, but it seems like that is separate from the proper handling of multiple concurrent cache operations. IMHO, it would be a lot better to split this effort into those two pieces and attack them separately, to reduce the amount of change to the caching stuff that we have to digest and validate for acceptance.","commit_id":"31769b7b14726d9908534c4130cfb7a90d17d187"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"3cec9c49f6ea819b8bb00bdbafe2ed1757f9f8e5","unresolved":true,"context_lines":[{"line_number":99,"context_line":"the subsequent request finishes reading all the available chunks in the cache,"},{"line_number":100,"context_line":"it will wait for the next available chunk written to the cache by the first"},{"line_number":101,"context_line":"request. It will keep doing this until the first request finishes all the"},{"line_number":102,"context_line":"chunks."},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"For the first request:"},{"line_number":105,"context_line":""}],"source_content_type":"text/x-rst","patch_set":9,"id":"509eb6f5_c9ebc30c","line":102,"in_reply_to":"e0d73f44_04b71107","updated":"2025-10-01 07:57:43.000000000","message":"you are right, if this needs to be corrected then we need to work on two aspects i.e. Fix the race condition and later Add chunked caching","commit_id":"31769b7b14726d9908534c4130cfb7a90d17d187"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e4ef426853bcff67b2d7d9c1b371845833f2c836","unresolved":true,"context_lines":[{"line_number":117,"context_line":".. code-block:: none"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"    if the image is marked \"caching\" or \"cached\":"},{"line_number":120,"context_line":"        read the chunk from the cache until we get all the expected chunks"},{"line_number":121,"context_line":"        if a chunk is not available:"},{"line_number":122,"context_line":"        wait for it to be written by the first request"},{"line_number":123,"context_line":""}],"source_content_type":"text/x-rst","patch_set":9,"id":"91b1cca9_bd42bca0","line":120,"range":{"start_line":120,"start_character":59,"end_line":120,"end_character":74},"updated":"2022-10-18 17:50:31.000000000","message":"This was discussed briefly in the PTG session, but I think that it would be good to outline here your plans for:\n\n1. How do you wait?\n2. Do you poll for new data/chunks? How often?\n3. How long before you decide that the original cacher is dead?\n4. What do you do in case of #3? Try to resume from backend or fail?","commit_id":"31769b7b14726d9908534c4130cfb7a90d17d187"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"3cec9c49f6ea819b8bb00bdbafe2ed1757f9f8e5","unresolved":false,"context_lines":[{"line_number":117,"context_line":".. code-block:: none"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"    if the image is marked \"caching\" or \"cached\":"},{"line_number":120,"context_line":"        read the chunk from the cache until we get all the expected chunks"},{"line_number":121,"context_line":"        if a chunk is not available:"},{"line_number":122,"context_line":"        wait for it to be written by the first request"},{"line_number":123,"context_line":""}],"source_content_type":"text/x-rst","patch_set":9,"id":"8d04e23f_94086952","line":120,"range":{"start_line":120,"start_character":59,"end_line":120,"end_character":74},"in_reply_to":"91b1cca9_bd42bca0","updated":"2025-10-01 07:57:43.000000000","message":"Acknowledged","commit_id":"31769b7b14726d9908534c4130cfb7a90d17d187"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e4ef426853bcff67b2d7d9c1b371845833f2c836","unresolved":true,"context_lines":[{"line_number":149,"context_line":"   where the caching gets interrupted by the image or store going"},{"line_number":150,"context_line":"   unavailable. Due to possible very long delays on large images this"},{"line_number":151,"context_line":"   would complicate the download process as some kind of keepalive for"},{"line_number":152,"context_line":"   the client connection would be needed to avoid timeouts."},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"3. Create a lock within the middleware request handler: This"},{"line_number":155,"context_line":"   prevents requests from reaching the root app and establishing a"}],"source_content_type":"text/x-rst","patch_set":9,"id":"a245bbd4_ce4f3951","line":152,"updated":"2022-10-18 17:50:31.000000000","message":"I think it\u0027s likely that clients (human, at least) might abort if they see no data after a minute or two, assuming it\u0027s never coming. So yeah, this doesn\u0027t seem like a viable alternative to me.","commit_id":"31769b7b14726d9908534c4130cfb7a90d17d187"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"3cec9c49f6ea819b8bb00bdbafe2ed1757f9f8e5","unresolved":false,"context_lines":[{"line_number":149,"context_line":"   where the caching gets interrupted by the image or store going"},{"line_number":150,"context_line":"   unavailable. Due to possible very long delays on large images this"},{"line_number":151,"context_line":"   would complicate the download process as some kind of keepalive for"},{"line_number":152,"context_line":"   the client connection would be needed to avoid timeouts."},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"3. Create a lock within the middleware request handler: This"},{"line_number":155,"context_line":"   prevents requests from reaching the root app and establishing a"}],"source_content_type":"text/x-rst","patch_set":9,"id":"dbe7ae6f_0860e795","line":152,"in_reply_to":"a245bbd4_ce4f3951","updated":"2025-10-01 07:57:43.000000000","message":"Acknowledged","commit_id":"31769b7b14726d9908534c4130cfb7a90d17d187"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e4ef426853bcff67b2d7d9c1b371845833f2c836","unresolved":true,"context_lines":[{"line_number":209,"context_line":"reliability and performance profile. The bottleneck between the"},{"line_number":210,"context_line":"backend store and Glance will be removed for the thundering herd"},{"line_number":211,"context_line":"problem.  However, there could still be a bottleneck between the"},{"line_number":212,"context_line":"hypervisors and the Glance API nodes."},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"Developer impact"},{"line_number":215,"context_line":"----------------"}],"source_content_type":"text/x-rst","patch_set":9,"id":"e4ebc466_6169b1e6","line":212,"updated":"2022-10-18 17:50:31.000000000","message":"I think it\u0027s worth mentioning in this section that (unless I\u0027m missing something above), there is an increased likelihood of failed image downloads with this mechanism, because if there are N clients downloading the same image and the first one aborts, it will take out the rest of them after some timeout. Today (IIUC) the others will continue and likely succeed, albeit at the cost of speed and bandwidth.","commit_id":"31769b7b14726d9908534c4130cfb7a90d17d187"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"3cec9c49f6ea819b8bb00bdbafe2ed1757f9f8e5","unresolved":false,"context_lines":[{"line_number":209,"context_line":"reliability and performance profile. The bottleneck between the"},{"line_number":210,"context_line":"backend store and Glance will be removed for the thundering herd"},{"line_number":211,"context_line":"problem.  However, there could still be a bottleneck between the"},{"line_number":212,"context_line":"hypervisors and the Glance API nodes."},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"Developer impact"},{"line_number":215,"context_line":"----------------"}],"source_content_type":"text/x-rst","patch_set":9,"id":"203d8627_4260127f","line":212,"in_reply_to":"e4ebc466_6169b1e6","updated":"2025-10-01 07:57:43.000000000","message":"Acknowledged","commit_id":"31769b7b14726d9908534c4130cfb7a90d17d187"}]}
