Skip to content
This repository has been archived by the owner on Apr 15, 2021. It is now read-only.

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
shaowen310 committed Oct 24, 2020
1 parent d672357 commit 874e9fc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions partitionplan.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,12 @@ def move_master_to_partition(self, to_partition_id, user_id):
self._remove_master(user_id)
add_slave = self.u2p[user_id, to_partition_id] == self.SLAVE
self.u2p[user_id, to_partition_id] = self.MASTER
if add_slave == self.SLAVE:
self.u2p[user_id, to_partition_id] = self.MASTER
if add_slave:
pids = self.partition_ids_not_having_replica(user_id)
if len(pids) == 0:
print('No partition available to assign new slave for user {0}'.format(user_id))
return
pids[0] = self.SLAVE
self.u2p[user_id, pids[0]] = self.SLAVE

def find_master_in_partition(self, partition_id):
assert self.palloc[partition_id]
Expand Down

0 comments on commit 874e9fc

Please sign in to comment.