diff --git a/main/lib/idds/orm/base/alembic/versions/53d0af715dab_add_site_throttler.py b/main/lib/idds/orm/base/alembic/versions/53d0af715dab_add_site_throttler.py index 6adc4274..a7ff48a8 100644 --- a/main/lib/idds/orm/base/alembic/versions/53d0af715dab_add_site_throttler.py +++ b/main/lib/idds/orm/base/alembic/versions/53d0af715dab_add_site_throttler.py @@ -49,6 +49,14 @@ def upgrade() -> None: op.add_column('messages', sa.Column('fetching_id', sa.Integer()), schema=schema) + try: + op.drop_constraint('THROTTLER_SITE_UQ', table_name='throttlers', schema=schema) + except: + pass + try: + op.drop_constraint('THROTTLER_PK', table_name='throttlers', schema=schema) + except: + pass op.create_table('throttlers', sa.Column('throttler_id', sa.BigInteger(), sa.Sequence('THROTTLER_ID_SEQ', schema=schema)), sa.Column('site', sa.String(50), nullable=False), @@ -61,6 +69,7 @@ def upgrade() -> None: sa.Column("created_at", sa.DateTime, default=datetime.datetime.utcnow, nullable=False), sa.Column("updated_at", sa.DateTime, default=datetime.datetime.utcnow, onupdate=datetime.datetime.utcnow, nullable=False), sa.Column('others', JSON()), + replace_existing=True, schema=schema) op.create_primary_key('THROTTLER_PK', 'throttlers', ['throttler_id'], schema=schema) op.create_unique_constraint('THROTTLER_SITE_UQ', 'throttlers', ['site'], schema=schema) diff --git a/main/lib/idds/orm/base/alembic/versions/b0ec813021d6_add_sub_map_id.py b/main/lib/idds/orm/base/alembic/versions/b0ec813021d6_add_sub_map_id.py index 470b571e..d28c57cf 100644 --- a/main/lib/idds/orm/base/alembic/versions/b0ec813021d6_add_sub_map_id.py +++ b/main/lib/idds/orm/base/alembic/versions/b0ec813021d6_add_sub_map_id.py @@ -32,7 +32,10 @@ def upgrade() -> None: schema = context.get_context().version_table_schema if context.get_context().version_table_schema else '' op.add_column('contents', sa.Column('sub_map_id', sa.BigInteger()), schema=schema) op.add_column('contents', sa.Column('dep_sub_map_id', sa.BigInteger()), schema=schema) - op.drop_constraint(constraint_name="CONTENT_ID_UQ", table_name="contents", schema=schema) + try: + op.drop_constraint(constraint_name="CONTENT_ID_UQ", table_name="contents", schema=schema) + except Exception as ex: + print(ex) op.create_unique_constraint('CONTENT_ID_UQ', 'contents', ['transform_id', 'coll_id', 'map_id', 'sub_map_id', 'dep_sub_map_id', 'content_relation_type', 'name', 'min_id', 'max_id'], schema=schema) diff --git a/main/lib/idds/tests/panda_test.py b/main/lib/idds/tests/panda_test.py index e6ec7f68..708ce07a 100644 --- a/main/lib/idds/tests/panda_test.py +++ b/main/lib/idds/tests/panda_test.py @@ -17,8 +17,8 @@ task_ids = [] for task_id in task_ids: print("retry %s" % task_id) - ret = Client.retryTask(task_id, verbose=True) - print(ret) + # ret = Client.retryTask(task_id, verbose=True) + # print(ret) # sys.exit(0) @@ -27,6 +27,10 @@ task_ids = [161488, 154806, 154805, 153413] task_ids = [i for i in range(191, 220)] task_ids = [162763, 162753] +task_ids = [i for i in range(164147, 164384)] +task_ids += [162282, 162283, 162588] +task_ids = [i for i in range(163930, 164147)] +task_ids = [161142, 160648] for task_id in task_ids: print("Killing %s" % task_id) ret = Client.killTask(task_id, verbose=True)