Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

feat: add copy secondary for cluster balance #883

Merged
merged 2 commits into from
Aug 26, 2021

Conversation

levy5307
Copy link
Contributor

@levy5307 levy5307 commented Aug 26, 2021

Manual Test

  1. start onebox with 5 replica servers and 3 meta servers
 ./run.sh start_onebox -r 5 -m 3
  1. create several tables with 4 partitions, for example:
>>> create test1
create app test1 succeed, waiting for app ready
test1 not ready yet, still waiting... (0/4)
test1 not ready yet, still waiting... (2/4)
test1 not ready yet, still waiting... (2/4)
test1 not ready yet, still waiting... (2/4)
test1 not ready yet, still waiting... (2/4)
test1 not ready yet, still waiting... (2/4)
test1 is ready now: (4/4)
test1 is ready now!
create app "test1" succeed
  1. get information about load balance, and we can see the cluster is not balanced
>>> nodes -d
[details]
address              status    replica_count  primary_count  secondary_count
10.231.57.100:34801  ALIVE                28              9               19
10.231.57.100:34802  ALIVE                25              9               16
10.231.57.100:34803  ALIVE                28              8               20
10.231.57.100:34804  ALIVE                26              9               17
10.231.57.100:34805  ALIVE                25              9               16
  1. enable cluster load balance
http://127.0.0.1:34601/updateConfig?balance_cluster=true
  1. set meta_level to lively to enable load balance
>>> set_meta_level lively
control meta level ok, the old level is fl_steady
  1. get information about load balance, and now the cluster is balanced.
>>> nodes -d
[details]
address              status    replica_count  primary_count  secondary_count
10.231.57.100:34801  ALIVE                27              9               18
10.231.57.100:34802  ALIVE                26              9               17
10.231.57.100:34803  ALIVE                26              8               18
10.231.57.100:34804  ALIVE                27              9               18
10.231.57.100:34805  ALIVE                26              9               17

@@ -1012,7 +1012,8 @@ void greedy_load_balancer::balance_cluster()
return;
}

// TBD(zlw): copy primary
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is the last pull request for cluster load balance :)

@hycdong hycdong merged commit 73004eb into XiaoMi:master Aug 26, 2021
@levy5307 levy5307 deleted the copy-secondary branch August 26, 2021 06:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants