)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"75babe2b20a1cc6b0d5fde5702793bda55e7aeff","unresolved":false,"context_lines":[{"line_number":14,"context_line":"or crash occurs before that header is overwritten by a new object, the"},{"line_number":15,"context_line":"volume-check script will pick up the object when the machine is rebooted."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"With the patch, the header is overwritten with null bytes. (Punching a hole"},{"line_number":18,"context_line":"is slower and will create an extent)."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"While doing this, add a constant for the maximum serialized header length"},{"line_number":21,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3fa7e38b_2410e759","line":18,"range":{"start_line":17,"start_character":59,"end_line":18,"end_character":36},"updated":"2019-11-06 08:20:14.000000000","message":"I can read, I swear...","commit_id":"c2fb9b93e02e733d8bfb145b5a76489316732617"}],"swift/obj/header.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"25f1d4ac01e32a562872d936129a0e957f2e92a7","unresolved":false,"context_lines":[{"line_number":25,"context_line":"VOLUME_HEADER_VERSION \u003d 1"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"# maximum serialized header length"},{"line_number":28,"context_line":"MAX_HEADER_LEN \u003d 512"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"OBJECT_START_MARKER \u003d b\"SWIFTOBJ\""},{"line_number":31,"context_line":"VOLUME_START_MARKER \u003d b\"SWIFTVOL\""}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_440f2388","line":28,"range":{"start_line":28,"start_character":0,"end_line":28,"end_character":14},"updated":"2019-11-06 07:41:36.000000000","message":"Maybe better as MAX_OBJECT_HEADER_LEN?","commit_id":"c2fb9b93e02e733d8bfb145b5a76489316732617"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"25f1d4ac01e32a562872d936129a0e957f2e92a7","unresolved":false,"context_lines":[{"line_number":353,"context_line":""},{"line_number":354,"context_line":"# Read volume header. Expects fp to be positionned at header offset"},{"line_number":355,"context_line":"def read_volume_header(fp):"},{"line_number":356,"context_line":"    buf \u003d fp.read(128)"},{"line_number":357,"context_line":"    header \u003d VolumeHeader.unpack(buf)"},{"line_number":358,"context_line":"    return header"},{"line_number":359,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_240a2779","line":356,"range":{"start_line":356,"start_character":18,"end_line":356,"end_character":21},"updated":"2019-11-06 07:41:36.000000000","message":"Off-topic -- we might want to think about pulling this out to a constant, too.","commit_id":"c2fb9b93e02e733d8bfb145b5a76489316732617"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"25f1d4ac01e32a562872d936129a0e957f2e92a7","unresolved":false,"context_lines":[{"line_number":390,"context_line":"    :param offset: absolute header offset"},{"line_number":391,"context_line":"    \"\"\""},{"line_number":392,"context_line":"    os.lseek(fd, offset, os.SEEK_SET)"},{"line_number":393,"context_line":"    os.write(fd, \"\\x00\" * MAX_HEADER_LEN)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_a444d7b9","line":393,"range":{"start_line":393,"start_character":17,"end_line":393,"end_character":23},"updated":"2019-11-06 07:41:36.000000000","message":"This should be opened in binary mode, right? We probably want\n\n b\"\\x00\"\n\nOh! Can we use our hole-puncher?? Or does it not really make sense for this case?\n\nDo we need to worry about any fsync\u0027ing or anything?","commit_id":"c2fb9b93e02e733d8bfb145b5a76489316732617"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"75babe2b20a1cc6b0d5fde5702793bda55e7aeff","unresolved":false,"context_lines":[{"line_number":390,"context_line":"    :param offset: absolute header offset"},{"line_number":391,"context_line":"    \"\"\""},{"line_number":392,"context_line":"    os.lseek(fd, offset, os.SEEK_SET)"},{"line_number":393,"context_line":"    os.write(fd, \"\\x00\" * MAX_HEADER_LEN)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_7ffbc814","line":393,"range":{"start_line":393,"start_character":17,"end_line":393,"end_character":23},"in_reply_to":"3fa7e38b_a444d7b9","updated":"2019-11-06 08:20:14.000000000","message":"Never mind on the hole-punching -- other two questions stand though!","commit_id":"c2fb9b93e02e733d8bfb145b5a76489316732617"}],"swift/obj/vfile.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"25f1d4ac01e32a562872d936129a0e957f2e92a7","unresolved":false,"context_lines":[{"line_number":376,"context_line":"            rpc.register_object(self.socket_path, full_name, self.volume_index,"},{"line_number":377,"context_line":"                                self.offset, object_end)"},{"line_number":378,"context_line":"        except RpcError:"},{"line_number":379,"context_line":"            # If we failed to register the object, erase the header so that it"},{"line_number":380,"context_line":"            # will not be picked up by the volume checker if there is a crash"},{"line_number":381,"context_line":"            # or power failure before it gets overwritten by another object."},{"line_number":382,"context_line":"            erase_object_header(self.fd, self.offset)"},{"line_number":383,"context_line":"            raise"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_247f87e0","line":380,"range":{"start_line":379,"start_character":51,"end_line":380,"end_character":77},"updated":"2019-11-06 07:41:36.000000000","message":"There\u0027s still a chance of hitting this, for example if there\u0027s a crash between the fdatasync and erase_object_header calls, but I expect this should cover the vast majority of cases.","commit_id":"c2fb9b93e02e733d8bfb145b5a76489316732617"}],"test/unit/obj/test_vfile.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"25f1d4ac01e32a562872d936129a0e957f2e92a7","unresolved":false,"context_lines":[{"line_number":487,"context_line":"        # check the header was erased"},{"line_number":488,"context_line":"        vol_file.seek(offset)"},{"line_number":489,"context_line":"        serialized_header \u003d vol_file.read(MAX_HEADER_LEN)"},{"line_number":490,"context_line":"        self.assertEqual(serialized_header, \"\\x00\" * MAX_HEADER_LEN)"},{"line_number":491,"context_line":""},{"line_number":492,"context_line":"        # check we did not write past the header by checking the file data"},{"line_number":493,"context_line":"        data_offset \u003d (offset +"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_c46f9326","line":490,"range":{"start_line":490,"start_character":44,"end_line":490,"end_character":50},"updated":"2019-11-06 07:41:36.000000000","message":"b\"\\x00\"","commit_id":"c2fb9b93e02e733d8bfb145b5a76489316732617"}]}
