comparison hgext/clonebundles.py @ 27738:a0e783d26e81

exchange: make clone bundles non-experimental and enabled by default The clone bundles feature was introduced in Mercurial 3.6 behind an experimental and disabled by default flag. The feature has been enabled on hg.mozilla.org for a few months and has served many terabytes of clones. Users have been encouraged to use the feature and reception has been very positive (mainly due to faster clones as a result of connecting to a CDN). I have heard no feedback about changing the feature other than inquiries about when it will be enabled by default. So, I think the feature is ready to be enabled by default. This patch renames experimental.clonebundles to ui.clonebundles, documents the option, and enables it by default. References to the experimental state of clone bundles have been removed. The remaining config option docs in clonebundles.py have been removed because they are redudant with `hg help config`. There are some oddities with behavior of clone bundles. Because clones with clone bundles are effectively 2 `hg pull` operations, there may be 2 transactions. This could result in hooks running twice. If the subsequent pull is aborted, it could result in partial rollback and an incomplete clone. This behavior is a bit wonky and should probably be documented. If this patch is accepted, I'll send a follow-up to document it. I don't think this behavior should prevent the feature being enabled by default. Reworking the clone mechanism to support interrupted or multi-part clones feels like a major new feature and something that when implemented can change the hook and rollback semantics of clone bundles. Besides, partial clone is better than full rollback and hooks running on initial clone are likely rare, so I think the impact is minimal.
author Gregory Szorc <gregory.szorc@gmail.com>
date Fri, 08 Jan 2016 10:58:04 -0800
parents 482eb357fe98
children 0288e63ea3be
comparison
equal deleted inserted replaced
27737:482eb357fe98 27738:a0e783d26e81
1 # This software may be used and distributed according to the terms of the 1 # This software may be used and distributed according to the terms of the
2 # GNU General Public License version 2 or any later version. 2 # GNU General Public License version 2 or any later version.
3 3
4 """advertise pre-generated bundles to seed clones (experimental) 4 """advertise pre-generated bundles to seed clones
5 5
6 "clonebundles" is a server-side extension used to advertise the existence 6 "clonebundles" is a server-side extension used to advertise the existence
7 of pre-generated, externally hosted bundle files to clients that are 7 of pre-generated, externally hosted bundle files to clients that are
8 cloning so that cloning can be faster, more reliable, and require less 8 cloning so that cloning can be faster, more reliable, and require less
9 resources on the server. 9 resources on the server.
158 down, so does the ability for clients to clone. Note: clients will see a 158 down, so does the ability for clients to clone. Note: clients will see a
159 message informing them how to bypass the clone bundles facility when a failure 159 message informing them how to bypass the clone bundles facility when a failure
160 occurs. So server operators should prepare for some people to follow these 160 occurs. So server operators should prepare for some people to follow these
161 instructions when a failure occurs, thus driving more load to the original 161 instructions when a failure occurs, thus driving more load to the original
162 Mercurial server when the bundle hosting service fails. 162 Mercurial server when the bundle hosting service fails.
163
164 The following config options influence the behavior of the clone bundles
165 feature:
166
167 ui.clonebundlefallback
168 Whether to automatically fall back to a traditional clone in case of
169 clone bundles failure. Defaults to false for reasons described above.
170
171 experimental.clonebundles
172 Whether the clone bundles feature is enabled on clients. Defaults to true.
173 """ 163 """
174 164
175 from mercurial import ( 165 from mercurial import (
176 extensions, 166 extensions,
177 wireproto, 167 wireproto,