)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"3cb9ab21f4b16f3367126a5fc131250d0e2e093d","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"plus some cleanup and fixes:"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"- while a shard is sharding the misplaced objects continue to"},{"line_number":12,"context_line":"  include objects outside of the original shard range as"},{"line_number":13,"context_line":"  well as those in the cleaved ranges."},{"line_number":14,"context_line":"- get shard ranges from broker when root container, not via HTTP"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"7f515b1d_bd2605ba","line":11,"range":{"start_line":11,"start_character":19,"end_line":11,"end_character":27},"updated":"2017-10-04 05:31:18.000000000","message":"cleaving :P","commit_id":"8e26a7400528091ff41823f2597ba5a7bc40dab2"}],"swift/container/sharder.py":[{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"3cb9ab21f4b16f3367126a5fc131250d0e2e093d","unresolved":false,"context_lines":[{"line_number":316,"context_line":"        self.logger.info(\u0027Scanning %s/%s (%s) for misplaced objects\u0027,"},{"line_number":317,"context_line":"                         broker.account, broker.container, broker.db_file)"},{"line_number":318,"context_line":"        if broker.is_deleted():"},{"line_number":319,"context_line":"            return"},{"line_number":320,"context_line":""},{"line_number":321,"context_line":"        queries \u003d []"},{"line_number":322,"context_line":"        policy_index \u003d broker.storage_policy_index"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f515b1d_bde72547","line":319,"updated":"2017-10-04 05:31:18.000000000","message":"oh right, is_deleted will return false it\u0027s marked deleted but has items. Cool. I was going to say what about the objects.","commit_id":"8e26a7400528091ff41823f2597ba5a7bc40dab2"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"b39468207aa301df901bcdbe4f69ca2562340e00","unresolved":false,"context_lines":[{"line_number":336,"context_line":"            # TODO: rename broker._get_info() to be a public method (note"},{"line_number":337,"context_line":"            # we need object count from object table not shard table) OR drop"},{"line_number":338,"context_line":"            # this condition - which maybe we should because object_count will"},{"line_number":339,"context_line":"            # not include deleted objects"},{"line_number":340,"context_line":"            if broker._get_info()[\u0027object_count\u0027] \u003e 0:"},{"line_number":341,"context_line":"                queries.append(query.copy())"},{"line_number":342,"context_line":"        elif state \u003d\u003d DB_STATE_SHARDING and last_shard:"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f515b1d_f0e14dfe","line":339,"range":{"start_line":339,"start_character":26,"end_line":339,"end_character":41},"updated":"2017-10-03 20:24:04.000000000","message":"The more I think about misplaced delete records, the more nervous I get about them :-(","commit_id":"8e26a7400528091ff41823f2597ba5a7bc40dab2"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"b39468207aa301df901bcdbe4f69ca2562340e00","unresolved":false,"context_lines":[{"line_number":342,"context_line":"        elif state \u003d\u003d DB_STATE_SHARDING and last_shard:"},{"line_number":343,"context_line":"            # Objects outside of this container\u0027s own range are misplaced."},{"line_number":344,"context_line":"            # Objects in already cleaved shard ranges are also misplaced."},{"line_number":345,"context_line":"            queries.append(dict(query, end_marker\u003dlast_shard + \u0027\\x00\u0027))"},{"line_number":346,"context_line":"            if own_shard_range and own_shard_range.upper:"},{"line_number":347,"context_line":"                queries.append(dict(query, marker\u003down_shard_range.upper))"},{"line_number":348,"context_line":"        elif own_shard_range:"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f515b1d_9029f9f3","line":345,"updated":"2017-10-03 20:24:04.000000000","message":"...right. And this should necessarily be a super-set of everything below own_shard_range.lower if own_shard_range is not None.","commit_id":"8e26a7400528091ff41823f2597ba5a7bc40dab2"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"b39468207aa301df901bcdbe4f69ca2562340e00","unresolved":false,"context_lines":[{"line_number":357,"context_line":"            return"},{"line_number":358,"context_line":""},{"line_number":359,"context_line":"        if broker.is_root_container():"},{"line_number":360,"context_line":"            outer \u003d {\u0027ranges\u0027: broker.get_shard_ranges()}"},{"line_number":361,"context_line":"        else:"},{"line_number":362,"context_line":"            outer \u003d {\u0027ranges\u0027: None}"},{"line_number":363,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7f515b1d_d0753134","line":360,"updated":"2017-10-03 20:24:04.000000000","message":"When\u0027s the last time we talked to the other primaries about what the ranges should be?","commit_id":"8e26a7400528091ff41823f2597ba5a7bc40dab2"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"dd44102edd05d52e093665f8d3c81bc97ead4c04","unresolved":false,"context_lines":[{"line_number":357,"context_line":"            return"},{"line_number":358,"context_line":""},{"line_number":359,"context_line":"        if broker.is_root_container():"},{"line_number":360,"context_line":"            outer \u003d {\u0027ranges\u0027: broker.get_shard_ranges()}"},{"line_number":361,"context_line":"        else:"},{"line_number":362,"context_line":"            outer \u003d {\u0027ranges\u0027: None}"},{"line_number":363,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7f515b1d_39b45735","line":360,"in_reply_to":"7f515b1d_1d90794e","updated":"2017-10-04 16:41:52.000000000","message":"...which is currently unlinked from the sharding cycle, yeah? Are we about to ship our rows somewhere that\u0027s just going to want to move them again?","commit_id":"8e26a7400528091ff41823f2597ba5a7bc40dab2"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"3cb9ab21f4b16f3367126a5fc131250d0e2e093d","unresolved":false,"context_lines":[{"line_number":357,"context_line":"            return"},{"line_number":358,"context_line":""},{"line_number":359,"context_line":"        if broker.is_root_container():"},{"line_number":360,"context_line":"            outer \u003d {\u0027ranges\u0027: broker.get_shard_ranges()}"},{"line_number":361,"context_line":"        else:"},{"line_number":362,"context_line":"            outer \u003d {\u0027ranges\u0027: None}"},{"line_number":363,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7f515b1d_1d90794e","line":360,"in_reply_to":"7f515b1d_d0753134","updated":"2017-10-04 05:31:18.000000000","message":"last replication cycle","commit_id":"8e26a7400528091ff41823f2597ba5a7bc40dab2"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"b39468207aa301df901bcdbe4f69ca2562340e00","unresolved":false,"context_lines":[{"line_number":378,"context_line":"                if shard_range:"},{"line_number":379,"context_line":"                    shard_to_obj[shard_range].append(obj)"},{"line_number":380,"context_line":"                else:"},{"line_number":381,"context_line":"                    # TODO: reduce this to a single warning per missing range"},{"line_number":382,"context_line":"                    self.logger.warning("},{"line_number":383,"context_line":"                        \u0027Failed to find destination shard for %s/%s/%s\u0027,"},{"line_number":384,"context_line":"                        broker.account, broker.container, obj[0])"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f515b1d_b0f87549","line":381,"updated":"2017-10-03 20:24:04.000000000","message":"How would we know which records belong in the same (missing) range?\n\nIf there are gaps in outer[\u0027ranges\u0027], we might know that two records definitely belong in *different* ranges, but given ranges a-f and l-o and misplaced objects h, j, and k, we have no idea whether those will ultimately go in one, two, or three ranges.","commit_id":"8e26a7400528091ff41823f2597ba5a7bc40dab2"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"6f787f928c79ae05328289eba72ed8f238db7fb9","unresolved":false,"context_lines":[{"line_number":378,"context_line":"                if shard_range:"},{"line_number":379,"context_line":"                    shard_to_obj[shard_range].append(obj)"},{"line_number":380,"context_line":"                else:"},{"line_number":381,"context_line":"                    # TODO: reduce this to a single warning per missing range"},{"line_number":382,"context_line":"                    self.logger.warning("},{"line_number":383,"context_line":"                        \u0027Failed to find destination shard for %s/%s/%s\u0027,"},{"line_number":384,"context_line":"                        broker.account, broker.container, obj[0])"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f515b1d_de12d4b4","line":381,"in_reply_to":"7f515b1d_b0f87549","updated":"2017-10-04 10:01:47.000000000","message":"true. my concern is more that if we have missing shard ranges we don\u0027t flood the logs with a warning for every object in the missing range(s)\n\nwill change comment","commit_id":"8e26a7400528091ff41823f2597ba5a7bc40dab2"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"b39468207aa301df901bcdbe4f69ca2562340e00","unresolved":false,"context_lines":[{"line_number":399,"context_line":""},{"line_number":400,"context_line":"                self.cpool.spawn("},{"line_number":401,"context_line":"                    self._replicate_object, part, new_broker.db_file, node_id)"},{"line_number":402,"context_line":""},{"line_number":403,"context_line":"                # Remove the now relocated misplaced items."},{"line_number":404,"context_line":"                items \u003d self._generate_object_list(obj_list, policy_index,"},{"line_number":405,"context_line":"                                                   delete\u003dTrue)"},{"line_number":406,"context_line":"                broker.merge_items(items)"},{"line_number":407,"context_line":""},{"line_number":408,"context_line":"            # wait for one of these to error, or all to complete successfully"},{"line_number":409,"context_line":"            any(self.cpool)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f515b1d_508141c3","line":406,"range":{"start_line":402,"start_character":0,"end_line":406,"end_character":41},"updated":"2017-10-03 20:24:04.000000000","message":"...and this is the part that makes me really nervous about deleted records. To mark them as moved, we delete them :-/","commit_id":"8e26a7400528091ff41823f2597ba5a7bc40dab2"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"3cb9ab21f4b16f3367126a5fc131250d0e2e093d","unresolved":false,"context_lines":[{"line_number":399,"context_line":""},{"line_number":400,"context_line":"                self.cpool.spawn("},{"line_number":401,"context_line":"                    self._replicate_object, part, new_broker.db_file, node_id)"},{"line_number":402,"context_line":""},{"line_number":403,"context_line":"                # Remove the now relocated misplaced items."},{"line_number":404,"context_line":"                items \u003d self._generate_object_list(obj_list, policy_index,"},{"line_number":405,"context_line":"                                                   delete\u003dTrue)"},{"line_number":406,"context_line":"                broker.merge_items(items)"},{"line_number":407,"context_line":""},{"line_number":408,"context_line":"            # wait for one of these to error, or all to complete successfully"},{"line_number":409,"context_line":"            any(self.cpool)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f515b1d_bd1285b3","line":406,"range":{"start_line":402,"start_character":0,"end_line":406,"end_character":41},"in_reply_to":"7f515b1d_508141c3","updated":"2017-10-04 05:31:18.000000000","message":"at least they hang around with a delete\u003d1 for reclaim age, and with a timestamp of the orig + offset +\u003d1 so if there is something newer out there, we don\u0027t loose it.\n\nBut what would be better? someway to mark moved.. and then delete it later? when\u0027s later? Next pass.. reclaim_age.\n\nI\u0027m not saying your wrong, just trying to think of an alternative :)","commit_id":"8e26a7400528091ff41823f2597ba5a7bc40dab2"}],"test/unit/container/test_sharder.py":[{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"3cb9ab21f4b16f3367126a5fc131250d0e2e093d","unresolved":false,"context_lines":[{"line_number":479,"context_line":"                    logger\u003ddebug_logger())"},{"line_number":480,"context_line":"                sharder._local_device_ids \u003d {0, 1, 2}"},{"line_number":481,"context_line":"                sharder._replicate_object \u003d mock.MagicMock()"},{"line_number":482,"context_line":"                sharder.shard_cleanups \u003d dict()  # TODO: try to eliminate this"},{"line_number":483,"context_line":"                yield sharder"},{"line_number":484,"context_line":""},{"line_number":485,"context_line":"    def _check_objects(self, expected_objs, shard_db,"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f515b1d_1d519963","line":482,"updated":"2017-10-04 05:31:18.000000000","message":"to be honest, I can\u0027t remember why we needed this. It obviously was deleting things when we wheren\u0027t ready in the past, or in some POC. But cant remember why.","commit_id":"8e26a7400528091ff41823f2597ba5a7bc40dab2"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"3cb9ab21f4b16f3367126a5fc131250d0e2e093d","unresolved":false,"context_lines":[{"line_number":890,"context_line":""},{"line_number":891,"context_line":"        # repeat with final shard range available"},{"line_number":892,"context_line":"        with self._mock_sharder() as sharder:"},{"line_number":893,"context_line":"            # NB final shard range not supplied"},{"line_number":894,"context_line":"            sharder._get_shard_ranges \u003d lambda *a, **k: root_shard_ranges"},{"line_number":895,"context_line":"            sharder._misplaced_objects(broker, node, \u0027a\u0027, \u0027c\u0027, own_sr)"},{"line_number":896,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7f515b1d_5d3ef1da","line":893,"updated":"2017-10-04 05:31:18.000000000","message":"yes it is isn\u0027t it or am I reading it wrong?","commit_id":"8e26a7400528091ff41823f2597ba5a7bc40dab2"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"6f787f928c79ae05328289eba72ed8f238db7fb9","unresolved":false,"context_lines":[{"line_number":890,"context_line":""},{"line_number":891,"context_line":"        # repeat with final shard range available"},{"line_number":892,"context_line":"        with self._mock_sharder() as sharder:"},{"line_number":893,"context_line":"            # NB final shard range not supplied"},{"line_number":894,"context_line":"            sharder._get_shard_ranges \u003d lambda *a, **k: root_shard_ranges"},{"line_number":895,"context_line":"            sharder._misplaced_objects(broker, node, \u0027a\u0027, \u0027c\u0027, own_sr)"},{"line_number":896,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7f515b1d_5e6b841e","line":893,"in_reply_to":"7f515b1d_5d3ef1da","updated":"2017-10-04 10:01:47.000000000","message":"ugh, stale comment, good catch!","commit_id":"8e26a7400528091ff41823f2597ba5a7bc40dab2"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"3cb9ab21f4b16f3367126a5fc131250d0e2e093d","unresolved":false,"context_lines":[{"line_number":1034,"context_line":"        update_sharding_info(broker, {\u0027Last\u0027: \u0027there\u0027}, node)"},{"line_number":1035,"context_line":"        # and then more misplaced updates arrive"},{"line_number":1036,"context_line":"        new_objects \u003d ["},{"line_number":1037,"context_line":"            [\u0027a\u0027, self.ts_internal(), 51, \u0027text/plain\u0027, \u0027etag_a\u0027, 0],"},{"line_number":1038,"context_line":"            [\u0027z\u0027, self.ts_internal(), 52, \u0027text/plain\u0027, \u0027etag_z\u0027, 0],"},{"line_number":1039,"context_line":"        ]"},{"line_number":1040,"context_line":"        expected_source_objects \u003d \\"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f515b1d_3d0c5541","line":1037,"range":{"start_line":1037,"start_character":13,"end_line":1037,"end_character":67},"updated":"2017-10-04 05:31:18.000000000","message":"should be make this an object between \u0027here\u0027 and \u0027there\u0027 so we can test that it gets detected as a misplaced object now that it\u0027s sharded beyond that place?","commit_id":"8e26a7400528091ff41823f2597ba5a7bc40dab2"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"6f787f928c79ae05328289eba72ed8f238db7fb9","unresolved":false,"context_lines":[{"line_number":1034,"context_line":"        update_sharding_info(broker, {\u0027Last\u0027: \u0027there\u0027}, node)"},{"line_number":1035,"context_line":"        # and then more misplaced updates arrive"},{"line_number":1036,"context_line":"        new_objects \u003d ["},{"line_number":1037,"context_line":"            [\u0027a\u0027, self.ts_internal(), 51, \u0027text/plain\u0027, \u0027etag_a\u0027, 0],"},{"line_number":1038,"context_line":"            [\u0027z\u0027, self.ts_internal(), 52, \u0027text/plain\u0027, \u0027etag_z\u0027, 0],"},{"line_number":1039,"context_line":"        ]"},{"line_number":1040,"context_line":"        expected_source_objects \u003d \\"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f515b1d_5e0ca441","line":1037,"range":{"start_line":1037,"start_character":13,"end_line":1037,"end_character":67},"in_reply_to":"7f515b1d_3d0c5541","updated":"2017-10-04 10:01:47.000000000","message":"Done","commit_id":"8e26a7400528091ff41823f2597ba5a7bc40dab2"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"dd44102edd05d52e093665f8d3c81bc97ead4c04","unresolved":false,"context_lines":[{"line_number":1040,"context_line":"        ]"},{"line_number":1041,"context_line":"        expected_source_objects.insert(2, list(new_objects[1]))"},{"line_number":1042,"context_line":"        expected_source_objects.insert(0, list(new_objects[0]))"},{"line_number":1043,"context_line":"        expected_source_objects.append(list(new_objects[2]))"},{"line_number":1044,"context_line":"        for obj in new_objects:"},{"line_number":1045,"context_line":"            broker.put_object(*obj)"},{"line_number":1046,"context_line":"        broker.get_info()  # force updates to be committed"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f515b1d_595393e3","line":1043,"updated":"2017-10-04 16:41:52.000000000","message":"I\u0027m kinda inclined to do something like\n\n expected_source_objects.extend(new_objects)\n expected_source_objects.sort()\n\nor, if we\u0027re really worried about records getting mutated,\n\n expected_source_objects.extend(obj[:] for obj in new_objects)\n expected_source_objects.sort()","commit_id":"90d194eae82d5507211a00ecd74a8e7ba370ab4d"}]}
