Bug #24546
closedConcurrent creation of subnets can lead to records with duplicate names
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1612909
Description of problem:
Concurrent creation of subnets can lead to records with duplicate names
Version-Release number of selected component (if applicable):
Verified in 6.3, as well as in upstream, has been around probably from the beginning
How reproducible:
Under concurrent requets
for x in {1..20}; do
echo "Attempt $x"
for y in {1..4}; do
curl k -u admin:changeme -X POST -d '{"name":"subnet'$x'","network":"192.168.0.1","mask":"255.255.255.0"}' -H 'Content-Type: application/json' http://localhost:300/api/v2/subnets &
done
sleep 1
done
Actual results:
select name, count() from subnets group by name having count() > 1;
returns multiple records
Expected results:
select name, count() from subnets group by name having count() > 1;
returns no record.
Additional info:
Testing notes: when verifying, please first generate multiple subnets with an installation without this fix and try to migrate to the version with it.