Changeset ec4f87a in trunk


Ignore:
Timestamp:
2010-09-27T20:01:02Z (15 years ago)
Author:
Kevan Carstensen <kevan@…>
Branches:
master
Children:
cb83f2e4
Parents:
83f807b
Message:

immutable/repairer.py: don't use the default happiness setting when repairing

Location:
src/allmydata
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/allmydata/immutable/repairer.py

    r83f807b rec4f87a  
    5858            k = vcap.needed_shares
    5959            N = vcap.total_shares
    60             happy = upload.BaseUploadable.default_encoding_param_happy
     60            # Per ticket #1212
     61            # (http://tahoe-lafs.org/trac/tahoe-lafs/ticket/1212)
     62            happy = 0
    6163            self._encodingparams = (k, happy, N, segsize)
    6264            ul = upload.CHKUploader(self._storage_broker, self._secret_holder)
  • TabularUnified src/allmydata/test/test_repairer.py

    r83f807b rec4f87a  
    517517        return d
    518518
     519    def test_repairer_servers_of_happiness(self):
     520        # The repairer is supposed to generate and place as many of the
     521        # missing shares as possible without caring about how they are
     522        # distributed.
     523        self.basedir = "repairer/Repairer/repairer_servers_of_happiness"
     524        self.set_up_grid(num_clients=2, num_servers=10)
     525        d = self.upload_and_stash()
     526        # Now delete some servers. We want to leave 3 servers, which
     527        # will allow us to restore the file to a healthy state without
     528        # distributing the shares widely enough to satisfy the default
     529        # happiness setting.
     530        def _delete_some_servers(ignored):
     531            for i in xrange(7):
     532                self.g.remove_server(self.g.servers_by_number[i].my_nodeid)
     533
     534            assert len(self.g.servers_by_number) == 3
     535
     536        d.addCallback(_delete_some_servers)
     537        # Now try to repair the file.
     538        d.addCallback(lambda ignored:
     539            self.c0_filenode.check_and_repair(Monitor(), verify=False))
     540        def _check_results(crr):
     541            self.failUnlessIsInstance(crr,
     542                                      check_results.CheckAndRepairResults)
     543            pre = crr.get_pre_repair_results()
     544            post = crr.get_post_repair_results()
     545            for p in (pre, post):
     546                self.failUnlessIsInstance(p, check_results.CheckResults)
     547
     548            self.failIf(pre.is_healthy())
     549            self.failUnless(post.is_healthy())
     550
     551        d.addCallback(_check_results)
     552        return d
     553
    519554    # why is test_repair_from_corruption_of_1 disabled? Read on:
    520555    #
Note: See TracChangeset for help on using the changeset viewer.