)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":16896,"name":"Ondřej Nový","email":"novy@ondrej.org","username":"onovy"},"change_message_id":"98b69927c9df7d7a58fd72186c9aa762ab3cb9d5","unresolved":false,"context_lines":[{"line_number":9,"context_line":"swift-ring-builder currently only displays min_part_hours and"},{"line_number":10,"context_line":"not the amount of time remaining before a rebalance can occur."},{"line_number":11,"context_line":"This information is readily available and has been displayed"},{"line_number":12,"context_line":"as a quality of life imporovement."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Additionally, a bug where the time since the last rebalance"},{"line_number":15,"context_line":"was always updated when rebalance was called regardless of"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"5a710552_9b6ace19","line":12,"updated":"2015-12-14 22:26:19.000000000","message":"improvement","commit_id":"9b21a2e2a35649847145aa0771f1c2c6a174d11b"},{"author":{"_account_id":12974,"name":"Ben Martin","email":"blmartin@us.ibm.com","username":"blmartin"},"change_message_id":"f7062b2e17885cc2fbc49498d6d989d99bdd3768","unresolved":false,"context_lines":[{"line_number":9,"context_line":"swift-ring-builder currently only displays min_part_hours and"},{"line_number":10,"context_line":"not the amount of time remaining before a rebalance can occur."},{"line_number":11,"context_line":"This information is readily available and has been displayed"},{"line_number":12,"context_line":"as a quality of life imporovement."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Additionally, a bug where the time since the last rebalance"},{"line_number":15,"context_line":"was always updated when rebalance was called regardless of"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"5a710552_bb11ca5f","line":12,"in_reply_to":"5a710552_9b6ace19","updated":"2015-12-14 22:39:46.000000000","message":"Ah thanks, I\u0027ll check for similar issues now","commit_id":"9b21a2e2a35649847145aa0771f1c2c6a174d11b"}],"swift/cli/ringbuilder.py":[{"author":{"_account_id":12974,"name":"Ben Martin","email":"blmartin@us.ibm.com","username":"blmartin"},"change_message_id":"f7062b2e17885cc2fbc49498d6d989d99bdd3768","unresolved":false,"context_lines":[{"line_number":806,"context_line":"        if not (parts or options.force or removed_devs):"},{"line_number":807,"context_line":"            print(\u0027No partitions could be reassigned.\u0027)"},{"line_number":808,"context_line":"            if builder.min_part_seconds_left \u003e 0:"},{"line_number":809,"context_line":"                print (\u0027The time between rebalances must be at least \u0027"},{"line_number":810,"context_line":"                       \u0027min_part_hours: %s hours (%s remaining)\u0027 % ("},{"line_number":811,"context_line":"                        builder.min_part_hours,"},{"line_number":812,"context_line":"                        timedelta(seconds\u003dbuilder.min_part_seconds_left)))"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a710552_9bce4d82","line":809,"updated":"2015-12-14 22:39:46.000000000","message":"If we are interested in consistency, we could change this line to more resemble what it was in the past: \u0027None can be due to min_part_hours [%s] (%s remaining).\u0027","commit_id":"9b21a2e2a35649847145aa0771f1c2c6a174d11b"},{"author":{"_account_id":12974,"name":"Ben Martin","email":"blmartin@us.ibm.com","username":"blmartin"},"change_message_id":"f7062b2e17885cc2fbc49498d6d989d99bdd3768","unresolved":false,"context_lines":[{"line_number":811,"context_line":"                        builder.min_part_hours,"},{"line_number":812,"context_line":"                        timedelta(seconds\u003dbuilder.min_part_seconds_left)))"},{"line_number":813,"context_line":"            else:"},{"line_number":814,"context_line":"                print(\u0027There is no need to do so at this time\u0027)"},{"line_number":815,"context_line":"            exit(EXIT_WARNING)"},{"line_number":816,"context_line":"        # If we set device\u0027s weight to zero, currently balance will be set"},{"line_number":817,"context_line":"        # special value(MAX_BALANCE) until zero weighted device return all"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a710552_1ba1fda9","line":814,"updated":"2015-12-14 22:39:46.000000000","message":"Similarly here \u0027None need to be.\u0027","commit_id":"9b21a2e2a35649847145aa0771f1c2c6a174d11b"},{"author":{"_account_id":6968,"name":"Christian Schwede","email":"cschwede@nvidia.com","username":"cschwede"},"change_message_id":"a618b614b7fd0873588867ecc66abc3f6fd22a93","unresolved":false,"context_lines":[{"line_number":805,"context_line":"            exit(EXIT_ERROR)"},{"line_number":806,"context_line":"        if not (parts or options.force or removed_devs):"},{"line_number":807,"context_line":"            print(\u0027No partitions could be reassigned.\u0027)"},{"line_number":808,"context_line":"            if builder.min_part_seconds_left \u003e 0:"},{"line_number":809,"context_line":"                print (\u0027The time between rebalances must be at least \u0027"},{"line_number":810,"context_line":"                       \u0027min_part_hours: %s hours (%s remaining)\u0027 % ("},{"line_number":811,"context_line":"                           builder.min_part_hours,"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a710552_a9e7243f","line":808,"updated":"2015-12-15 11:17:28.000000000","message":"I think this should be checked earlier, eve before the rebalance command is executed in line 796.","commit_id":"65848f088520390eaa469d2cb2b7469df01cf9df"},{"author":{"_account_id":16896,"name":"Ondřej Nový","email":"novy@ondrej.org","username":"onovy"},"change_message_id":"e8132b48abcbb8384344c57a767b8243df32a1b5","unresolved":false,"context_lines":[{"line_number":811,"context_line":"                  (e,))"},{"line_number":812,"context_line":"            print(\u0027-\u0027 * 79)"},{"line_number":813,"context_line":"            exit(EXIT_ERROR)"},{"line_number":814,"context_line":"        if not (parts or options.force or removed_devs):"},{"line_number":815,"context_line":"            print(\u0027No partitions could be reassigned.\u0027)"},{"line_number":816,"context_line":"            print(\u0027There is no need to do so at this time\u0027)"},{"line_number":817,"context_line":"            exit(EXIT_WARNING)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a7e1126_55c43e91","line":814,"updated":"2015-12-16 22:17:06.000000000","message":"i think (options.force \u003d\u003d True) is not needed here now\n\nor i\u0027m missing something?","commit_id":"50ebd8bf95929df7416893caf5e99492435050ee"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"80a933c50e54a3f197fa56374f6318650793d7ee","unresolved":false,"context_lines":[{"line_number":796,"context_line":"                  \u0027min_part_hours: %s hours (%s remaining)\u0027 % ("},{"line_number":797,"context_line":"                      builder.min_part_hours,"},{"line_number":798,"context_line":"                      timedelta(seconds\u003dbuilder.min_part_seconds_left)))"},{"line_number":799,"context_line":"            exit(EXIT_WARNING)"},{"line_number":800,"context_line":""},{"line_number":801,"context_line":"        devs_changed \u003d builder.devs_changed"},{"line_number":802,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":7,"id":"1af94dfe_7260eca5","line":799,"updated":"2016-03-17 17:08:05.000000000","message":"what about removed devices!?","commit_id":"1f3304c5153e01988b8f4493875b6489e93f76d0"}],"swift/common/ring/builder.py":[{"author":{"_account_id":12974,"name":"Ben Martin","email":"blmartin@us.ibm.com","username":"blmartin"},"change_message_id":"8ebcc2ed9bee430cbc87e62df2a5a88d5f30fedd","unresolved":false,"context_lines":[{"line_number":841,"context_line":"        more recently than min_part_hours."},{"line_number":842,"context_line":"        \"\"\""},{"line_number":843,"context_line":"        elapsed_hours \u003d int(time() - self._last_part_moves_epoch) / 3600"},{"line_number":844,"context_line":"        if elapsed_hours \u003c\u003d 0:"},{"line_number":845,"context_line":"            return"},{"line_number":846,"context_line":"        for part in range(self.parts):"},{"line_number":847,"context_line":"            # The \"min(self._last_part_moves[part] + elapsed_hours, 0xff)\""}],"source_content_type":"text/x-python","patch_set":2,"id":"5a710552_7b260218","line":844,"updated":"2015-12-14 22:24:34.000000000","message":"Every time swift-ring-builder is run, self._last_part_moves is set to int(time). This has the effect of always moving the offset for every partition in _last_part_moves forward to the current time. Normally this is not an issue as you call rebalance only every few hours. if you call rebalance in less than 1 hour, elapsed_hours is 0, every partition in _last_part_moves has 0 hours added to it, and _last_part_moves_epoch is set to \u0027the current time\u0027. In summary, partitions never age if you rebalance at intervals less than an hour.\nPlease let me know if I am imagining this or this is intentional.","commit_id":"9b21a2e2a35649847145aa0771f1c2c6a174d11b"}],"test/unit/cli/test_ringbuilder.py":[{"author":{"_account_id":16896,"name":"Ondřej Nový","email":"novy@ondrej.org","username":"onovy"},"change_message_id":"e8132b48abcbb8384344c57a767b8243df32a1b5","unresolved":false,"context_lines":[{"line_number":1796,"context_line":"        ring \u003d RingBuilder.load(self.tmpfile)"},{"line_number":1797,"context_line":"        ring.set_dev_weight(3, 0.0)"},{"line_number":1798,"context_line":"        ring.rebalance()"},{"line_number":1799,"context_line":"        ring.pretend_min_part_hours_passed()"},{"line_number":1800,"context_line":"        ring.remove_dev(3)"},{"line_number":1801,"context_line":"        ring.save(self.tmpfile)"},{"line_number":1802,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3a7e1126_351732ef","line":1799,"updated":"2015-12-16 22:17:06.000000000","message":"oh, with this change you fixed a bug :)","commit_id":"50ebd8bf95929df7416893caf5e99492435050ee"},{"author":{"_account_id":12974,"name":"Ben Martin","email":"blmartin@us.ibm.com","username":"blmartin"},"change_message_id":"187f719321d630a9cef4e58033a926e57be9179b","unresolved":false,"context_lines":[{"line_number":1838,"context_line":"        ring.save(self.tmpfile)"},{"line_number":1839,"context_line":""},{"line_number":1840,"context_line":"        # min part hours not passed"},{"line_number":1841,"context_line":"        last_moves_epoch \u003d ring._last_part_moves_epoch"},{"line_number":1842,"context_line":"        argv \u003d [\"\", self.tmpfile, \"rebalance\", \"3\"]"},{"line_number":1843,"context_line":"        self.assertRaises(SystemExit, ringbuilder.main, argv)"},{"line_number":1844,"context_line":"        ring \u003d RingBuilder.load(self.tmpfile)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a7e1126_569b8f72","line":1841,"updated":"2015-12-17 19:52:21.000000000","message":"I\u0027m not too happy with accessing a hidden variable in the ring builder from the cli test. My reasons are that this is the most direct way to test that the ring\u0027s part_hours timer has not reset and that the alternative is much more sensitive to clock time (ex. min_part_seconds_left counts down from min_part_hours and depending on processor and clock speeds could prove unpredictable). I also cannot put this test in the ring builder unit tests because the check for any partitions were moved happens in the cli. The builder actually makes the edit, updates the time, and doesn\u0027t care about the number of partitions moved. Any thoughts on other ways of accomplishing this test?","commit_id":"ef55de2dfe99cfac453ef5098b553c81172250b8"},{"author":{"_account_id":18015,"name":"Peter Lisák","email":"peter.lisak@gmail.com","username":"peter.lisak"},"change_message_id":"a0777580a9211bffde9b360f8e94ed1ef849fb7c","unresolved":false,"context_lines":[{"line_number":1838,"context_line":"        ring.save(self.tmpfile)"},{"line_number":1839,"context_line":""},{"line_number":1840,"context_line":"        # min part hours not passed"},{"line_number":1841,"context_line":"        last_moves_epoch \u003d ring._last_part_moves_epoch"},{"line_number":1842,"context_line":"        argv \u003d [\"\", self.tmpfile, \"rebalance\", \"3\"]"},{"line_number":1843,"context_line":"        self.assertRaises(SystemExit, ringbuilder.main, argv)"},{"line_number":1844,"context_line":"        ring \u003d RingBuilder.load(self.tmpfile)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a7e1126_9192619e","line":1841,"in_reply_to":"3a7e1126_569b8f72","updated":"2015-12-17 20:13:18.000000000","message":"I would try to mock time.time() to return constant value, then you will be able to test `min_part_seconds_left` property with the same value.\n\nMaybe you could use a similar mocked time.time() in test_rebalance_resets_time_remaining. You will be able to assert min_part_seconds_left \u003d\u003d SOME_NON_ZERO_VALUE. I suppose that would be more precise check, but it\u0027s just my suggestion.","commit_id":"ef55de2dfe99cfac453ef5098b553c81172250b8"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"a7aef15abadfa4f069d2d8bce14c101b36cea3dc","unresolved":false,"context_lines":[{"line_number":1817,"context_line":""},{"line_number":1818,"context_line":"        # first rebalance, should have 1 hour left before next rebalance"},{"line_number":1819,"context_line":"        time +\u003d 3600"},{"line_number":1820,"context_line":"        with mock.patch(time_path, lambda: time):"},{"line_number":1821,"context_line":"            self.assertEqual(ring.min_part_seconds_left, 0)"},{"line_number":1822,"context_line":"            self.assertRaises(SystemExit, ringbuilder.main, argv)"},{"line_number":1823,"context_line":"            ring \u003d RingBuilder.load(self.tmpfile)"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa69d971_0e461d4f","line":1820,"updated":"2016-01-10 23:41:10.000000000","message":"It would be better to use mock\u0027s return_value here rather then a lambda:\n\n  with mock.patch(time_path, return_value\u003dtime):\n      ...","commit_id":"8a5bd4f9496c4e90fb0ef912fee5567332145d38"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"a7aef15abadfa4f069d2d8bce14c101b36cea3dc","unresolved":false,"context_lines":[{"line_number":1829,"context_line":""},{"line_number":1830,"context_line":"        # second rebalance, should have 1 hour left"},{"line_number":1831,"context_line":"        time +\u003d 3600"},{"line_number":1832,"context_line":"        with mock.patch(time_path, lambda: time):"},{"line_number":1833,"context_line":"            self.assertEqual(ring.min_part_seconds_left, 0)"},{"line_number":1834,"context_line":"            self.assertRaises(SystemExit, ringbuilder.main, argv)"},{"line_number":1835,"context_line":"            ring \u003d RingBuilder.load(self.tmpfile)"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa69d971_ae759198","line":1832,"updated":"2016-01-10 23:41:10.000000000","message":"As above, and the other lambda\u0027s below.","commit_id":"8a5bd4f9496c4e90fb0ef912fee5567332145d38"}]}
