'Completes a rebalancing transaction that was unsuccessful.'

def _Recover(self, transid):

    print ('Contacting    master    about    transaction    %s...' % transid),
    pool = None
    try:
        pool = urllib3.connectionpool.HTTPConnectionPool(self.addr, port=self.port)
    except urllib3.exceptions.MaxRetryError:
        print 'Unable    to    contact    master...'
        return
    print 'OK.'
    try:
        body = transid
        headers = {'Content-Length': len(body)}
        res = pool.urlopen('POST', '/rebalance/recover', headers=headers, body=body)
    except urllib3.exceptions.MaxRetryError:
        print 'Unable    to    contact    master...'
        return
    if (res.status == constants.RESPONSE_TRANSACTION_NOT_FOUND):
        print ('Transaction    %s    was    not    found' % transid)
        return
    if (res.status != constants.RESPONSE_OK):
        print 'Potential    data    master    error.    Giving    up...'
        return
    rebalance = rdf_data_server.DataServerRebalance.FromSerializedString(res.data)
    print ('Got    transaction    object    %s' % rebalance.id)
    answer = raw_input('Proceed    with    the    recover    process?    (y/n)    ')
    if (answer != 'y'):
        return
    body = rebalance.SerializeToString()
    headers = {'Content-Length': len(body)}
    try:
        res = pool.urlopen('POST', '/rebalance/commit', headers=headers, body=body)
    except urllib3.exceptions.MaxRetryError:
        print ('Could    not    commit    re-sharding    transaction    with    id    %s' % rebalance.id)
        print 'Make    sure    the    data    servers    are    up    and    then    run:'
        print ("'recover    %s'    in    order    to    re-run    transaction" % rebalance.id)
        return
    if (res.status != constants.RESPONSE_OK):
        print ('Could    not    commit    transaction    %s' % rebalance.id)
        print 'Make    sure    the    data    servers    are    up    and    then    run:'
        print ("'recover    %s'    in    order    to    re-run    transaction" % rebalance.id)
        return
    self.mapping = rdf_data_server.DataServerMapping.FromSerializedString(res.data)
    print ('Rebalance    with    id    %s    fully    performed.' % rebalance.id)
