Description:
When tried to destroy a group, right after removing all servers, observed following error (force option doesnt work either):
mysqlfabric group destroy my_group1 FORCE
Procedure :
{ uuid = f600e224-f2dc-4051-93a6-f4e0d3541e97,
finished = True,
success = False,
return = DatabaseError: ("Command (DELETE FROM groups WHERE group_id = %s, ('my_group1',)) failed: 1451 (23000): Cannot delete or update a parent row: a foreign key constraint fails (`fabric`.`shards`, CONSTRAINT `fk_shards_group_id` FOREIGN KEY (`group_id`) REFERENCES `groups` (`group_id`))", 1451),
activities =
}
~
~
How to repeat:
Steps:
1)Create an HA group containing 3 servers.
bash-4.1$ mysqlfabric group check_group_availability my_group1
Command :
{ success = True
return = {'857026ae-98f6-11e3-a84e-00144f0f7e1e': {'is_master': True, 'status': 'PRIMARY', 'is_alive': True, 'threads': {}}, '84753261-98f6-11e3-a84e-00144f0f7e1e': {'is_master': False, 'status': 'SECONDARY', 'is_alive': True, 'threads': {}}, '8a075de9-98f6-11e3-a84e-00144f0f7e1e': {'is_master': False, 'status': 'SECONDARY', 'is_alive': True, 'threads': {}}}
activities =
}
2)Demote the group and remove all servers:
-bash-4.1$ mysqlfabric group demote my_group1
Procedure :
{ uuid = bed929b7-f7c2-489e-9824-bed66789f870,
finished = True,
success = True,
return = True,
activities =
}
-bash-4.1$ mysqlfabric group remove my_group1 857026ae-98f6-11e3-a84e-00144f0f7e1e
Procedure :
{ uuid = 85aadc74-8d11-4996-8825-9b6b0581faa5,
finished = True,
success = True,
return = True,
activities =
}
-bash-4.1$ mysqlfabric group remove my_group1 84753261-98f6-11e3-a84e-00144f0f7e1e
Procedure :
{ uuid = 49d6e9c6-d783-44f0-8504-07eefa596efc,
finished = True,
success = True,
return = True,
activities =
}
-bash-4.1$ mysqlfabric group remove my_group1 8a075de9-98f6-11e3-a84e-00144f0f7e1e
Procedure :
{ uuid = c61900d8-f9b0-4a9a-b035-7168e43f0d78,
finished = True,
success = True,
return = True,
activities =
}
3)After this try to destroy group:
-bash-4.1$ mysqlfabric group destroy my_group1
Procedure :
{ uuid = 09ea87a2-8255-4856-bd84-d0be4fc25975,
finished = True,
success = False,
return = DatabaseError: ("Command (DELETE FROM groups WHERE group_id = %s, ('my_group1',)) failed: 1451 (23000): Cannot delete or update a parent row: a foreign key constraint fails (`fabric`.`shards`, CONSTRAINT `fk_shards_group_id` FOREIGN KEY (`group_id`) REFERENCES `groups` (`group_id`))", 1451),
activities =
}
-bash-4.1$ mysqlfabric group destroy my_group1 FORCE
Procedure :
{ uuid = f600e224-f2dc-4051-93a6-f4e0d3541e97,
finished = True,
success = False,
return = DatabaseError: ("Command (DELETE FROM groups WHERE group_id = %s, ('my_group1',)) failed: 1451 (23000): Cannot delete or update a parent row: a foreign key constraint fails (`fabric`.`shards`, CONSTRAINT `fk_shards_group_id` FOREIGN KEY (`group_id`) REFERENCES `groups` (`group_id`))", 1451),
activities =
}