awslabs/amazon-documentdb-tools

Cannot delete the last instance of the master cluster of DocumentDB

soma1204 opened this issue · 1 comments

when we automated your solution, filoverToSecondary some times failing with following error.
Do you have any solution for it.

I also modified the code like deleting all secondary instances first and then last primary instance after waiting 10 seconds.
However no luck.

Deleting Replica instance... docdb-2023-02-04-21-46-253 within cluster arn:aws:rds:us-east-1:858054668523:cluster:docdb-2023-02-04-21-46-25

Deleting Replica instance... docdb-2023-02-04-21-46-25 within cluster arn:aws:rds:us-east-1:858054668523:cluster:docdb-2023-02-04-21-46-25
Deleting Replica instance... docdb-2023-02-04-21-46-252 within cluster arn:aws:rds:us-east-1:858054668523:cluster:docdb-2023-02-04-21-46-25
ERROR OCCURRED WHILE PROCESSING: An error occurred (InvalidDBClusterStateFault) when calling the DeleteDBInstance operation: Cannot delete the last instance of the master cluster. Delete the replica cluster before deleting the last master cluster instance.

Thanks
Soma

I have not seen this issue before. I don't see anything in the code that would generate these message. Are you seeing these message in CloudWatch logs?