Changeset 13b5e44 in trunk


Ignore:
Timestamp:
2010-07-19T07:54:26Z (15 years ago)
Author:
Zooko O'Whielacronx <zooko@…>
Branches:
master
Children:
255c545
Parents:
461f9464
Message:

immutable: fix bug in which preexisting_shares and merged were shallowly referencing the same sets
This bug had the effect of making uploads sometimes (rarely) appear to succeed when they had actually not distributed the shares well enough to achieve the desired servers-of-happiness level.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/allmydata/util/happinessutil.py

    r461f9464 r13b5e44  
    33reporting it in messages
    44"""
     5
     6from copy import deepcopy
    57
    68def failure_message(peer_count, k, happy, effective_happy):
     
    6163    set of PeerTrackers, returning the resulting dict.
    6264    """
     65    # Since we mutate servermap, and are called outside of a
     66    # context where it is okay to do that, make a copy of servermap and
     67    # work with it.
     68    servermap = deepcopy(servermap)
    6369    if not used_peers:
    6470        return servermap
     
    6773    assert(isinstance(used_peers, set))
    6874
    69     # Since we mutate servermap, and are called outside of a
    70     # context where it is okay to do that, make a copy of servermap and
    71     # work with it.
    72     servermap = servermap.copy()
    7375    for peer in used_peers:
    7476        for shnum in peer.buckets:
Note: See TracChangeset for help on using the changeset viewer.