)]}'
{"swift/common/db_replicator.py":[{"author":{"_account_id":23449,"name":"Pavel Kvasnička","email":"pavel.kvasnicka@firma.seznam.cz","username":"PavelK"},"change_message_id":"4343d4c7219c44a1de31b0cdbca1a4d802637e81","unresolved":false,"context_lines":[{"line_number":543,"context_line":"        more_nodes \u003d self.ring.get_more_nodes(int(partition))"},{"line_number":544,"context_line":"        if not local_dev:"},{"line_number":545,"context_line":"            # Check further if local device is a handoff node"},{"line_number":546,"context_line":"            for node in more_nodes:"},{"line_number":547,"context_line":"                if node[\u0027id\u0027] \u003d\u003d node_id:"},{"line_number":548,"context_line":"                    local_dev \u003d node"},{"line_number":549,"context_line":"                    break"}],"source_content_type":"text/x-python","patch_set":4,"id":"ffe62b97_a48ef82b","side":"PARENT","line":546,"range":{"start_line":546,"start_character":24,"end_line":546,"end_character":34},"updated":"2017-03-24 08:29:14.000000000","message":"Here is the bug","commit_id":"23cc5d1f183facb30f3892106683bc18950ad399"},{"author":{"_account_id":23449,"name":"Pavel Kvasnička","email":"pavel.kvasnicka@firma.seznam.cz","username":"PavelK"},"change_message_id":"4343d4c7219c44a1de31b0cdbca1a4d802637e81","unresolved":false,"context_lines":[{"line_number":546,"context_line":"            for node in more_nodes:"},{"line_number":547,"context_line":"                if node[\u0027id\u0027] \u003d\u003d node_id:"},{"line_number":548,"context_line":"                    local_dev \u003d node"},{"line_number":549,"context_line":"                    break"},{"line_number":550,"context_line":"        for node in repl_nodes:"},{"line_number":551,"context_line":"            different_region \u003d False"},{"line_number":552,"context_line":"            if local_dev and local_dev[\u0027region\u0027] !\u003d node[\u0027region\u0027]:"}],"source_content_type":"text/x-python","patch_set":4,"id":"ffe62b97_c48e9c26","side":"PARENT","line":549,"updated":"2017-03-24 08:29:14.000000000","message":"more_nodes \u003d self.ring.get_more_nodes(int(partition))\n\nand this is a minimal patch. But I wrote more code to not replicate node itself if it is not necessary (handoff never syncs with self).","commit_id":"23cc5d1f183facb30f3892106683bc18950ad399"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"57d0c52da4c230a650e3e47572fe6b2863ad6696","unresolved":false,"context_lines":[{"line_number":529,"context_line":"        nodes \u003d self.ring.get_part_nodes(int(partition))"},{"line_number":530,"context_line":"        local_dev \u003d None"},{"line_number":531,"context_line":"        local_index \u003d 0"},{"line_number":532,"context_line":"        for node in nodes:"},{"line_number":533,"context_line":"            if node[\u0027id\u0027] \u003d\u003d node_id:"},{"line_number":534,"context_line":"                local_dev \u003d node"},{"line_number":535,"context_line":"                break"}],"source_content_type":"text/x-python","patch_set":5,"id":"ffe62b97_74df9b0c","line":532,"updated":"2017-03-30 06:24:08.000000000","message":"You could just enumerate here:\n\n  for local_index, node in enumerate(nodes):\n\nthen you can lose the initialisation and increment lines.","commit_id":"fbc6cbb60b2c2cb7f31d382fcd0397f8c5d9641c"},{"author":{"_account_id":23449,"name":"Pavel Kvasnička","email":"pavel.kvasnicka@firma.seznam.cz","username":"PavelK"},"change_message_id":"40e5420a80b0e98d2bd17b8babf57008b8dbed70","unresolved":false,"context_lines":[{"line_number":529,"context_line":"        nodes \u003d self.ring.get_part_nodes(int(partition))"},{"line_number":530,"context_line":"        local_dev \u003d None"},{"line_number":531,"context_line":"        local_index \u003d 0"},{"line_number":532,"context_line":"        for node in nodes:"},{"line_number":533,"context_line":"            if node[\u0027id\u0027] \u003d\u003d node_id:"},{"line_number":534,"context_line":"                local_dev \u003d node"},{"line_number":535,"context_line":"                break"}],"source_content_type":"text/x-python","patch_set":5,"id":"ffe62b97_82d1ba32","line":532,"in_reply_to":"ffe62b97_74df9b0c","updated":"2017-03-30 08:28:15.000000000","message":"Done","commit_id":"fbc6cbb60b2c2cb7f31d382fcd0397f8c5d9641c"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0a542606451e803cc6c7148c79094dbd4f7bcd41","unresolved":false,"context_lines":[{"line_number":493,"context_line":"                partition \u003d bpart"},{"line_number":494,"context_line":"                # Important to set this false here since the later check only"},{"line_number":495,"context_line":"                # checks if it\u0027s on the proper device, not partition."},{"line_number":496,"context_line":"                shouldbehere \u003d False"},{"line_number":497,"context_line":"                name \u003d \u0027/\u0027 + quote(info[\u0027account\u0027])"},{"line_number":498,"context_line":"                if \u0027container\u0027 in info:"},{"line_number":499,"context_line":"                    name +\u003d \u0027/\u0027 + quote(info[\u0027container\u0027])"}],"source_content_type":"text/x-python","patch_set":8,"id":"dfeb2761_eea2819a","side":"PARENT","line":496,"updated":"2017-03-31 21:52:06.000000000","message":"all this is fine","commit_id":"cce719260da81a7285f94b25c8664c0947487f61"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0a542606451e803cc6c7148c79094dbd4f7bcd41","unresolved":false,"context_lines":[{"line_number":538,"context_line":"            while i \u003c len(nodes) and nodes[i][\u0027id\u0027] !\u003d node_id:"},{"line_number":539,"context_line":"                i +\u003d 1"},{"line_number":540,"context_line":"            repl_nodes \u003d nodes[i + 1:] + nodes[:i]"},{"line_number":541,"context_line":"        else:  # Special case if using only a single replica"},{"line_number":542,"context_line":"            repl_nodes \u003d nodes"},{"line_number":543,"context_line":"        more_nodes \u003d self.ring.get_more_nodes(int(partition))"},{"line_number":544,"context_line":"        if not local_dev:"}],"source_content_type":"text/x-python","patch_set":8,"id":"dfeb2761_cef57dcd","side":"PARENT","line":541,"updated":"2017-03-31 21:52:06.000000000","message":"This special case smells.","commit_id":"cce719260da81a7285f94b25c8664c0947487f61"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0a542606451e803cc6c7148c79094dbd4f7bcd41","unresolved":false,"context_lines":[{"line_number":537,"context_line":"                break"},{"line_number":538,"context_line":"        else:"},{"line_number":539,"context_line":"            shouldbehere \u003d False"},{"line_number":540,"context_line":"            is_handoff_node \u003d True"},{"line_number":541,"context_line":"            repl_nodes \u003d nodes"},{"line_number":542,"context_line":"            for node in self.ring.get_more_nodes(int(partition)):"},{"line_number":543,"context_line":"                if node[\u0027id\u0027] \u003d\u003d node_id:"}],"source_content_type":"text/x-python","patch_set":8,"id":"dfeb2761_ce38ddd4","line":540,"updated":"2017-03-31 21:52:06.000000000","message":"this is a pretty cute little cleanup, would look better in change that called it out as a cleanup instead of stuck together with the fix/behavior-change.","commit_id":"82da9474e68bdc64b2c49afd3f6219a5fd7a16e3"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0a542606451e803cc6c7148c79094dbd4f7bcd41","unresolved":false,"context_lines":[{"line_number":544,"context_line":"                    local_dev \u003d node"},{"line_number":545,"context_line":"                    break"},{"line_number":546,"context_line":"        if not repl_nodes:"},{"line_number":547,"context_line":"            # Special case if using only a single replica"},{"line_number":548,"context_line":"            if shouldbehere:"},{"line_number":549,"context_line":"                # one replica is placed on proper partition and device"},{"line_number":550,"context_line":"                self.logger.timing_since(\u0027timing\u0027, start_time)"}],"source_content_type":"text/x-python","patch_set":8,"id":"dfeb2761_2e99896d","line":547,"updated":"2017-03-31 21:52:06.000000000","message":"The only tests that fail when you pull this out is test_replicate_container_out_of_place_no_node which seems to be hitting a case where the part# passed in (from filesystem path) doesn\u0027t match the part# calculated off the database names.\n\nI\u0027m more comfortable trying to stay away from this garbage than letting a refactoring carry it forward and estrange the git history.\n\nI028ea8c1928e8c9a401db31fb266ff82606f8371","commit_id":"82da9474e68bdc64b2c49afd3f6219a5fd7a16e3"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0a542606451e803cc6c7148c79094dbd4f7bcd41","unresolved":false,"context_lines":[{"line_number":553,"context_line":"        attempts_left \u003d len(repl_nodes)"},{"line_number":554,"context_line":"        all_nodes \u003d itertools.chain("},{"line_number":555,"context_line":"            repl_nodes,"},{"line_number":556,"context_line":"            self.ring.get_more_nodes(int(partition)))"},{"line_number":557,"context_line":"        while attempts_left \u003e 0:"},{"line_number":558,"context_line":"            node \u003d next(all_nodes)"},{"line_number":559,"context_line":"            attempts_left -\u003d 1"}],"source_content_type":"text/x-python","patch_set":8,"id":"dfeb2761_ee6961be","line":556,"updated":"2017-03-31 21:52:06.000000000","message":"so ultimately no matter if we go with a trivial fix or something like this - the point is you just reset the iteration and the bug goes away...","commit_id":"82da9474e68bdc64b2c49afd3f6219a5fd7a16e3"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0a542606451e803cc6c7148c79094dbd4f7bcd41","unresolved":false,"context_lines":[{"line_number":558,"context_line":"            node \u003d next(all_nodes)"},{"line_number":559,"context_line":"            attempts_left -\u003d 1"},{"line_number":560,"context_line":"            if is_handoff_node and node[\u0027id\u0027] \u003d\u003d node_id:"},{"line_number":561,"context_line":"                # this handoff replica doesn\u0027t need update path"},{"line_number":562,"context_line":"                continue"},{"line_number":563,"context_line":"            different_region \u003d False"},{"line_number":564,"context_line":"            if local_dev and local_dev[\u0027region\u0027] !\u003d node[\u0027region\u0027]:"}],"source_content_type":"text/x-python","patch_set":8,"id":"dfeb2761_8eb53534","line":561,"updated":"2017-03-31 21:52:06.000000000","message":"I don\u0027t understand this comment.  I think it\u0027s saying don\u0027t sync with yourself.  But it smells that we make this adjustment in one place for primaries and then again here in the loop for handoffs.\n\nIdeally there\u0027d only have to be one place we encode the logic of \"skip yourself\"","commit_id":"82da9474e68bdc64b2c49afd3f6219a5fd7a16e3"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0a542606451e803cc6c7148c79094dbd4f7bcd41","unresolved":false,"context_lines":[{"line_number":588,"context_line":"                                  \u0027hook for %s\u0027, broker.db_file)"},{"line_number":589,"context_line":"        if not shouldbehere and responses and all(responses):"},{"line_number":590,"context_line":"            # If the db shouldn\u0027t be on this node and has been successfully"},{"line_number":591,"context_line":"            # synced to all of its peers, it can be removed."},{"line_number":592,"context_line":"            if not self.delete_db(broker):"},{"line_number":593,"context_line":"                failure_devs_info.update("},{"line_number":594,"context_line":"                    [(failure_dev[\u0027replication_ip\u0027], failure_dev[\u0027device\u0027])"}],"source_content_type":"text/x-python","patch_set":8,"id":"dfeb2761_2e5aa9f2","line":591,"updated":"2017-03-31 21:52:06.000000000","message":"Now that we know this bug exists I think we have to think harder about this condition.  Can we exempt DriveNotMounted from all(responses) if we know that we\u0027re going to \"replace\" it with another success?  Maybe if we\u0027re a handoff we just need len(r for r in responses if r is True) \u003e #replicas?","commit_id":"82da9474e68bdc64b2c49afd3f6219a5fd7a16e3"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"d318c7ab9846420a8bc0bb0f3c492cda1637367f","unresolved":false,"context_lines":[{"line_number":537,"context_line":"            i \u003d 0"},{"line_number":538,"context_line":"            while i \u003c len(nodes) and nodes[i][\u0027id\u0027] !\u003d node_id:"},{"line_number":539,"context_line":"                i +\u003d 1"},{"line_number":540,"context_line":"            repl_nodes \u003d nodes[i + 1:] + nodes[:i]"},{"line_number":541,"context_line":"        else:  # Special case if using only a single replica"},{"line_number":542,"context_line":"            repl_nodes \u003d nodes"},{"line_number":543,"context_line":"        more_nodes \u003d self.ring.get_more_nodes(int(partition))"}],"source_content_type":"text/x-python","patch_set":13,"id":"ff346bd7_6f571f5a","side":"PARENT","line":540,"range":{"start_line":540,"start_character":12,"end_line":540,"end_character":50},"updated":"2017-07-27 17:56:06.000000000","message":"this never includes local_dev even when partition is wrong","commit_id":"9627bcbc9440909bacfe0d735562a5be4f125fda"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"d318c7ab9846420a8bc0bb0f3c492cda1637367f","unresolved":false,"context_lines":[{"line_number":539,"context_line":"                i +\u003d 1"},{"line_number":540,"context_line":"            repl_nodes \u003d nodes[i + 1:] + nodes[:i]"},{"line_number":541,"context_line":"        else:  # Special case if using only a single replica"},{"line_number":542,"context_line":"            repl_nodes \u003d nodes"},{"line_number":543,"context_line":"        more_nodes \u003d self.ring.get_more_nodes(int(partition))"},{"line_number":544,"context_line":"        if not local_dev:"},{"line_number":545,"context_line":"            # Check further if local device is a handoff node"}],"source_content_type":"text/x-python","patch_set":13,"id":"ff346bd7_0fe1b32a","side":"PARENT","line":542,"range":{"start_line":542,"start_character":12,"end_line":542,"end_character":30},"updated":"2017-07-27 17:56:06.000000000","message":"but this results in replicating to node even when node and partition are correct??","commit_id":"9627bcbc9440909bacfe0d735562a5be4f125fda"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"d318c7ab9846420a8bc0bb0f3c492cda1637367f","unresolved":false,"context_lines":[{"line_number":580,"context_line":"        except (Exception, Timeout):"},{"line_number":581,"context_line":"            self.logger.exception(\u0027UNHANDLED EXCEPTION: in post replicate \u0027"},{"line_number":582,"context_line":"                                  \u0027hook for %s\u0027, broker.db_file)"},{"line_number":583,"context_line":"        if not shouldbehere and responses and all(responses):"},{"line_number":584,"context_line":"            # If the db shouldn\u0027t be on this node and has been successfully"},{"line_number":585,"context_line":"            # synced to all of its peers, it can be removed."},{"line_number":586,"context_line":"            if not self.delete_db(broker):"}],"source_content_type":"text/x-python","patch_set":13,"id":"ff346bd7_52208248","side":"PARENT","line":583,"range":{"start_line":583,"start_character":46,"end_line":583,"end_character":61},"updated":"2017-07-27 17:56:06.000000000","message":"a replication to a primary failed, then replication to a handoff succeeds, but we still do not remove the db from here.","commit_id":"9627bcbc9440909bacfe0d735562a5be4f125fda"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"d318c7ab9846420a8bc0bb0f3c492cda1637367f","unresolved":false,"context_lines":[{"line_number":537,"context_line":"                repl_nodes \u003d nodes[local_index + 1:] + nodes[:local_index]"},{"line_number":538,"context_line":"                if not shouldbehere:"},{"line_number":539,"context_line":"                    # replicate with self to correct path"},{"line_number":540,"context_line":"                    repl_nodes.append(local_dev)"},{"line_number":541,"context_line":"                break"},{"line_number":542,"context_line":"        else:"},{"line_number":543,"context_line":"            shouldbehere \u003d False"}],"source_content_type":"text/x-python","patch_set":13,"id":"ff346bd7_2f5237df","line":540,"range":{"start_line":540,"start_character":20,"end_line":540,"end_character":48},"updated":"2017-07-27 17:56:06.000000000","message":"+1 only include local_dev when the partition is wrong\n\ni.e. \"DB is replicated to local node before removing a replica when partition should be changed\"","commit_id":"31c1e3fb719873363c585cf13a2735ceaba9874c"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"d318c7ab9846420a8bc0bb0f3c492cda1637367f","unresolved":false,"context_lines":[{"line_number":541,"context_line":"                break"},{"line_number":542,"context_line":"        else:"},{"line_number":543,"context_line":"            shouldbehere \u003d False"},{"line_number":544,"context_line":"            repl_nodes \u003d nodes"},{"line_number":545,"context_line":"            for node in self.ring.get_more_nodes(int(partition)):"},{"line_number":546,"context_line":"                if node[\u0027id\u0027] \u003d\u003d node_id:"},{"line_number":547,"context_line":"                    local_dev \u003d node"}],"source_content_type":"text/x-python","patch_set":13,"id":"ff346bd7_af5747ca","line":544,"range":{"start_line":544,"start_character":12,"end_line":544,"end_character":30},"updated":"2017-07-27 17:56:06.000000000","message":"never includes local_dev (there isn\u0027t one)","commit_id":"31c1e3fb719873363c585cf13a2735ceaba9874c"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"d318c7ab9846420a8bc0bb0f3c492cda1637367f","unresolved":false,"context_lines":[{"line_number":546,"context_line":"                if node[\u0027id\u0027] \u003d\u003d node_id:"},{"line_number":547,"context_line":"                    local_dev \u003d node"},{"line_number":548,"context_line":"                    break"},{"line_number":549,"context_line":"        if not repl_nodes:"},{"line_number":550,"context_line":"            # Special case if using only a single replica"},{"line_number":551,"context_line":"            if shouldbehere:"},{"line_number":552,"context_line":"                # one replica is placed on proper partition and device"}],"source_content_type":"text/x-python","patch_set":13,"id":"ff346bd7_2cd8051c","line":549,"updated":"2017-07-27 17:56:06.000000000","message":"this implies there is only one replica, and it is on the correct node, so at line 537 repl_nodes \u003d []","commit_id":"31c1e3fb719873363c585cf13a2735ceaba9874c"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"d318c7ab9846420a8bc0bb0f3c492cda1637367f","unresolved":false,"context_lines":[{"line_number":548,"context_line":"                    break"},{"line_number":549,"context_line":"        if not repl_nodes:"},{"line_number":550,"context_line":"            # Special case if using only a single replica"},{"line_number":551,"context_line":"            if shouldbehere:"},{"line_number":552,"context_line":"                # one replica is placed on proper partition and device"},{"line_number":553,"context_line":"                self.logger.timing_since(\u0027timing\u0027, start_time)"},{"line_number":554,"context_line":"                return"}],"source_content_type":"text/x-python","patch_set":13,"id":"ff346bd7_acfd156f","line":551,"updated":"2017-07-27 17:56:06.000000000","message":"this would be false IFF partition is wrong","commit_id":"31c1e3fb719873363c585cf13a2735ceaba9874c"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"d318c7ab9846420a8bc0bb0f3c492cda1637367f","unresolved":false,"context_lines":[{"line_number":552,"context_line":"                # one replica is placed on proper partition and device"},{"line_number":553,"context_line":"                self.logger.timing_since(\u0027timing\u0027, start_time)"},{"line_number":554,"context_line":"                return"},{"line_number":555,"context_line":"            repl_nodes \u003d nodes"},{"line_number":556,"context_line":"        attempts_left \u003d len(repl_nodes)"},{"line_number":557,"context_line":"        all_nodes \u003d itertools.chain("},{"line_number":558,"context_line":"            repl_nodes,"}],"source_content_type":"text/x-python","patch_set":13,"id":"ff346bd7_0c4301b1","line":555,"range":{"start_line":555,"start_character":13,"end_line":555,"end_character":30},"updated":"2017-07-27 17:56:06.000000000","message":"wrong partition so we want to replicate to all nodes which is in fact just *the* one node we are on","commit_id":"31c1e3fb719873363c585cf13a2735ceaba9874c"},{"author":{"_account_id":23449,"name":"Pavel Kvasnička","email":"pavel.kvasnicka@firma.seznam.cz","username":"PavelK"},"change_message_id":"6d66acb0a7c88ceb65e7e2c1206d31d04b4dd071","unresolved":false,"context_lines":[{"line_number":552,"context_line":"                # one replica is placed on proper partition and device"},{"line_number":553,"context_line":"                self.logger.timing_since(\u0027timing\u0027, start_time)"},{"line_number":554,"context_line":"                return"},{"line_number":555,"context_line":"            repl_nodes \u003d nodes"},{"line_number":556,"context_line":"        attempts_left \u003d len(repl_nodes)"},{"line_number":557,"context_line":"        all_nodes \u003d itertools.chain("},{"line_number":558,"context_line":"            repl_nodes,"}],"source_content_type":"text/x-python","patch_set":13,"id":"bf3e73b7_b7fe1803","line":555,"range":{"start_line":555,"start_character":13,"end_line":555,"end_character":30},"in_reply_to":"ff346bd7_0c4301b1","updated":"2017-08-07 06:16:00.000000000","message":"right, this line is unnecessary (but I want be sure if something changes above)","commit_id":"31c1e3fb719873363c585cf13a2735ceaba9874c"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"d318c7ab9846420a8bc0bb0f3c492cda1637367f","unresolved":false,"context_lines":[{"line_number":554,"context_line":"                return"},{"line_number":555,"context_line":"            repl_nodes \u003d nodes"},{"line_number":556,"context_line":"        attempts_left \u003d len(repl_nodes)"},{"line_number":557,"context_line":"        all_nodes \u003d itertools.chain("},{"line_number":558,"context_line":"            repl_nodes,"},{"line_number":559,"context_line":"            self.ring.get_more_nodes(int(partition)))"},{"line_number":560,"context_line":"        while attempts_left \u003e 0:"}],"source_content_type":"text/x-python","patch_set":13,"id":"ff346bd7_4cd909f1","line":557,"range":{"start_line":557,"start_character":20,"end_line":557,"end_character":35},"updated":"2017-07-27 17:56:06.000000000","message":"+1 much nicer","commit_id":"31c1e3fb719873363c585cf13a2735ceaba9874c"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"d318c7ab9846420a8bc0bb0f3c492cda1637367f","unresolved":false,"context_lines":[{"line_number":567,"context_line":"                    partition)"},{"line_number":568,"context_line":"                break"},{"line_number":569,"context_line":"            attempts_left -\u003d 1"},{"line_number":570,"context_line":"            if node \u003d\u003d local_dev and current_part \u003d\u003d ring_part:"},{"line_number":571,"context_line":"                continue"},{"line_number":572,"context_line":"            different_region \u003d False"},{"line_number":573,"context_line":"            if local_dev and local_dev[\u0027region\u0027] !\u003d node[\u0027region\u0027]:"}],"source_content_type":"text/x-python","patch_set":13,"id":"ff346bd7_afa2a7fa","line":570,"range":{"start_line":570,"start_character":37,"end_line":570,"end_character":62},"updated":"2017-07-27 17:56:06.000000000","message":"this is equivalent to \u0027shouldbehere\u0027 I think?\n\n[ignore - see update:\nin fact, can this ever be true? local_dev is only in repl_nodes if:\n\n- line 540, current part !\u003d part\n- single replica but then we would returned early at line 554\n\n]\n\nUpdate: yes, can be true if local_dev is a handoff - here we\u0027re iterating over repl_nodes AND potentially handoffs","commit_id":"31c1e3fb719873363c585cf13a2735ceaba9874c"},{"author":{"_account_id":23449,"name":"Pavel Kvasnička","email":"pavel.kvasnicka@firma.seznam.cz","username":"PavelK"},"change_message_id":"6d66acb0a7c88ceb65e7e2c1206d31d04b4dd071","unresolved":false,"context_lines":[{"line_number":567,"context_line":"                    partition)"},{"line_number":568,"context_line":"                break"},{"line_number":569,"context_line":"            attempts_left -\u003d 1"},{"line_number":570,"context_line":"            if node \u003d\u003d local_dev and current_part \u003d\u003d ring_part:"},{"line_number":571,"context_line":"                continue"},{"line_number":572,"context_line":"            different_region \u003d False"},{"line_number":573,"context_line":"            if local_dev and local_dev[\u0027region\u0027] !\u003d node[\u0027region\u0027]:"}],"source_content_type":"text/x-python","patch_set":13,"id":"bf3e73b7_17f5e4cb","line":570,"range":{"start_line":570,"start_character":37,"end_line":570,"end_character":62},"in_reply_to":"ff346bd7_afa2a7fa","updated":"2017-08-07 06:16:00.000000000","message":"As You found - it is for handoffs where \u0027shouldbehere\u0027 is false and Clay G. suggested correct path even on handoffs [1].\n\n[1] https://review.openstack.org/#/c/454174/7/swift/common/db_replicator.py","commit_id":"31c1e3fb719873363c585cf13a2735ceaba9874c"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"d318c7ab9846420a8bc0bb0f3c492cda1637367f","unresolved":false,"context_lines":[{"line_number":568,"context_line":"                break"},{"line_number":569,"context_line":"            attempts_left -\u003d 1"},{"line_number":570,"context_line":"            if node \u003d\u003d local_dev and current_part \u003d\u003d ring_part:"},{"line_number":571,"context_line":"                continue"},{"line_number":572,"context_line":"            different_region \u003d False"},{"line_number":573,"context_line":"            if local_dev and local_dev[\u0027region\u0027] !\u003d node[\u0027region\u0027]:"},{"line_number":574,"context_line":"                # This additional information will help later if we"}],"source_content_type":"text/x-python","patch_set":13,"id":"ff346bd7_cf528b3b","line":571,"range":{"start_line":571,"start_character":16,"end_line":571,"end_character":24},"updated":"2017-07-27 17:56:06.000000000","message":"i.e. \"Handoff device is not replicated with self.\" (unless partition is wrong)","commit_id":"31c1e3fb719873363c585cf13a2735ceaba9874c"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"d318c7ab9846420a8bc0bb0f3c492cda1637367f","unresolved":false,"context_lines":[{"line_number":596,"context_line":"            self.logger.exception(\u0027UNHANDLED EXCEPTION: in post replicate \u0027"},{"line_number":597,"context_line":"                                  \u0027hook for %s\u0027, broker.db_file)"},{"line_number":598,"context_line":"        num_success \u003d sum(1 for s in responses if s)"},{"line_number":599,"context_line":"        if not shouldbehere and num_success and num_success \u003e\u003d len(nodes):"},{"line_number":600,"context_line":"            # If the db shouldn\u0027t be on this node and has been successfully"},{"line_number":601,"context_line":"            # synced to \u003e\u003d replica count of its peers, it can be removed."},{"line_number":602,"context_line":"            if not self.delete_db(broker):"}],"source_content_type":"text/x-python","patch_set":13,"id":"ff346bd7_f2bd36d8","line":599,"range":{"start_line":599,"start_character":48,"end_line":599,"end_character":59},"updated":"2017-07-27 17:56:06.000000000","message":"we possibly replicated to another handoff, but so long as we have full replica count then it is ok to delete the db - this node may not even be a handoff.\n\ni.e. \"Needless handoff replica is removed (because it is not updated from primaries) when replica count suffice\"","commit_id":"31c1e3fb719873363c585cf13a2735ceaba9874c"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"c74fa1f6878e124fa862f1cb4fbddacd463f3f2f","unresolved":false,"context_lines":[{"line_number":560,"context_line":"                                             different_region)"},{"line_number":561,"context_line":"            except DriveNotMounted:"},{"line_number":562,"context_line":"                try:"},{"line_number":563,"context_line":"                    repl_nodes.append(next(more_nodes))"},{"line_number":564,"context_line":"                except StopIteration:"},{"line_number":565,"context_line":"                    self.logger.error("},{"line_number":566,"context_line":"                        _(\u0027ERROR There are not enough handoff nodes to reach \u0027"}],"source_content_type":"text/x-python","patch_set":14,"id":"9f436f4f_95333bab","side":"PARENT","line":563,"range":{"start_line":563,"start_character":20,"end_line":563,"end_character":55},"updated":"2017-08-16 18:01:42.000000000","message":"here the handoffs were appended to repl_nodes","commit_id":"9627bcbc9440909bacfe0d735562a5be4f125fda"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"c74fa1f6878e124fa862f1cb4fbddacd463f3f2f","unresolved":false,"context_lines":[{"line_number":588,"context_line":"                    [(failure_dev[\u0027replication_ip\u0027], failure_dev[\u0027device\u0027])"},{"line_number":589,"context_line":"                     for failure_dev in repl_nodes])"},{"line_number":590,"context_line":""},{"line_number":591,"context_line":"        target_devs_info \u003d set([(target_dev[\u0027replication_ip\u0027],"},{"line_number":592,"context_line":"                                 target_dev[\u0027device\u0027])"},{"line_number":593,"context_line":"                                for target_dev in repl_nodes])"},{"line_number":594,"context_line":"        self.stats[\u0027success\u0027] +\u003d len(target_devs_info - failure_devs_info)"},{"line_number":595,"context_line":"        self._add_failure_stats(failure_devs_info)"},{"line_number":596,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"9f436f4f_b5d51f1e","side":"PARENT","line":593,"range":{"start_line":591,"start_character":8,"end_line":593,"end_character":62},"updated":"2017-08-16 18:01:42.000000000","message":"target_devs_info includes the handoffs appended to repl_nodes","commit_id":"9627bcbc9440909bacfe0d735562a5be4f125fda"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"b97220d4a0ec85568456a97144a09c2c9e7a20b7","unresolved":false,"context_lines":[{"line_number":527,"context_line":"            return"},{"line_number":528,"context_line":"        responses \u003d []"},{"line_number":529,"context_line":"        failure_devs_info \u003d set()"},{"line_number":530,"context_line":"        nodes \u003d self.ring.get_part_nodes(int(partition))"},{"line_number":531,"context_line":"        local_dev \u003d None"},{"line_number":532,"context_line":"        for (local_index, node) in enumerate(nodes):"},{"line_number":533,"context_line":"            if node[\u0027id\u0027] \u003d\u003d node_id:"}],"source_content_type":"text/x-python","patch_set":14,"id":"9f436f4f_3e3afe33","line":530,"range":{"start_line":530,"start_character":8,"end_line":530,"end_character":14},"updated":"2017-08-18 09:26:47.000000000","message":"nits) perhaps, renaming to \"primary_nodes\" would be nice to make the code reading easy. Especially in the case to handle the number of successful responses at Line 599.","commit_id":"3b6295f3f489f8988f340def87f863b18a03297c"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"b97220d4a0ec85568456a97144a09c2c9e7a20b7","unresolved":false,"context_lines":[{"line_number":529,"context_line":"        failure_devs_info \u003d set()"},{"line_number":530,"context_line":"        nodes \u003d self.ring.get_part_nodes(int(partition))"},{"line_number":531,"context_line":"        local_dev \u003d None"},{"line_number":532,"context_line":"        for (local_index, node) in enumerate(nodes):"},{"line_number":533,"context_line":"            if node[\u0027id\u0027] \u003d\u003d node_id:"},{"line_number":534,"context_line":"                local_dev \u003d node"},{"line_number":535,"context_line":"                # See Footnote [1] for an explanation of the repl_nodes"}],"source_content_type":"text/x-python","patch_set":14,"id":"9f436f4f_ea4a7881","line":532,"updated":"2017-08-18 09:26:47.000000000","message":"nits) I\u0027m not sure if it\u0027s fortunate but the primary nodes here will have index already (it\u0027s developed for ec index but we can reuse that, here?)\n\nso you can just do the for-loop with no change and can look up the index with \u0027index\u0027 key:\n\ne.g.\n\n for node in nodes:\n   if node[\u0027id\u0027] \u003d\u003d node_id:\n     local_dev \u003d node\n     # See Footnote [1] for an explanation of the repl_nodes\n     # assignment.\n     repl_nodes \u003d nodes[node[\u0027index\u0027] + 1:] + nodes[:node[\u0027index\u0027]]\n\n\nOh... OMG, the FakeRing in test_db_replicator doesn\u0027t behave as actual Swift\u0027s Ring. So you need more change like:\n\ndiff --git a/test/unit/common/test_db_replicator.py b/test/unit/common/test_db_replicator.py\nindex bc3010a..60b87b9 100644\n--- a/test/unit/common/test_db_replicator.py\n+++ b/test/unit/common/test_db_replicator.py\n@@ -76,7 +76,8 @@ class FakeRingWithSingleNode(object):\n     class Ring(object):\n         devs \u003d [dict(\n             id\u003d1, weight\u003d10.0, zone\u003d1, ip\u003d\u00271.1.1.1\u0027, port\u003d6200, device\u003d\u0027sdb\u0027,\n-            meta\u003d\u0027\u0027, replication_ip\u003d\u00271.1.1.1\u0027, replication_port\u003d6200, region\u003d1\n+            meta\u003d\u0027\u0027, replication_ip\u003d\u00271.1.1.1\u0027, replication_port\u003d6200, region\u003d1,\n+            index\u003d0,\n         )]\n \n         def __init__(self, path, reload_time\u003d15, ring_name\u003dNone):\n@@ -121,7 +122,8 @@ class FakeRingWithNodes(object):\n             return 0\n \n         def get_part_nodes(self, part):\n-            return self.devs[:3]\n+            part_nodes \u003d self.devs[:3]\n+            return [dict(node, index\u003di) for i, node in enumerate(part_nodes)]\n \n         def get_more_nodes(self, *args):\n             return (d for d in self.devs[3:])\n\n[1] :https://github.com/openstack/swift/blob/master/swift/common/ring/ring.py#L320","commit_id":"3b6295f3f489f8988f340def87f863b18a03297c"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"b97220d4a0ec85568456a97144a09c2c9e7a20b7","unresolved":false,"context_lines":[{"line_number":537,"context_line":"                repl_nodes \u003d nodes[local_index + 1:] + nodes[:local_index]"},{"line_number":538,"context_line":"                if not shouldbehere:"},{"line_number":539,"context_line":"                    # replicate with self to correct path"},{"line_number":540,"context_line":"                    repl_nodes.append(local_dev)"},{"line_number":541,"context_line":"                break"},{"line_number":542,"context_line":"        else:"},{"line_number":543,"context_line":"            shouldbehere \u003d False"}],"source_content_type":"text/x-python","patch_set":14,"id":"9f436f4f_8a388c3d","line":540,"updated":"2017-08-18 09:26:47.000000000","message":"Perhaps, repl_nodes.insert(0, local_dev) would be nice to make it as the first target of the replications?\n\nThat is because moving an object to the local device will be faster operation than replication to other nodes and we could expect to avoid extra replication from other nodes to the local dev, maybe?","commit_id":"3b6295f3f489f8988f340def87f863b18a03297c"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"b97220d4a0ec85568456a97144a09c2c9e7a20b7","unresolved":false,"context_lines":[{"line_number":547,"context_line":"                    local_dev \u003d node"},{"line_number":548,"context_line":"                    break"},{"line_number":549,"context_line":"        if not repl_nodes:"},{"line_number":550,"context_line":"            # Special case if using only a single replica"},{"line_number":551,"context_line":"            if shouldbehere:"},{"line_number":552,"context_line":"                # one replica is placed on proper partition and device"},{"line_number":553,"context_line":"                self.logger.timing_since(\u0027timing\u0027, start_time)"}],"source_content_type":"text/x-python","patch_set":14,"id":"9f436f4f_cd922e4c","line":550,"range":{"start_line":550,"start_character":12,"end_line":550,"end_character":57},"updated":"2017-08-18 09:26:47.000000000","message":"It looks like this comment is not correct anymore because repl_node can contain a node if the file in a handoff. (i think it\u0027s in \"else\" case at Line 542)","commit_id":"3b6295f3f489f8988f340def87f863b18a03297c"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"b97220d4a0ec85568456a97144a09c2c9e7a20b7","unresolved":false,"context_lines":[{"line_number":546,"context_line":"                if node[\u0027id\u0027] \u003d\u003d node_id:"},{"line_number":547,"context_line":"                    local_dev \u003d node"},{"line_number":548,"context_line":"                    break"},{"line_number":549,"context_line":"        if not repl_nodes:"},{"line_number":550,"context_line":"            # Special case if using only a single replica"},{"line_number":551,"context_line":"            if shouldbehere:"},{"line_number":552,"context_line":"                # one replica is placed on proper partition and device"},{"line_number":553,"context_line":"                self.logger.timing_since(\u0027timing\u0027, start_time)"},{"line_number":554,"context_line":"                return"},{"line_number":555,"context_line":"            repl_nodes \u003d nodes"},{"line_number":556,"context_line":"        attempts_left \u003d len(repl_nodes)"},{"line_number":557,"context_line":"        all_nodes \u003d itertools.chain("},{"line_number":558,"context_line":"            repl_nodes,"}],"source_content_type":"text/x-python","patch_set":14,"id":"9f436f4f_c302ff09","line":555,"range":{"start_line":549,"start_character":0,"end_line":555,"end_character":30},"updated":"2017-08-18 09:26:47.000000000","message":"And FWIW, those branches from at L549 to L555 are not tested. When I remove those if statements, no unit tests failed.\n\nNot sure but I\u0027m thinking the case for single replica case would be already cared in the refactor above.\n\nWith one replica:\n\n- If the one exists in the primary and correct partition, repl_nodes will an empty_list so that no replication happens below.\n\n- If the one exists in the primary and invalid partition, shouldbehere will be False and then local dev will be appended to the repl_nodes at L540 so that repl_nodes will be a list with [local_dev]\n\n- if the one exists in the handoff, It will be at L542 \"else\" case so repl_nodes will equal to nodes, i.e. a list consists of single replcia.\n\n\nIs it the reason, the unit tests passed when I removing those lines?","commit_id":"3b6295f3f489f8988f340def87f863b18a03297c"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"c74fa1f6878e124fa862f1cb4fbddacd463f3f2f","unresolved":false,"context_lines":[{"line_number":555,"context_line":"            repl_nodes \u003d nodes"},{"line_number":556,"context_line":"        attempts_left \u003d len(repl_nodes)"},{"line_number":557,"context_line":"        all_nodes \u003d itertools.chain("},{"line_number":558,"context_line":"            repl_nodes,"},{"line_number":559,"context_line":"            self.ring.get_more_nodes(int(partition)))"},{"line_number":560,"context_line":"        while attempts_left \u003e 0:"},{"line_number":561,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":14,"id":"9f436f4f_d5fb03bb","line":558,"range":{"start_line":558,"start_character":12,"end_line":558,"end_character":22},"updated":"2017-08-16 18:01:42.000000000","message":"handoffs are not appended to repl_nodes","commit_id":"3b6295f3f489f8988f340def87f863b18a03297c"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"b97220d4a0ec85568456a97144a09c2c9e7a20b7","unresolved":false,"context_lines":[{"line_number":567,"context_line":"                    partition)"},{"line_number":568,"context_line":"                break"},{"line_number":569,"context_line":"            attempts_left -\u003d 1"},{"line_number":570,"context_line":"            if node \u003d\u003d local_dev and current_part \u003d\u003d ring_part:"},{"line_number":571,"context_line":"                continue"},{"line_number":572,"context_line":"            different_region \u003d False"},{"line_number":573,"context_line":"            if local_dev and local_dev[\u0027region\u0027] !\u003d node[\u0027region\u0027]:"}],"source_content_type":"text/x-python","patch_set":14,"id":"9f436f4f_be794e94","line":570,"updated":"2017-08-18 09:26:47.000000000","message":"nits) OK, I\u0027d love to add a comment line to describe why we can not avoid the node in the all_nodes list here. That is because it\u0027s the candidate to replicate but it\u0027s me so that we want just decrement attempts_left. And I suppose this happens only in handoff nodes.","commit_id":"3b6295f3f489f8988f340def87f863b18a03297c"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"c74fa1f6878e124fa862f1cb4fbddacd463f3f2f","unresolved":false,"context_lines":[{"line_number":576,"context_line":"                # region with some optimizations."},{"line_number":577,"context_line":"                different_region \u003d True"},{"line_number":578,"context_line":"            success \u003d False"},{"line_number":579,"context_line":"            try:"},{"line_number":580,"context_line":"                success \u003d self._repl_to_node(node, broker, partition, info,"},{"line_number":581,"context_line":"                                             different_region)"},{"line_number":582,"context_line":"            except DriveNotMounted:"}],"source_content_type":"text/x-python","patch_set":14,"id":"9f436f4f_f5f16796","line":579,"updated":"2017-08-16 18:01:42.000000000","message":"we probably need to append to target_devs_info here","commit_id":"3b6295f3f489f8988f340def87f863b18a03297c"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"b97220d4a0ec85568456a97144a09c2c9e7a20b7","unresolved":false,"context_lines":[{"line_number":576,"context_line":"                # region with some optimizations."},{"line_number":577,"context_line":"                different_region \u003d True"},{"line_number":578,"context_line":"            success \u003d False"},{"line_number":579,"context_line":"            try:"},{"line_number":580,"context_line":"                success \u003d self._repl_to_node(node, broker, partition, info,"},{"line_number":581,"context_line":"                                             different_region)"},{"line_number":582,"context_line":"            except DriveNotMounted:"}],"source_content_type":"text/x-python","patch_set":14,"id":"9f436f4f_c3f31f73","line":579,"in_reply_to":"9f436f4f_f5f16796","updated":"2017-08-18 09:26:47.000000000","message":"+1","commit_id":"3b6295f3f489f8988f340def87f863b18a03297c"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"c74fa1f6878e124fa862f1cb4fbddacd463f3f2f","unresolved":false,"context_lines":[{"line_number":604,"context_line":"                    [(failure_dev[\u0027replication_ip\u0027], failure_dev[\u0027device\u0027])"},{"line_number":605,"context_line":"                     for failure_dev in repl_nodes])"},{"line_number":606,"context_line":""},{"line_number":607,"context_line":"        target_devs_info \u003d set([(target_dev[\u0027replication_ip\u0027],"},{"line_number":608,"context_line":"                                 target_dev[\u0027device\u0027])"},{"line_number":609,"context_line":"                                for target_dev in repl_nodes])"},{"line_number":610,"context_line":"        self.stats[\u0027success\u0027] +\u003d len(target_devs_info - failure_devs_info)"},{"line_number":611,"context_line":"        self._add_failure_stats(failure_devs_info)"},{"line_number":612,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"9f436f4f_d5e9c3e2","line":609,"range":{"start_line":607,"start_character":8,"end_line":609,"end_character":62},"updated":"2017-08-16 18:01:42.000000000","message":"target_devs_info does not include handoffs :(","commit_id":"3b6295f3f489f8988f340def87f863b18a03297c"}],"swift/container/server.py":[{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"28ddb2164d1354a64a743cc229d5d533552febe7","unresolved":false,"context_lines":[{"line_number":262,"context_line":"            return check_mount(self.root, drive)"},{"line_number":263,"context_line":"        else:"},{"line_number":264,"context_line":"            return check_dir(self.root, drive) or \\"},{"line_number":265,"context_line":"                True  # TODO"},{"line_number":266,"context_line":""},{"line_number":267,"context_line":"    @public"},{"line_number":268,"context_line":"    @timing_stats()"}],"source_content_type":"text/x-python","patch_set":10,"id":"9ff52f3f_cb1d98be","line":265,"updated":"2017-04-13 06:48:49.000000000","message":"Becasue this check_mount is being defined twice, maybe it\u0027s a good candidate for pulling up into swift/common/base_storage_server.py","commit_id":"5a33659512e151d3bac7d6643dd387c0ce43a69d"}],"test/unit/common/test_db_replicator.py":[{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"57d0c52da4c230a650e3e47572fe6b2863ad6696","unresolved":false,"context_lines":[{"line_number":656,"context_line":"        replicator._repl_to_node \u003d mock.Mock(side_effect\u003d[DriveNotMounted()])"},{"line_number":657,"context_line":"        replicator._replicate_object(\u00270\u0027, \u0027/path/to/file\u0027,"},{"line_number":658,"context_line":"                                     replicator.ring.devs[0][\u0027id\u0027])"},{"line_number":659,"context_line":"        self.assertEqual(3, replicator._repl_to_node.call_count)"},{"line_number":660,"context_line":"        # called on +1 more replica when *first* handoff"},{"line_number":661,"context_line":"        replicator._repl_to_node \u003d mock.Mock(side_effect\u003d[DriveNotMounted()])"},{"line_number":662,"context_line":"        replicator._replicate_object(\u00270\u0027, \u0027/path/to/file\u0027,"}],"source_content_type":"text/x-python","patch_set":5,"id":"ffe62b97_8f97a845","line":659,"updated":"2017-03-30 06:24:08.000000000","message":"for completeness what about when both primaries are not mounted, we want to test to make sure we keep durability:\n\n  # with two DriveNotMounted exceptions called on +2 more replica keeping\n  # durability\n  replicator._repl_to_node \u003d mock.Mock(\n      side_effect\u003d[DriveNotMounted()] * 2)\n  replicator._replicate_object(\u00270\u0027, \u0027/path/to/file\u0027,\n                               replicator.ring.devs[0][\u0027id\u0027])\n  self.assertEqual(4, replicator._repl_to_node.call_count)","commit_id":"fbc6cbb60b2c2cb7f31d382fcd0397f8c5d9641c"},{"author":{"_account_id":23449,"name":"Pavel Kvasnička","email":"pavel.kvasnicka@firma.seznam.cz","username":"PavelK"},"change_message_id":"40e5420a80b0e98d2bd17b8babf57008b8dbed70","unresolved":false,"context_lines":[{"line_number":656,"context_line":"        replicator._repl_to_node \u003d mock.Mock(side_effect\u003d[DriveNotMounted()])"},{"line_number":657,"context_line":"        replicator._replicate_object(\u00270\u0027, \u0027/path/to/file\u0027,"},{"line_number":658,"context_line":"                                     replicator.ring.devs[0][\u0027id\u0027])"},{"line_number":659,"context_line":"        self.assertEqual(3, replicator._repl_to_node.call_count)"},{"line_number":660,"context_line":"        # called on +1 more replica when *first* handoff"},{"line_number":661,"context_line":"        replicator._repl_to_node \u003d mock.Mock(side_effect\u003d[DriveNotMounted()])"},{"line_number":662,"context_line":"        replicator._replicate_object(\u00270\u0027, \u0027/path/to/file\u0027,"}],"source_content_type":"text/x-python","patch_set":5,"id":"ffe62b97_6208f6d8","line":659,"in_reply_to":"ffe62b97_8f97a845","updated":"2017-03-30 08:28:15.000000000","message":"Done, I forgot it, thanks","commit_id":"fbc6cbb60b2c2cb7f31d382fcd0397f8c5d9641c"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0a542606451e803cc6c7148c79094dbd4f7bcd41","unresolved":false,"context_lines":[{"line_number":661,"context_line":"        replicator._repl_to_node \u003d mock.Mock(side_effect\u003d[DriveNotMounted()])"},{"line_number":662,"context_line":"        replicator._replicate_object(\u00270\u0027, \u0027/path/to/file\u0027,"},{"line_number":663,"context_line":"                                     replicator.ring.devs[3][\u0027id\u0027])"},{"line_number":664,"context_line":"        self.assertEqual(3, replicator._repl_to_node.call_count)"},{"line_number":665,"context_line":"        # with two DriveNotMounted exceptions called on +2 more replica keeping"},{"line_number":666,"context_line":"        # durability"},{"line_number":667,"context_line":"        replicator._repl_to_node \u003d mock.Mock("}],"source_content_type":"text/x-python","patch_set":8,"id":"dfeb2761_8ebc1506","line":664,"updated":"2017-03-31 21:52:06.000000000","message":"lgtm:\n\n    ubuntu@saio:~$ nosetests swift/test/unit/common/test_db_replicator.py\n    ............................F..................................\n    \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n    FAIL: test_replicate_object_with_exception (test.unit.common.test_db_replicator.TestDBReplicator)\n    ----------------------------------------------------------------------\n    Traceback (most recent call last):\n      File \"/home/ubuntu/swift/test/unit/common/test_db_replicator.py\", line 664, in test_replicate_object_with_exception\n        self.assertEqual(3, replicator._repl_to_node.call_count)\n    AssertionError: 3 !\u003d 4\n\n    ----------------------------------------------------------------------\n    Ran 63 tests in 0.131s\n\n    FAILED (failures\u003d1)","commit_id":"82da9474e68bdc64b2c49afd3f6219a5fd7a16e3"},{"author":{"_account_id":12261,"name":"Mahati","email":"mahati.chamarthy@gmail.com","username":"Mahati"},"change_message_id":"24c76dddd1dd7e86a07fc14a03a748e1e17c7a9f","unresolved":false,"context_lines":[{"line_number":775,"context_line":"        replicator._replicate_object(str(part), \u0027/path/to/file\u0027, node_id)"},{"line_number":776,"context_line":"        self.assertEqual([], self.delete_db_calls)"},{"line_number":777,"context_line":""},{"line_number":778,"context_line":"    def test_out_of_place_part_handoff_node(self):"},{"line_number":779,"context_line":"        replicator \u003d TestReplicator({}, logger\u003dunit.FakeLogger())"},{"line_number":780,"context_line":"        replicator.ring \u003d FakeRingWithNodes().Ring(\u0027path\u0027)"},{"line_number":781,"context_line":"        replicator._repl_to_node \u003d lambda *args: True"}],"source_content_type":"text/x-python","patch_set":14,"id":"ff346bd7_08f3cd75","line":778,"range":{"start_line":778,"start_character":8,"end_line":778,"end_character":43},"updated":"2017-07-28 10:08:07.000000000","message":"I think this is an extra test which is nice. It doesn\u0027t fail on commenting code in this change.","commit_id":"3b6295f3f489f8988f340def87f863b18a03297c"}]}
