)]}'
{"swift/container/backend.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"77cd957d4964579416a8c4a0241a1d746c405fcb","unresolved":false,"context_lines":[{"line_number":1567,"context_line":"        # For this initial version, we\u0027ll create a new container along side."},{"line_number":1568,"context_line":"        # Later we will remove parts so the shard range DB only has what it"},{"line_number":1569,"context_line":"        # really needs"},{"line_number":1570,"context_line":"        # TODO: do we need to think about cleaning these tmp files?"},{"line_number":1571,"context_line":"        tmp_db_file \u003d os.path.join(os.path.dirname(self._shard_db_file),"},{"line_number":1572,"context_line":"                                   str(uuid4()))"},{"line_number":1573,"context_line":"        sub_broker \u003d ContainerBroker(tmp_db_file, self.timeout,"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f515b1d_8fc55d5e","line":1570,"updated":"2017-09-21 22:59:36.000000000","message":"Yes, we do. Probably as \"clean up any that exist before creating a new one\".\n\nIf the sharder (which called this) dies between creating the tmp db and renaming it, will replication pick it up and move it? Probably not, I think? That seems like the way it *should* work, anyway...","commit_id":"45b4fe7547ec891223325a0c903ccf95a69843cd"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"cfd6aa6ade27dc71285e965e4f11d5752119dc1a","unresolved":false,"context_lines":[{"line_number":1567,"context_line":"        # For this initial version, we\u0027ll create a new container along side."},{"line_number":1568,"context_line":"        # Later we will remove parts so the shard range DB only has what it"},{"line_number":1569,"context_line":"        # really needs"},{"line_number":1570,"context_line":"        # TODO: do we need to think about cleaning these tmp files?"},{"line_number":1571,"context_line":"        tmp_db_file \u003d os.path.join(os.path.dirname(self._shard_db_file),"},{"line_number":1572,"context_line":"                                   str(uuid4()))"},{"line_number":1573,"context_line":"        sub_broker \u003d ContainerBroker(tmp_db_file, self.timeout,"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f515b1d_943566fa","line":1570,"in_reply_to":"7f515b1d_8fc55d5e","updated":"2017-09-22 07:13:54.000000000","message":"I worry that in the future, we may have multiple processes going, and we get into a state where two shard processes start trying to get into the sharding state and one sees a tmp shard db and removes it... maybe this doesn\u0027t matter, expect for some ugly stacktrace.\n\nWe could do something like: http://paste.openstack.org/show/621689/\n\nAs the replicator will reclaim any file older then reclaim age in the tmp directory: https://github.com/openstack/swift/blob/stable/pike/swift/common/db_replicator.py#L648.\n\nBut I suspect this _get_tmp_directory function would then need to be mocked in tests as the tempdir used is less then 4 levels deep. The sharder could pass in the tmp dir, as it has access to self.root and node[\u0027device\u0027].. but I don\u0027t like that.\n\nBut I\u0027m sure Tim can think of a cooler, more fancy way around.","commit_id":"45b4fe7547ec891223325a0c903ccf95a69843cd"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"03057b7e608050f34623c484f3452a4ebb9a0653","unresolved":false,"context_lines":[{"line_number":1556,"context_line":"        # really needs"},{"line_number":1557,"context_line":"        # TODO: do we need to think about cleaning these tmp files?"},{"line_number":1558,"context_line":"        tmp_db_file \u003d os.path.join(os.path.dirname(self._shard_db_file),"},{"line_number":1559,"context_line":"                                   str(uuid4()))"},{"line_number":1560,"context_line":"        sub_broker \u003d ContainerBroker(tmp_db_file, self.timeout,"},{"line_number":1561,"context_line":"                                     self.logger, self.account, self.container,"},{"line_number":1562,"context_line":"                                     self.pending_timeout, self.stale_reads_ok)"}],"source_content_type":"text/x-python","patch_set":2,"id":"7f515b1d_93b0ffde","line":1559,"updated":"2017-10-02 16:41:05.000000000","message":"We may want to do more than just a UUID here, to ease cleanup later.\n\n preshard_\u003cuuid\u003e.db\n\nmaybe? I kinda want something I can glob and *know* that I\u0027m only hitting these specific temp DBs. (Oh, I hope we never need another type of temp DB....)","commit_id":"a17f27971f10c5ef3bc658ae56612ae6c894352a"}],"test/unit/container/test_backend.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"03057b7e608050f34623c484f3452a4ebb9a0653","unresolved":false,"context_lines":[{"line_number":2720,"context_line":"            meta_timestamp\u003dTimestamp(i)) for i in range(1, 4)]"},{"line_number":2721,"context_line":""},{"line_number":2722,"context_line":"        broker.merge_items(broker.shard_nodes_to_items(shard_ranges))"},{"line_number":2723,"context_line":""},{"line_number":2724,"context_line":"        # Sanity checks"},{"line_number":2725,"context_line":"        self.assertEqual(broker.get_max_row(), 5)"},{"line_number":2726,"context_line":"        self.assertDictEqual(broker.get_syncs(True)[0], incoming_sync)"}],"source_content_type":"text/x-python","patch_set":2,"id":"7f515b1d_532a87da","line":2723,"updated":"2017-10-02 16:41:05.000000000","message":"Maybe also add some container metadata?","commit_id":"a17f27971f10c5ef3bc658ae56612ae6c894352a"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"03057b7e608050f34623c484f3452a4ebb9a0653","unresolved":false,"context_lines":[{"line_number":2749,"context_line":""},{"line_number":2750,"context_line":"        # to confirm were definitely looking at the shard db"},{"line_number":2751,"context_line":"        broker2 \u003d ContainerBroker(broker._shard_db_file)"},{"line_number":2752,"context_line":"        self.assertEqual(broker2.get_max_row(), 5)"},{"line_number":2753,"context_line":"        self.assertDictEqual(broker2.get_syncs(True)[0], incoming_sync)"},{"line_number":2754,"context_line":"        self.assertDictEqual(broker2.get_syncs(False)[0], outgoing_sync)"},{"line_number":2755,"context_line":"        self.assertEqual(broker2.get_shard_ranges(), shard_ranges)"}],"source_content_type":"text/x-python","patch_set":2,"id":"7f515b1d_b319bbd7","line":2752,"updated":"2017-10-02 16:41:05.000000000","message":"Add an assertion that, though our max_row matches, we have no objects?\n\nOr does that need to wait until after we move to SHARDED?","commit_id":"a17f27971f10c5ef3bc658ae56612ae6c894352a"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"03057b7e608050f34623c484f3452a4ebb9a0653","unresolved":false,"context_lines":[{"line_number":2758,"context_line":"        self.assertFalse(broker.set_sharding_state())"},{"line_number":2759,"context_line":""},{"line_number":2760,"context_line":"        # Now move to the final state"},{"line_number":2761,"context_line":"        self.assertTrue(broker.set_sharded_state())"},{"line_number":2762,"context_line":"        self.assertFalse(os.path.exists(os.path.join(tempdir, \u0027container.db\u0027)))"},{"line_number":2763,"context_line":"        self.assertTrue(os.path.exists(os.path.join(tempdir,"},{"line_number":2764,"context_line":"                                                    \u0027container_shard.db\u0027)))"}],"source_content_type":"text/x-python","patch_set":2,"id":"7f515b1d_333cab2d","line":2761,"updated":"2017-10-02 16:41:05.000000000","message":"Add an assertion on len(broker.get_brokers())?","commit_id":"a17f27971f10c5ef3bc658ae56612ae6c894352a"}]}
