)]}'
{"swift/common/utils.py":[{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"f6fbc4835c83553fa069fa82511bc1d581b43b87","unresolved":false,"context_lines":[{"line_number":4964,"context_line":"    extension."},{"line_number":4965,"context_line":""},{"line_number":4966,"context_line":"    e.g. given a filename \"ab2134.db\", returns (\"ab2134\", None, \"db\")"},{"line_number":4967,"context_line":"    e.g. given a filename \"ab2134_shard.db\", returns (\"ab2134\", \"shard\", \"db\")"},{"line_number":4968,"context_line":""},{"line_number":4969,"context_line":"    :param filename: A db file basename or path to a db file."},{"line_number":4970,"context_line":"    :return: A tuple of (hash , epoch, extension). ``epoch``"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa0c359_6a428711","line":4967,"range":{"start_line":4967,"start_character":9,"end_line":4967,"end_character":77},"updated":"2018-02-22 04:41:41.000000000","message":"should be \"ac2134_1519254863.04855.db\", returns (\"ab2134\", \"1519254863.04855\", \"db\")","commit_id":"476e7078a097520d49dbc1627af00d81ef7d13b1"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"8fcc18c6258c6d0ac69424b05e6a31f42ee3f0b5","unresolved":false,"context_lines":[{"line_number":4964,"context_line":"    extension."},{"line_number":4965,"context_line":""},{"line_number":4966,"context_line":"    e.g. given a filename \"ab2134.db\", returns (\"ab2134\", None, \"db\")"},{"line_number":4967,"context_line":"    e.g. given a filename \"ab2134_shard.db\", returns (\"ab2134\", \"shard\", \"db\")"},{"line_number":4968,"context_line":""},{"line_number":4969,"context_line":"    :param filename: A db file basename or path to a db file."},{"line_number":4970,"context_line":"    :return: A tuple of (hash , epoch, extension). ``epoch``"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa0c359_71c82ca7","line":4967,"range":{"start_line":4967,"start_character":9,"end_line":4967,"end_character":77},"in_reply_to":"3fa0c359_6a428711","updated":"2018-02-22 13:16:26.000000000","message":"Done","commit_id":"476e7078a097520d49dbc1627af00d81ef7d13b1"}],"swift/container/backend.py":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"cbfed11de3beb029a231871b8c02a8aae9611905","unresolved":false,"context_lines":[{"line_number":1303,"context_line":"                object_list.append(item)"},{"line_number":1304,"context_line":"        if shard_range_list:"},{"line_number":1305,"context_line":"            self.merge_shard_ranges(shard_range_list)"},{"line_number":1306,"context_line":"        if object_list:"},{"line_number":1307,"context_line":"            self.merge_objects(object_list, source)"},{"line_number":1308,"context_line":""},{"line_number":1309,"context_line":"    def get_reconciler_sync(self):"},{"line_number":1310,"context_line":"        with self.get() as conn:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa0c359_160c69a3","line":1307,"range":{"start_line":1306,"start_character":11,"end_line":1307,"end_character":51},"updated":"2018-02-20 23:00:28.000000000","message":"think this change can be reverted","commit_id":"c2e66dbfbc324f2a68c5727e9aebfb23015febd9"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"cbfed11de3beb029a231871b8c02a8aae9611905","unresolved":false,"context_lines":[{"line_number":1498,"context_line":"                    raise"},{"line_number":1499,"context_line":"                return []"},{"line_number":1500,"context_line":""},{"line_number":1501,"context_line":"        if commit_pending:"},{"line_number":1502,"context_line":"            self._commit_puts_stale_ok()"},{"line_number":1503,"context_line":"        if connection:"},{"line_number":1504,"context_line":"            return do_query(connection)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa0c359_56ed11b5","line":1501,"range":{"start_line":1501,"start_character":8,"end_line":1501,"end_character":26},"updated":"2018-02-20 23:00:28.000000000","message":"don\u0027t think this is needed","commit_id":"c2e66dbfbc324f2a68c5727e9aebfb23015febd9"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"cbfed11de3beb029a231871b8c02a8aae9611905","unresolved":false,"context_lines":[{"line_number":1508,"context_line":""},{"line_number":1509,"context_line":"    def get_shard_ranges(self, marker\u003dNone, end_marker\u003dNone, includes\u003dNone,"},{"line_number":1510,"context_line":"                         reverse\u003dFalse, include_deleted\u003dFalse, state\u003dNone,"},{"line_number":1511,"context_line":"                         commit_pending\u003dTrue):"},{"line_number":1512,"context_line":"        \"\"\""},{"line_number":1513,"context_line":"        Returns a list of persisted shard ranges."},{"line_number":1514,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa0c359_96f7198c","line":1511,"range":{"start_line":1511,"start_character":25,"end_line":1511,"end_character":44},"updated":"2018-02-20 23:00:28.000000000","message":"not needed","commit_id":"c2e66dbfbc324f2a68c5727e9aebfb23015febd9"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"f6fbc4835c83553fa069fa82511bc1d581b43b87","unresolved":false,"context_lines":[{"line_number":297,"context_line":"        `\u003chash\u003e.db`. This file should exist for an initialised broker when the"},{"line_number":298,"context_line":"        container is in the unsharded or sharding state."},{"line_number":299,"context_line":"      * :attr:`_shard_db_file` is the path to the sharded container DB, i.e."},{"line_number":300,"context_line":"        `\u003chash\u003e_shard.db`. This file should exist for an initialised broker"},{"line_number":301,"context_line":"        when the container is in the sharding or sharded state."},{"line_number":302,"context_line":"      * :attr:`db_file` is the path to whichever DB is currently authoritative"},{"line_number":303,"context_line":"        for the container. Depending on the container\u0027s state, this may not be"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa0c359_8af03369","line":300,"range":{"start_line":300,"start_character":15,"end_line":300,"end_character":21},"updated":"2018-02-22 04:41:41.000000000","message":"this isn\u0027t quite true anymore.","commit_id":"476e7078a097520d49dbc1627af00d81ef7d13b1"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"8fcc18c6258c6d0ac69424b05e6a31f42ee3f0b5","unresolved":false,"context_lines":[{"line_number":297,"context_line":"        `\u003chash\u003e.db`. This file should exist for an initialised broker when the"},{"line_number":298,"context_line":"        container is in the unsharded or sharding state."},{"line_number":299,"context_line":"      * :attr:`_shard_db_file` is the path to the sharded container DB, i.e."},{"line_number":300,"context_line":"        `\u003chash\u003e_shard.db`. This file should exist for an initialised broker"},{"line_number":301,"context_line":"        when the container is in the sharding or sharded state."},{"line_number":302,"context_line":"      * :attr:`db_file` is the path to whichever DB is currently authoritative"},{"line_number":303,"context_line":"        for the container. Depending on the container\u0027s state, this may not be"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa0c359_f19afc6c","line":300,"range":{"start_line":300,"start_character":15,"end_line":300,"end_character":21},"in_reply_to":"3fa0c359_8af03369","updated":"2018-02-22 13:16:26.000000000","message":"Done","commit_id":"476e7078a097520d49dbc1627af00d81ef7d13b1"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"f6fbc4835c83553fa069fa82511bc1d581b43b87","unresolved":false,"context_lines":[{"line_number":1605,"context_line":"            epoch \u003d Timestamp(epoch).normal"},{"line_number":1606,"context_line":"            self.update_sharding_info({\u0027Epoch\u0027: epoch})"},{"line_number":1607,"context_line":"        else:"},{"line_number":1608,"context_line":"            epoch \u003d self.get_sharding_info(\u0027Epoch\u0027)"},{"line_number":1609,"context_line":"        state \u003d self.get_db_state()"},{"line_number":1610,"context_line":"        if not state \u003d\u003d UNSHARDED:"},{"line_number":1611,"context_line":"            self.logger.warn(\"Container \u0027%s/%s\u0027 cannot be set to sharding \""}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa0c359_ea2777c6","line":1608,"updated":"2018-02-22 04:41:41.000000000","message":"I probably just haven\u0027t read enough of the code yet. But asusming this is a shard that is about to shard, and we\u0027re setting sharding state, that will create a new db so would want a new epoch.. this seems to say use the existing epoch for this current shard","commit_id":"476e7078a097520d49dbc1627af00d81ef7d13b1"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"8fcc18c6258c6d0ac69424b05e6a31f42ee3f0b5","unresolved":false,"context_lines":[{"line_number":1605,"context_line":"            epoch \u003d Timestamp(epoch).normal"},{"line_number":1606,"context_line":"            self.update_sharding_info({\u0027Epoch\u0027: epoch})"},{"line_number":1607,"context_line":"        else:"},{"line_number":1608,"context_line":"            epoch \u003d self.get_sharding_info(\u0027Epoch\u0027)"},{"line_number":1609,"context_line":"        state \u003d self.get_db_state()"},{"line_number":1610,"context_line":"        if not state \u003d\u003d UNSHARDED:"},{"line_number":1611,"context_line":"            self.logger.warn(\"Container \u0027%s/%s\u0027 cannot be set to sharding \""}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa0c359_91b378e9","line":1608,"in_reply_to":"3fa0c359_ea2777c6","updated":"2018-02-22 13:16:26.000000000","message":"whenever a leader node detects that sharding should begin, it calls set_sharding_state() *with a new epoch*. So a sharding shard will get a new db with a new epoch. The new epoch is written to sysmeta so that non-leader nodes can use it when moving to sharding state.\n\nI\u0027m not 100% happy with this interface yet, but that\u0027s the outcome that is needed.","commit_id":"476e7078a097520d49dbc1627af00d81ef7d13b1"}],"swift/container/replicator.py":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"cbfed11de3beb029a231871b8c02a8aae9611905","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        return rv"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def _initialize_broker(self, device, part, account, container,"},{"line_number":83,"context_line":"                           force_db_file\u003dFalse, **kwargs):"},{"line_number":84,"context_line":"        hsh \u003d hash_path(account, container)"},{"line_number":85,"context_line":"        db_dir \u003d storage_directory(DATADIR, part, hsh)"},{"line_number":86,"context_line":"        db_path \u003d os.path.join(self.root, device, db_dir, hsh + \u0027.db\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa0c359_36d725f1","line":83,"range":{"start_line":83,"start_character":27,"end_line":83,"end_character":46},"updated":"2018-02-20 23:00:28.000000000","message":"not sure where this crept in or why","commit_id":"c2e66dbfbc324f2a68c5727e9aebfb23015febd9"}],"swift/container/sharder.py":[{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"f6fbc4835c83553fa069fa82511bc1d581b43b87","unresolved":false,"context_lines":[{"line_number":567,"context_line":"                    # than found them e.g. via replication or a shrink event"},{"line_number":568,"context_line":"                    # TODO: broker *should* also have had a sharding epoch set"},{"line_number":569,"context_line":"                    # but should we double check? If so, only leader should set"},{"line_number":570,"context_line":"                    # the epoch."},{"line_number":571,"context_line":"                    broker.set_sharding_state()"},{"line_number":572,"context_line":"                    state \u003d SHARDING"},{"line_number":573,"context_line":"                elif (is_leader and broker.get_info()[\u0027object_count\u0027] \u003e\u003d"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa0c359_45a77cbd","line":570,"updated":"2018-02-22 04:41:41.000000000","message":"Oh I guess the only way to have shard_ranges is if the leader has all ready started scanning and in which case the elif below would have set an epoch.","commit_id":"476e7078a097520d49dbc1627af00d81ef7d13b1"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"8fcc18c6258c6d0ac69424b05e6a31f42ee3f0b5","unresolved":false,"context_lines":[{"line_number":567,"context_line":"                    # than found them e.g. via replication or a shrink event"},{"line_number":568,"context_line":"                    # TODO: broker *should* also have had a sharding epoch set"},{"line_number":569,"context_line":"                    # but should we double check? If so, only leader should set"},{"line_number":570,"context_line":"                    # the epoch."},{"line_number":571,"context_line":"                    broker.set_sharding_state()"},{"line_number":572,"context_line":"                    state \u003d SHARDING"},{"line_number":573,"context_line":"                elif (is_leader and broker.get_info()[\u0027object_count\u0027] \u003e\u003d"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa0c359_51c97056","line":570,"in_reply_to":"3fa0c359_45a77cbd","updated":"2018-02-22 13:16:26.000000000","message":"correct","commit_id":"476e7078a097520d49dbc1627af00d81ef7d13b1"}]}
