Skip to content

Commit edf25d3

Browse files
authored
migrate check (#33)
1 parent d7aca3c commit edf25d3

File tree

6 files changed

+20
-97
lines changed

6 files changed

+20
-97
lines changed

_cmd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ def __init__(self):
352352
self.parser.add_option('-c', '--config', type='string', help="Path to the configuration yaml file.")
353353
self.parser.add_option('-f', '--force', action='store_true', help="Force deploy, overwrite the home_path.", default=False)
354354
self.parser.add_option('-U', '--unuselibrepo', '--ulp', action='store_true', help="Disable OBD from installing the libs mirror automatically.")
355-
self.parser.add_option('-A', '--auto-create-tenant', '--act', action='store_false', help="Disable OBD from creating a tenant named `test` by using all the available resource of the cluster.")
355+
self.parser.add_option('-A', '--auto-create-tenant', '--act', action='store_true', help="Disable OBD from creating a tenant named `test` by using all the available resource of the cluster.")
356356
# self.parser.add_option('-F', '--fuzzymatch', action='store_true', help="enable fuzzy match when search package")
357357

358358
def _do_command(self, obd):

plugins/mysqltest/3.1.0/init_sql/init_tenant.sql

Lines changed: 0 additions & 7 deletions
This file was deleted.

plugins/mysqltest/3.1.0/init_sql/init_tpch.sql

Lines changed: 0 additions & 46 deletions
This file was deleted.

plugins/mysqltest/3.1.0/init_sql/init_user_oracle.sql

Lines changed: 0 additions & 27 deletions
This file was deleted.

plugins/mysqltest/3.1.0/r/oracle/chinese.result

Lines changed: 0 additions & 16 deletions
This file was deleted.

plugins/oceanbase/3.1.0/create_tenant.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323

2424
import re
25+
import time
2526

2627

2728
def parse_size(size):
@@ -108,6 +109,24 @@ def exception(*arg, **kwargs):
108109
if unit_num > min_unit_num:
109110
return error('resource pool unit num is bigger than zone server count')
110111

112+
sql = "select count(*) num from oceanbase.__all_server where status = 'active' and start_service_time > 0"
113+
try:
114+
count = 30
115+
while count:
116+
stdio.verbose('execute sql: %s' % sql)
117+
cursor.execute(sql)
118+
num = cursor.fetchone()['num']
119+
if num >= unit_num:
120+
break
121+
count -= 1
122+
time.sleep(1)
123+
if count == 0:
124+
stdio.error('server can not migrate in')
125+
return
126+
except:
127+
exception('execute sql exception: %s' % sql)
128+
return
129+
111130
cpu_total = 0
112131
mem_total = 0
113132
disk_total = 0

0 commit comments

Comments
 (0)