示例#1
0
 def check(self, verify=False, add_lease=False):
     servermap = ServerMap()
     u = ServermapUpdater(self._node, self._storage_broker, self._monitor,
                          servermap, MODE_CHECK, add_lease=add_lease)
     if self._history:
         self._history.notify_mapupdate(u.get_status())
     d = u.update()
     d.addCallback(self._got_mapupdate_results)
     if verify:
         d.addCallback(self._verify_all_shares)
     d.addCallback(lambda res: servermap)
     d.addCallback(self._fill_checker_results, self.results)
     d.addCallback(lambda res: self.results)
     return d
示例#2
0
 def check(self, verify=False, add_lease=False):
     servermap = ServerMap()
     # Updating the servermap in MODE_CHECK will stand a good chance
     # of finding all of the shares, and getting a good idea of
     # recoverability, etc, without verifying.
     u = ServermapUpdater(self._node, self._storage_broker, self._monitor,
                          servermap, self.SERVERMAP_MODE,
                          add_lease=add_lease)
     if self._history:
         self._history.notify_mapupdate(u.get_status())
     d = u.update()
     d.addCallback(self._got_mapupdate_results)
     if verify:
         d.addCallback(self._verify_all_shares)
     d.addCallback(lambda res: servermap)
     d.addCallback(self._make_checker_results)
     return d
示例#3
0
 def check(self, verify=False, add_lease=False):
     servermap = ServerMap()
     u = ServermapUpdater(self._node,
                          self._storage_broker,
                          self._monitor,
                          servermap,
                          MODE_CHECK,
                          add_lease=add_lease)
     if self._history:
         self._history.notify_mapupdate(u.get_status())
     d = u.update()
     d.addCallback(self._got_mapupdate_results)
     if verify:
         d.addCallback(self._verify_all_shares)
     d.addCallback(lambda res: servermap)
     d.addCallback(self._fill_checker_results, self.results)
     d.addCallback(lambda res: self.results)
     return d
示例#4
0
    def start(self, force=False):
        # download, then re-publish. If a server had a bad share, try to
        # replace it with a good one of the same shnum.

        # The normal repair operation should not be used to replace
        # application-specific merging of alternate versions: i.e if there
        # are multiple highest seqnums with different roothashes. In this
        # case, the application must use node.upload() (referencing the
        # servermap that indicates the multiple-heads condition), or
        # node.overwrite(). The repair() operation will refuse to run in
        # these conditions unless a force=True argument is provided. If
        # force=True is used, then the highest root hash will be reinforced.

        # Likewise, the presence of an unrecoverable latest version is an
        # unusual event, and should ideally be handled by retrying a couple
        # times (spaced out over hours or days) and hoping that new shares
        # will become available. If repair(force=True) is called, data will
        # be lost: a new seqnum will be generated with the same contents as
        # the most recent recoverable version, skipping over the lost
        # version. repair(force=False) will refuse to run in a situation like
        # this.

        # Repair is designed to fix the following injuries:
        #  missing shares: add new ones to get at least N distinct ones
        #  old shares: replace old shares with the latest version
        #  bogus shares (bad sigs): replace the bad one with a good one

        # first, update the servermap in MODE_REPAIR, which files all shares
        # and makes sure we get the privkey.
        u = ServermapUpdater(self.node, self._storage_broker, self._monitor,
                             ServerMap(), MODE_REPAIR)
        if self._history:
            self._history.notify_mapupdate(u.get_status())
        d = u.update()
        d.addCallback(self._got_full_servermap, force)
        return d
示例#5
0
    def start(self, force=False):
        # download, then re-publish. If a server had a bad share, try to
        # replace it with a good one of the same shnum.

        # The normal repair operation should not be used to replace
        # application-specific merging of alternate versions: i.e if there
        # are multiple highest seqnums with different roothashes. In this
        # case, the application must use node.upload() (referencing the
        # servermap that indicates the multiple-heads condition), or
        # node.overwrite(). The repair() operation will refuse to run in
        # these conditions unless a force=True argument is provided. If
        # force=True is used, then the highest root hash will be reinforced.

        # Likewise, the presence of an unrecoverable latest version is an
        # unusual event, and should ideally be handled by retrying a couple
        # times (spaced out over hours or days) and hoping that new shares
        # will become available. If repair(force=True) is called, data will
        # be lost: a new seqnum will be generated with the same contents as
        # the most recent recoverable version, skipping over the lost
        # version. repair(force=False) will refuse to run in a situation like
        # this.

        # Repair is designed to fix the following injuries:
        #  missing shares: add new ones to get at least N distinct ones
        #  old shares: replace old shares with the latest version
        #  bogus shares (bad sigs): replace the bad one with a good one

        # first, update the servermap in MODE_REPAIR, which files all shares
        # and makes sure we get the privkey.
        u = ServermapUpdater(self.node, self._storage_broker, self._monitor,
                             ServerMap(), MODE_REPAIR)
        if self._history:
            self._history.notify_mapupdate(u.get_status())
        d = u.update()
        d.addCallback(self._got_full_servermap, force)
        return d
示例#6
0
 def _update_servermap(self, servermap, mode):
     u = ServermapUpdater(self, self._storage_broker, Monitor(), servermap,
                          mode)
     if self._history:
         self._history.notify_mapupdate(u.get_status())
     return u.update()
示例#7
0
 def _update_servermap(self, servermap, mode):
     u = ServermapUpdater(self, self._storage_broker, Monitor(), servermap,
                          mode)
     if self._history:
         self._history.notify_mapupdate(u.get_status())
     return u.update()