)]}'
{"swift/common/db_replicator.py":[{"author":{"_account_id":6968,"name":"Christian Schwede","email":"cschwede@nvidia.com","username":"cschwede"},"change_message_id":"f026b283347977adfe71208cd16b8a8951feef86","unresolved":false,"context_lines":[{"line_number":229,"context_line":"             \u0027replication_last\u0027: now},"},{"line_number":230,"context_line":"            self.rcache, self.logger)"},{"line_number":231,"context_line":"        self.logger.info(\u0027 \u0027.join([\u0027%s:%s\u0027 % item for item in"},{"line_number":232,"context_line":"                         sorted(self.stats.items()) if item[0] in"},{"line_number":233,"context_line":"                         (\u0027no_change\u0027, \u0027hashmatch\u0027, \u0027rsync\u0027, \u0027diff\u0027, \u0027ts_repl\u0027,"},{"line_number":234,"context_line":"                          \u0027empty\u0027, \u0027diff_capped\u0027, \u0027remote_merge\u0027)]))"},{"line_number":235,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5ff73747_d16cfd37","line":232,"updated":"2017-04-25 08:46:57.000000000","message":"I like to have an explicit order, but this might break some logparsing tools - might need an UpgradeImpact flag therefore? There is still an order of elements today, because of Pythons internal hashing of keys, IIRC. Right now a log line looks like this:\n\n no_change:0 ts_repl:0 diff:0 rsync:0 diff_capped:0 hashmatch:0 empty:0\n\nBut it will be:\n\n diff:0 diff_capped:0 empty:0 hashmatch:0 no_change:0 remote_merge:0 rsync:0 ts_repl:0\n\nWDYT?","commit_id":"8e59dfbee2a67f84a1fd1d5cc1679ec514255fdc"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"39aa3b1dea25cb006ef03e87786b905a4050049f","unresolved":false,"context_lines":[{"line_number":229,"context_line":"             \u0027replication_last\u0027: now},"},{"line_number":230,"context_line":"            self.rcache, self.logger)"},{"line_number":231,"context_line":"        self.logger.info(\u0027 \u0027.join([\u0027%s:%s\u0027 % item for item in"},{"line_number":232,"context_line":"                         sorted(self.stats.items()) if item[0] in"},{"line_number":233,"context_line":"                         (\u0027no_change\u0027, \u0027hashmatch\u0027, \u0027rsync\u0027, \u0027diff\u0027, \u0027ts_repl\u0027,"},{"line_number":234,"context_line":"                          \u0027empty\u0027, \u0027diff_capped\u0027, \u0027remote_merge\u0027)]))"},{"line_number":235,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3f044301_022307aa","line":232,"in_reply_to":"5ff73747_d16cfd37","updated":"2017-05-08 18:13:08.000000000","message":"There\u0027s an order, but it\u0027s not predictable or even necessarily consistent. See https://docs.python.org/2/using/cmdline.html#envvar-PYTHONHASHSEED\n\nRunning locally just now, I see it defaults to zero, but I wouldn\u0027t be surprised to find people running Swift with `random`:\n\n (Python27) $ python -c \u0027print(hash(\"test\"))\u0027\n 2314058222102390712\n\n (Python27) $ python -c \u0027print(hash(\"test\"))\u0027\n 2314058222102390712\n\n (Python27) $ PYTHONHASHSEED\u003drandom python -c \u0027print(hash(\"test\"))\u0027\n -130859885439387835\n\n (Python27) $ PYTHONHASHSEED\u003drandom python -c \u0027print(hash(\"test\"))\u0027\n -7613664937915224722\n\n (Python27) $ PYTHONHASHSEED\u003d0 python -c \u0027print(hash(\"test\"))\u0027\n 2314058222102390712\n\nI think the moral of the story is that if you\u0027re going to parse this unstructured log output, you\u0027re going to need to do something like\n\n stats \u003d {k: int(v) for k, v in (\n     word.split(\u0027:\u0027) for word in log_line.split())}\n\nI think prefer breaking a log parser (and forcing them to parse *any* order correctly) and *enforcing* an order over having each omission/addendum result in something like\n\n log_line \u003d \u0027 \u0027.join(\n     \u0027 \u0027.join(\u0027%s:%s\u0027 % item for item in collection)\n     for collection in (\n         (\u0027no_change\u0027, \u0027hashmatch\u0027, \u0027rsync\u0027, \u0027diff\u0027, \u0027ts_repl\u0027,\n          \u0027empty\u0027, \u0027diff_capped\u0027),\n         (\u0027remote_merge\u0027,),\n     ))\n self.logger.info(log_line)\n\n...but maybe that\u0027s just me? I mean, we certainly don\u0027t have any tests that prevent us from breaking the current ordering today.","commit_id":"8e59dfbee2a67f84a1fd1d5cc1679ec514255fdc"}]}
