This is an archive of the discontinued Mercurial Phabricator instance.

narrow: only send the narrowspecs back if ACL in play
ClosedPublic

Authored by pulkit on Oct 10 2018, 10:49 AM.

Details

Summary

I am unable to think why we need to send narrowspecs back from the server. The
current state adds a 'narrow:spec' part to each changegroup which is generated
when narrow extension is enabled. So we are sending narrowspecs on pull also.

There is a problem with sending the narrowspecs the way we are doing it right
now. We add include and exclude as parameter of the 'narrow:spec' bundle2 part.
The the len of include or exclude string increase 255 which is obvious while
working on large repos, bundle2 generation code breaks. For more on that refer
issue5952 on bugzilla.

I was thinking why we need to send the narrowspecs back, and deleted the
'narrow:spec' bundle2 part generation code and found that only narrow-acl test
has some failure.

With this patch, we will only send the 'narrow:spec' bundle2 part if ACL is
enabled because the original narrowspecs in those cases can be a subset of
narrowspecs user requested.

There are phase related output change in couple of tests. The output change
shows that we are now dealing in public phases completely. So maybe sending the
narrow:spec bundle2 part was preventing phases being exchanged or phase bundle2
data being applied.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

pulkit created this revision.Oct 10 2018, 10:49 AM

@martinvonz Looks like this got missed for discussing in sprint, can you have a look at this please? This is important because once we have narrowspecs greater than 255 length and and don't use ellipses, we hit https://bz.mercurial-scm.org/show_bug.cgi?id=5952

In D4931#76476, @pulkit wrote:

@martinvonz Looks like this got missed for discussing in sprint, can you have a look at this please? This is important because once we have narrowspecs greater than 255 length and and don't use ellipses, we hit https://bz.mercurial-scm.org/show_bug.cgi?id=5952

Maybe we can instead require experimental.httppostargs to be on when using narrow?

In D4931#76476, @pulkit wrote:

@martinvonz Looks like this got missed for discussing in sprint, can you have a look at this please? This is important because once we have narrowspecs greater than 255 length and and don't use ellipses, we hit https://bz.mercurial-scm.org/show_bug.cgi?id=5952

Maybe we can instead require experimental.httppostargs to be on when using narrow?

The problem is the narrow specs are being transported as a bundle2 part parameter and those have a limit of 255 bytes. The narrow spec needs to be transported as a bundle2 part payload, which can be infinite length. (Or not transferred at all.)

In D4931#76476, @pulkit wrote:

@martinvonz Looks like this got missed for discussing in sprint, can you have a look at this please? This is important because once we have narrowspecs greater than 255 length and and don't use ellipses, we hit https://bz.mercurial-scm.org/show_bug.cgi?id=5952

Maybe we can instead require experimental.httppostargs to be on when using narrow?

The problem is the narrow specs are being transported as a bundle2 part parameter and those have a limit of 255 bytes. The narrow spec needs to be transported as a bundle2 part payload, which can be infinite length. (Or not transferred at all.)

Oh, I had completely forgotten that we sometimes send that back. This patch looks fine then, I just have one little suggestion.

hgext/narrow/narrowbundle2.py
273 ↗(On Diff #11774)

maybe this line belongs on exchange.py:1903?

pulkit updated this revision to Diff 12192.Oct 17 2018, 7:32 AM
martinvonz accepted this revision.Oct 17 2018, 6:28 PM
This revision is now accepted and ready to land.Oct 17 2018, 6:28 PM
This revision was automatically updated to reflect the committed changes.