git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
* [PATCH/RFC] config: default to protocol v2
@ 2020-07-07  5:38 Jonathan Nieder
  2020-07-08  4:50 ` Jeff King
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Nieder @ 2020-07-07  5:38 UTC (permalink / raw)
  To: git; +Cc: Jeff King, Konstantin Ryabitsev, Taylor Blau

Git 2.26 used protocol v2 as its default protocol, but soon after
release, reports of edge-case regressions started rolling in.  So Git
2.27 returned to protocol v0 as a default (but with the various fixes
in place to make protocol v2 safe) and Git 2.28 will use protocol v0
as default but enable protocol v2 for those adventurous users that
enable experimental features by setting feature.experimental=true.

Thus if all goes well, by the time Git 2.29 is being released, we can
be confident in protocol v2 as a default again.  Make it the default.

This especially speeds up fetches from repositories with many refs,
such as https://chromium.googlesource.com/chromium/src.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
Mostly sending this to get the discussion started about what changes
we want before flipping the default.

Are there tests we can run?  Should we make the negotiation code more
similar?  Any other bits we'd want to change?

Thanks,
Jonathan

 Documentation/config/feature.txt  | 4 ----
 Documentation/config/protocol.txt | 3 +--
 protocol.c                        | 6 +-----
 3 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/Documentation/config/feature.txt b/Documentation/config/feature.txt
index 28c33602d52..4e3a5c0cebc 100644
--- a/Documentation/config/feature.txt
+++ b/Documentation/config/feature.txt
@@ -22,10 +22,6 @@ existing commit-graph file(s). Occasionally, these files will merge and the
 write may take longer. Having an updated commit-graph file helps performance
 of many Git commands, including `git merge-base`, `git push -f`, and
 `git log --graph`.
-+
-* `protocol.version=2` speeds up fetches from repositories with many refs by
-allowing the client to specify which refs to list before the server lists
-them.
 
 feature.manyFiles::
 	Enable config options that optimize for repos with many files in the
diff --git a/Documentation/config/protocol.txt b/Documentation/config/protocol.txt
index c46e9b3d00a..756591d77b0 100644
--- a/Documentation/config/protocol.txt
+++ b/Documentation/config/protocol.txt
@@ -48,8 +48,7 @@ protocol.version::
 	If set, clients will attempt to communicate with a server
 	using the specified protocol version.  If the server does
 	not support it, communication falls back to version 0.
-	If unset, the default is `0`, unless `feature.experimental`
-	is enabled, in which case the default is `2`.
+	If unset, the default is `2`.
 	Supported versions:
 +
 --
diff --git a/protocol.c b/protocol.c
index d1dd3424bba..803bef5c87e 100644
--- a/protocol.c
+++ b/protocol.c
@@ -17,7 +17,6 @@ static enum protocol_version parse_protocol_version(const char *value)
 enum protocol_version get_protocol_version_config(void)
 {
 	const char *value;
-	int val;
 	const char *git_test_k = "GIT_TEST_PROTOCOL_VERSION";
 	const char *git_test_v;
 
@@ -31,9 +30,6 @@ enum protocol_version get_protocol_version_config(void)
 		return version;
 	}
 
-	if (!git_config_get_bool("feature.experimental", &val) && val)
-		return protocol_v2;
-
 	git_test_v = getenv(git_test_k);
 	if (git_test_v && *git_test_v) {
 		enum protocol_version env = parse_protocol_version(git_test_v);
@@ -43,7 +39,7 @@ enum protocol_version get_protocol_version_config(void)
 		return env;
 	}
 
-	return protocol_v0;
+	return protocol_v2;
 }
 
 enum protocol_version determine_protocol_version_server(void)
-- 
2.27.0.383.g050319c2ae


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH/RFC] config: default to protocol v2
  2020-07-07  5:38 [PATCH/RFC] config: default to protocol v2 Jonathan Nieder
@ 2020-07-08  4:50 ` Jeff King
  2020-07-08 15:42   ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff King @ 2020-07-08  4:50 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: git, Konstantin Ryabitsev, Taylor Blau

On Mon, Jul 06, 2020 at 10:38:05PM -0700, Jonathan Nieder wrote:

> Git 2.26 used protocol v2 as its default protocol, but soon after
> release, reports of edge-case regressions started rolling in.  So Git
> 2.27 returned to protocol v0 as a default (but with the various fixes
> in place to make protocol v2 safe) and Git 2.28 will use protocol v0
> as default but enable protocol v2 for those adventurous users that
> enable experimental features by setting feature.experimental=true.
> 
> Thus if all goes well, by the time Git 2.29 is being released, we can
> be confident in protocol v2 as a default again.  Make it the default.
> 
> This especially speeds up fetches from repositories with many refs,
> such as https://chromium.googlesource.com/chromium/src.
> 
> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
> ---
> Mostly sending this to get the discussion started about what changes
> we want before flipping the default.

I can't actually think of any changes we'd want to make. AFAIK aside
from the negotiation problem, v2 is good to go. When we flipped it off
by default for 2.27 out of caution, I had hoped we would flip it back on
for the 2.28 cycle to get more exposure.

I guess it may be too late for that now if we wanted to get more testing
and exposure during the development cycle. But I'm not entirely
convinced that buys us anything anyway. v2 was available via a config
setting for at least a year, and major hosting sites supported it, and
still nobody noticed the negotiation problem until it was turned on by
default in 2.26.

And that has been the only bug people have reported for 2.26. That
implies to me that:

  - we won't get significantly more information by leaving v2-as-default
    in "next" or even "master" before it actually hits a release

  - there probably aren't other major problems lurking, given that
    people clearly upgraded to 2.26, found the negotiation problem, but
    never reported any other issues

-Peff

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH/RFC] config: default to protocol v2
  2020-07-08  4:50 ` Jeff King
@ 2020-07-08 15:42   ` Junio C Hamano
  2020-07-09 23:00     ` Jeff King
  0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2020-07-08 15:42 UTC (permalink / raw)
  To: Jeff King; +Cc: Jonathan Nieder, git, Konstantin Ryabitsev, Taylor Blau

Jeff King <peff@peff.net> writes:

>> Mostly sending this to get the discussion started about what changes
>> we want before flipping the default.
>
> I can't actually think of any changes we'd want to make. AFAIK aside
> from the negotiation problem, v2 is good to go. When we flipped it off
> by default for 2.27 out of caution, I had hoped we would flip it back on
> for the 2.28 cycle to get more exposure.

If there were any changes we already can think of before going
public with v2 at this moment, it makes it definitely way too late
to propose making it the default again.  I do not think of any
changes either, so I'd say it is a good sign ;-) 

> And that has been the only bug people have reported for 2.26. That
> implies to me that:
>
>   - we won't get significantly more information by leaving v2-as-default
>     in "next" or even "master" before it actually hits a release
>
>   - there probably aren't other major problems lurking, given that
>     people clearly upgraded to 2.26, found the negotiation problem, but
>     never reported any other issues

I've already said elsewhere that it is way too late to propose this
flipping back the default for this cycle but it was mainly out of
principle.  I do agree with you and Jonathan that we won't see any
further breakages in the v2 code until we expose more users to it by
making it the default in a released version.

I am afraid that "there probably aren't other" may be overly
optimistic, as the bug in 2.26 crippled the negotiation logic and
forced it to punt, which was so severe that it would have hidden any
other bugs in the negotiation logic.  If there is another bug in v2
negotiation logic that makes the sender to omit objects that should
be sent, it would not have been observed in 2.26 because the effect
of the more severe bug was to cripple the negotiation logic itself
and to make it punt, sending more objects all the way down the
history.  Now, with that larger bug fixed post 2.26, we can start to
see if there are other bugs hidden by it.

In any case, we've learned in 2.26 that it is unlikely that such
bugs would be uncovered until v2 is made the default again in a
released version to be used by more users.

So, let's flip the default in -rc0; we can revert if we see
something funny in 2.28.1 in the worst case.

Thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH/RFC] config: default to protocol v2
  2020-07-08 15:42   ` Junio C Hamano
@ 2020-07-09 23:00     ` Jeff King
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff King @ 2020-07-09 23:00 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jonathan Nieder, git, Konstantin Ryabitsev, Taylor Blau

On Wed, Jul 08, 2020 at 08:42:46AM -0700, Junio C Hamano wrote:

> I am afraid that "there probably aren't other" may be overly
> optimistic, as the bug in 2.26 crippled the negotiation logic and
> forced it to punt, which was so severe that it would have hidden any
> other bugs in the negotiation logic.  If there is another bug in v2
> negotiation logic that makes the sender to omit objects that should
> be sent, it would not have been observed in 2.26 because the effect
> of the more severe bug was to cripple the negotiation logic itself
> and to make it punt, sending more objects all the way down the
> history.  Now, with that larger bug fixed post 2.26, we can start to
> see if there are other bugs hidden by it.

I half-agree with this. The negotiation logic wasn't completely broken,
and usually did the right thing. It was only the max_in_vain counting
that was wrong. So definitely there could be another bug lurking that
was hidden by that failure, and/or our fix could be incomplete. But I
think we can have some confidence that there aren't other show-stopping
bugs (in the negotiation code or elsewhere in v2) that showed up in
other situations (and the real-world success reports we already got for
that particular bug are also encouraging).

So I'm not especially worried about having a repeat of the v2.26
situation (but I agree it's not impossible).

> In any case, we've learned in 2.26 that it is unlikely that such
> bugs would be uncovered until v2 is made the default again in a
> released version to be used by more users.
> 
> So, let's flip the default in -rc0; we can revert if we see
> something funny in 2.28.1 in the worst case.

And obviously I'm fine with this, given that my assessment of the risk
is even less than yours. :)

-Peff

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-07-09 23:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-07  5:38 [PATCH/RFC] config: default to protocol v2 Jonathan Nieder
2020-07-08  4:50 ` Jeff King
2020-07-08 15:42   ` Junio C Hamano
2020-07-09 23:00     ` Jeff King

Code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).