Merge lp:~spiv/bzr/redundant-missing-keys-check into lp:bzr
| Status: | Merged |
|---|---|
| Approved by: | John A Meinel on 2010-12-14 |
| Approved revision: | 5568 |
| Merged at revision: | 5569 |
| Proposed branch: | lp:~spiv/bzr/redundant-missing-keys-check |
| Merge into: | lp:bzr |
| Diff against target: |
75 lines (+9/-16) 4 files modified
bzrlib/fetch.py (+0/-15) bzrlib/tests/blackbox/test_push.py (+1/-1) doc/en/release-notes/bzr-2.3.txt (+5/-0) doc/en/whats-new/whats-new-in-2.3.txt (+3/-0) |
| To merge this branch: | bzr merge lp:~spiv/bzr/redundant-missing-keys-check |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| John A Meinel | 2010-12-14 | Approve on 2010-12-14 | |
|
Review via email:
|
|||
Commit Message
Remove redundant parent inventories calculation during fetch.
Description of the Change
This removes a parent inventories calculation from fetch.py. The reasons why I am confident this is safe are:
* repo.insert_stream already performs this calculation to generate the "missing_keys" set it returns, and RepoFetcher.
* it was only called for repositories with fallbacks, so there's no way that old formats with could be affected, so there's no risk to strange corner cases involving e.g. insert_stream on a knit repo.
* when there are missing keys, a send insert_stream is performed, and the missing_keys result from that second call is asserted to be empty as a sanity check — yet that sanity check never calls self._parent_
* by inspection, the parent inventories logic in insert_stream is identical (in fact, stricter: it performs the calculation if the repo supports stacking, even if it isn't stacked).
* all the tests pass as is, except for one HPSS acceptance test, which improves by one round trip :)
As a result of deleting this redundant code the push-to-stacked HPSS ratchet tightens by 1 call: it removes a get_parent_map call that used to happen immediately after an insert_stream call.
I added a What's New entry that covers both this and the "Branch.lock_read caches tags" improvement made earlier in the 2.3 cycle.
| Andrew Bennetts (spiv) wrote : | # |
sent to pqm by email

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 12/14/2010 3:38 AM, Andrew Bennetts wrote: _parent_ inventories was adding to that same set. inventories. So this code was already trusting insert_stream to be sufficient.
> Andrew Bennetts has proposed merging lp:~spiv/bzr/redundant-missing-keys-check into lp:bzr.
>
> Requested reviews:
> bzr-core (bzr-core)
>
>
> This removes a parent inventories calculation from fetch.py. The reasons why I am confident this is safe are:
>
> * repo.insert_stream already performs this calculation to generate the "missing_keys" set it returns, and RepoFetcher.
> * it was only called for repositories with fallbacks, so there's no way that old formats with could be affected, so there's no risk to strange corner cases involving e.g. insert_stream on a knit repo.
> * when there are missing keys, a send insert_stream is performed, and the missing_keys result from that second call is asserted to be empty as a sanity check — yet that sanity check never calls self._parent_
> * by inspection, the parent inventories logic in insert_stream is identical (in fact, stricter: it performs the calculation if the repo supports stacking, even if it isn't stacked).
> * all the tests pass as is, except for one HPSS acceptance test, which improves by one round trip :)
>
> As a result of deleting this redundant code the push-to-stacked HPSS ratchet tightens by 1 call: it removes a get_parent_map call that used to happen immediately after an insert_stream call.
>
> I added a What's New entry that covers both this and the "Branch.lock_read caches tags" improvement made earlier in the 2.3 cycle.
=== modified file 'bzrlib/fetch.py'
pb. update( "Inserting stream")
resume_ tokens, missing_keys = self.sink. insert_ stream(
stream, from_format, []) repository. _fallback_ repositories: keys.update( inventories( search. get_keys( )))
pb.update( "Missing keys")
stream = source. get_stream_ for_missing_ keys(missing_ keys)
- --- bzrlib/fetch.py 2010-09-17 04:35:23 +0000
+++ bzrlib/fetch.py 2010-12-14 09:38:10 +0000
@@ -125,9 +125,6 @@
- - if self.to_
- - missing_
- - self._parent_
if missing_keys:
^- IIRC, this was added because we *weren't* sending missing keys
properly in the stream. So when we fixed it, we had both the client and
the server double check for extra missing keys.
I'm not positive that this is the fix, but in bzr-1.14.txt: ntFactory' object has no attribute 'get_bytes_as'" errors
* Pushing a new stacked branch will also push the parent inventories for
revisions at the stacking boundary. This makes sure that the stacked
branch has enough data to calculate inventory deltas for all of its
revisions (without requiring the fallback branch). This avoids
"'AbsentConte
when fetching the stacked branch from a 1.13 (or later) smart server.
This partially fixes #354036. (Andrew Bennetts, Robert Collins)
So we've only really had the bug in 1.6/1.9/1.14 era repos. It doesn't
look like it has been a problem for 2a repos.
I'm not as worried about maintaining strict workarounds for bzr-1.13 vs
not...