Cache advertised bases used during push over smart HTTP
If a branch head is updated between the initial /info/refs request
made by a client and when the /receive-pack POST is made with the new
objects, and branch level access is enabled, the client might not be
allowed to use a delta base because the branch head no longer points
directly at the base that was previously advertised to the client.
Cache the list of objects that were advertised, and ensure all of
of them are included as potential base candidates when the pack is
received as part of the POST body.
Change-Id: Idf8b3bd75c0ee87cf8b23236cad15bdc0ca4c6a0
Signed-off-by: Shawn O. Pearce <sop@google.com>
diff --git a/Documentation/config-gerrit.txt b/Documentation/config-gerrit.txt
index 2fbe58c..5b6204a 100644
--- a/Documentation/config-gerrit.txt
+++ b/Documentation/config-gerrit.txt
@@ -262,6 +262,7 @@
+
Default is `90 days` for most caches, except:
+
+* `"adv_bases"`: default is `10 minutes`
* `"ldap_groups"`: default is `1 hour`
* `"web_sessions"`: default is `12 hours`
@@ -272,6 +273,7 @@
+
Default is 1024 for most caches, except:
+
+* `"adv_bases"`: default is `4096`
* `"diff"`: default is `128`
[[cache.name.diskLimit]]cache.<name>.diskLimit::
@@ -319,6 +321,14 @@
from the `account_external_ids` database table. If updates are
made to this table, this cache should be flushed.
+cache `"adv_bases"`::
++
+Used only for push over smart HTTP when branch level access controls
+are enabled. The cache entry contains all commits that are avaliable
+for the client to use as potential delta bases. Push over smart HTTP
+requires two HTTP requests, and this cache tries to carry state from
+the first request into the second to ensure it can complete.
+
cache `"diff"`::
+
Each item caches the differences between two commits, at both the