)]}'
{
  "commit": "52327e0627f49dbda1e8db695e63a4b0af4448b1",
  "tree": "0b549b55a9f7ca29b2949cb7b3ef90a2733a0fef",
  "parents": [
    "e302ed6fc3ea48f2ccb5bc410d6306522d4f7497"
  ],
  "author": {
    "name": "Maxim Dounin",
    "email": "mdounin@mdounin.ru",
    "time": "Mon May 14 09:57:20 2012 +0000"
  },
  "committer": {
    "name": "Maxim Dounin",
    "email": "mdounin@mdounin.ru",
    "time": "Mon May 14 09:57:20 2012 +0000"
  },
  "message": "Upstream: smooth weighted round-robin balancing.\n\nFor edge case weights like { 5, 1, 1 } we now produce { a, a, b, a, c, a, a }\nsequence instead of { c, b, a, a, a, a, a } produced previously.\n\nAlgorithm is as follows: on each peer selection we increase current_weight\nof each eligible peer by its weight, select peer with greatest current_weight\nand reduce its current_weight by total number of weight points distributed\namong peers.\n\nIn case of { 5, 1, 1 } weights this gives the following sequence of\ncurrent_weight\u0027s:\n\n     a  b  c\n     0  0  0  (initial state)\n\n     5  1  1  (a selected)\n    -2  1  1\n\n     3  2  2  (a selected)\n    -4  2  2\n\n     1  3  3  (b selected)\n     1 -4  3\n\n     6 -3  4  (a selected)\n    -1 -3  4\n\n     4 -2  5  (c selected)\n     4 -2 -2\n\n     9 -1 -1  (a selected)\n     2 -1 -1\n\n     7  0  0  (a selected)\n     0  0  0\n\nTo preserve weight reduction in case of failures the effective_weight\nvariable was introduced, which usually matches peer\u0027s weight, but is\nreduced temporarily on peer failures.\n\nThis change also fixes loop with backup servers and proxy_next_upstream\nhttp_404 (ticket #47), and skipping alive upstreams in some cases if there\nare multiple dead ones (ticket #64).\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "f0fac87369927275e3ba169c6e71533836fbb40b",
      "old_mode": 33188,
      "old_path": "src/http/ngx_http_upstream_round_robin.c",
      "new_id": "6afe8bd71c809b3fcffcd0fb4662ab7734fd5520",
      "new_mode": 33188,
      "new_path": "src/http/ngx_http_upstream_round_robin.c"
    },
    {
      "type": "modify",
      "old_id": "4b70f2f5bac709f5200c1bd97794055cae207973",
      "old_mode": 33188,
      "old_path": "src/http/ngx_http_upstream_round_robin.h",
      "new_id": "4de3caea1b069f068f14212f788716e38e0032c4",
      "new_mode": 33188,
      "new_path": "src/http/ngx_http_upstream_round_robin.h"
    }
  ]
}
