)]}'
{"swift/obj/replicator.py":[{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"58b16436d105dd5bf10ff184f8485cf54494e77c","unresolved":false,"context_lines":[{"line_number":608,"context_line":"                                _(\u0027Skipped %s because policy index %s\u0027"},{"line_number":609,"context_line":"                                  \u0027 is not defined in the conf file\u0027)"},{"line_number":610,"context_line":"                                % (os.path.join(devpath, objectsdir),"},{"line_number":611,"context_line":"                                   policy_idx))"},{"line_number":612,"context_line":"        except (Exception, Timeout):"},{"line_number":613,"context_line":"            self.logger.exception(_(\"Exception in top-level replication loop\"))"},{"line_number":614,"context_line":"            self.kill_coros()"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a80dd14_ccdff1d4","line":611,"updated":"2015-03-13 02:19:25.000000000","message":"Rather then looping through everything again, I wonder if it\u0027s worth merging this loop with that of collect_jobs?\n\nSomething like: \n\n  def collect_jobs(self, override_devices\u003dNone, override_partitions\u003dNone,\n                       override_policies\u003dNone):\n          \"\"\"\n          Returns a sorted list of jobs (dictionaries) that specify the\n          partitions, nodes, etc to be rsynced.\n\n          :param override_devices: if set, only jobs on these devices\n              will be returned\n          :param override_partitions: if set, only jobs on these partitions\n              will be returned\n          :param override_policies: if set, only jobs in these storage\n              policies will be returned\n          \"\"\"\n          jobs \u003d []\n          ips \u003d whataremyips()\n          # Check if a replicator sought all object directories. If no,\n          # there are some mismatches between directories and swift.conf.\n          # This check is useful for detecting config mismatches among\n          # servers or other unexpected situations.\n          for dev in os.listdir(self.devices_dir):\n              devpath \u003d os.path.join(self.devices_dir, dev)\n              for objectsdir in os.listdir(devpath):\n                  if objectsdir.startswith(\u0027objects\u0027):\n                      if \u0027-\u0027 in objectsdir:\n                          policy_idx \u003d objectsdir.split(\u0027-\u0027, 1)[1]\n                      else:\n                          policy_idx \u003d \u00270\u0027\n                      policy \u003d POLICIES.get_by_index(policy_idx)\n                      if policy and not (override_policies is not None\n                              and and str(policy.idx) not in override_policies):\n                          # may need to branch here for future policy types\n                          jobs +\u003d self.process_repl(\n                              policy, ips,\n                              override_devices\u003doverride_devices,\n                              override_partitions\u003doverride_partitions)\n                      else:\n                          self.logger.warn(\n                              _(\u0027Skipped %s because policy index %s\u0027\n                                \u0027 is not defined in the conf file\u0027)\n                              % (os.path.join(devpath, objectsdir),\n                                 policy_idx))\n             \n          random.shuffle(jobs)\n          if self.handoffs_first:\n              # Move the handoff parts to the front of the list\n              jobs.sort(key\u003dlambda job: not job[\u0027delete\u0027])\n          self.job_count \u003d len(jobs)\n          return jobs\n\nNOTE: the above hasn\u0027t been tested, just merged in my head :P\n\nThis way, we loop through once, potentially adding more iterations to the loop if there are additional object dirs then policies, but not looping through twice everytime just to check for warnings.","commit_id":"378340f69e812f518b2e6cdf6cc0818fe6326e93"},{"author":{"_account_id":8859,"name":"Daisuke Morita","email":"morita.daisuke@ntti3.com","username":"morrisson"},"change_message_id":"762a1fc81b0442fad4933d7ee982e2adc0f0baca","unresolved":false,"context_lines":[{"line_number":608,"context_line":"                                _(\u0027Skipped %s because policy index %s\u0027"},{"line_number":609,"context_line":"                                  \u0027 is not defined in the conf file\u0027)"},{"line_number":610,"context_line":"                                % (os.path.join(devpath, objectsdir),"},{"line_number":611,"context_line":"                                   policy_idx))"},{"line_number":612,"context_line":"        except (Exception, Timeout):"},{"line_number":613,"context_line":"            self.logger.exception(_(\"Exception in top-level replication loop\"))"},{"line_number":614,"context_line":"            self.kill_coros()"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a80dd14_b71759ed","line":611,"in_reply_to":"9a80dd14_ccdff1d4","updated":"2015-03-13 09:22:58.000000000","message":"Thanks, Matt!\n\nThis is the very first patch of mine https://review.openstack.org/#/c/141252/4/swift/obj/replicator.py .\n\nAs you said, it seems stupid to add another loop just for the purpose of logging. However, paul commented for the above patch that replicator is policy-specific and collect_jobs are modified by some EC patches so my original patch makes it difficult to be merged with them (so, -2\u0027d).\n\nTherefore, I think adding another loop is better solution in this situation. You can see that this is redundant process but it needs only a short time to check the mismatch.","commit_id":"378340f69e812f518b2e6cdf6cc0818fe6326e93"}],"test/unit/obj/test_replicator.py":[{"author":{"_account_id":14271,"name":"Kallebe Monteiro","email":"kallebe.monteiro@lsbd.ufc.br","username":"kallebe"},"change_message_id":"fafdbc9c67744cfe957785d21f36ade34d17fa0f","unresolved":false,"context_lines":[{"line_number":394,"context_line":""},{"line_number":395,"context_line":"    def test_replicator_with_unconfigured_policy(self):"},{"line_number":396,"context_line":"        objects_999 \u003d os.path.join("},{"line_number":397,"context_line":"            self.devices, \u0027sda\u0027, diskfile.get_data_dir(999, conf_check\u003dFalse))"},{"line_number":398,"context_line":"        os.mkdir(objects_999)"},{"line_number":399,"context_line":"        # Run a replicate method without object-999 ring"},{"line_number":400,"context_line":"        self.replicator.replicate()"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a80dd14_43679eb7","line":397,"updated":"2015-03-11 17:24:40.000000000","message":"From the results of the test, the problem seems to be with this conf_check keyword parameter.\nThere is no parameter like this in swift.\nget_data_dir is defined as a partial function (https://github.com/openstack/swift/blob/master/swift/obj/diskfile.py#L81) for get_policy_string which has the parameters \"base\" and \"policy_index\"","commit_id":"277e8bff3b25079a3c6633d978a08e2bd92ac4f9"},{"author":{"_account_id":8859,"name":"Daisuke Morita","email":"morita.daisuke@ntti3.com","username":"morrisson"},"change_message_id":"00c14cd8c7f49183f2c67fa885d5d2acdfc29cfe","unresolved":false,"context_lines":[{"line_number":394,"context_line":""},{"line_number":395,"context_line":"    def test_replicator_with_unconfigured_policy(self):"},{"line_number":396,"context_line":"        objects_999 \u003d os.path.join("},{"line_number":397,"context_line":"            self.devices, \u0027sda\u0027, diskfile.get_data_dir(999, conf_check\u003dFalse))"},{"line_number":398,"context_line":"        os.mkdir(objects_999)"},{"line_number":399,"context_line":"        # Run a replicate method without object-999 ring"},{"line_number":400,"context_line":"        self.replicator.replicate()"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a80dd14_d75ec3e8","line":397,"in_reply_to":"9a80dd14_43679eb7","updated":"2015-03-12 11:09:00.000000000","message":"Thx.","commit_id":"277e8bff3b25079a3c6633d978a08e2bd92ac4f9"}]}
