)]}'
{
  "commit": "c96f041041dffb7ecb79399610dacfb7daf4104e",
  "tree": "ae341e96d287d9acf31960985067d06742be2fcf",
  "parents": [
    "49b4eb8c39d2f326a2e10b9938bb43f78cb74db3"
  ],
  "author": {
    "name": "Luca Milanesio",
    "email": "luca.milanesio@gmail.com",
    "time": "Wed Dec 13 22:58:42 2023 +0000"
  },
  "committer": {
    "name": "Luca Milanesio",
    "email": "luca.milanesio@gmail.com",
    "time": "Wed Dec 20 18:55:40 2023 +0000"
  },
  "message": "Update the refs/multi-site/version/value once per batch-refupdate\n\nThe update of refs/multi-site/version/value on the global-refdb\nis a very expensive operation for two reasons:\n- The global-refdb is a remote system, potentially with a high\n  network latency\n- It needs to maintain global consistency across geographical areas\n  which would also include sever-side synchronisation\n\nReducing the number of updates on the global-refdb is paramount\nfor keeping an acceptable performance in Gerrit updates.\nWhen multiple updates happen in the same batch for Gerrit, it would\nnot make sense to update the global-refdb multiple times for the\nversion value because globally the batch represents a unit of work\nand performing it as a whole means updating the version of the\nrepository once.\n\nMove from individual stream-events to batch ref-update listener\nfor updating the refs/multi-site/version/value, so that multiple\nupdates would result in a single global-refdb update.\nNote that the batch ref-update listener is not a stream event\nand therefore the code does not need to check and test the\ninstance-id anymore because all the events received are always\nlocal.\n\nFor example, the upload of a new patch-set for a change was\npreviously generating four different updates on the global-refdb\nfor the refs/multi-site/version/value, whilst now there is only\none single update generated for the  whole batch.\n\nChange-Id: Ia6c7f5aa085a8e2770b40df34145bb937cf1772e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "5e70aca1e1b8c9ddbaad2f6b9b595c3b87dddbff",
      "old_mode": 33188,
      "old_path": "src/main/java/com/googlesource/gerrit/plugins/multisite/event/EventModule.java",
      "new_id": "8c67823f53444e6e50a15e044a9ac65e5125d1a6",
      "new_mode": 33188,
      "new_path": "src/main/java/com/googlesource/gerrit/plugins/multisite/event/EventModule.java"
    },
    {
      "type": "modify",
      "old_id": "3e73bf104135fd9d74f4a349dd1fbb7edd4f0d9c",
      "old_mode": 33188,
      "old_path": "src/main/java/com/googlesource/gerrit/plugins/multisite/validation/ProjectVersionRefUpdateImpl.java",
      "new_id": "150ea52b287d3cd2626afbd2da08ec78d7dc6ab1",
      "new_mode": 33188,
      "new_path": "src/main/java/com/googlesource/gerrit/plugins/multisite/validation/ProjectVersionRefUpdateImpl.java"
    },
    {
      "type": "modify",
      "old_id": "bceaa4f12eee5fb2f8f4786088e989fdbae5c758",
      "old_mode": 33188,
      "old_path": "src/test/java/com/googlesource/gerrit/plugins/multisite/validation/ProjectVersionRefUpdateTest.java",
      "new_id": "e2e3113313e3442f8b739aa79c208f02bacfe9e1",
      "new_mode": 33188,
      "new_path": "src/test/java/com/googlesource/gerrit/plugins/multisite/validation/ProjectVersionRefUpdateTest.java"
    }
  ]
}
