postgres-api
postgres-api copied to clipboard
Under load the API reports that an instance has been deleted but in fact it has not
Bug Description When running performance test setup script, we create a lot of databases and bind them to apps. When we tear down the tests and similarly delete very rapidly those same instances, we get no errors reported.
However, when we then try again our setup scripts fail as some of the databases still exist in Postgresql.
How to reproduce
for i in {1..10}; do tsuru service-add postgresql tspostgres$1 shared -t bulkt1& done
for i in $(tsuru service-list | grep postgresql | cut -f 3 -d \| | tr , "\n") do tsuru service-remove $i -y & done
for i in {1..10}; do tsuru service-add postgresql tspostgres$1 shared -t bulkt1& done
This will create service instances, delete them rapidly and then try and recreate them, which should be fine however it fails as they still exist in postgresql.