Open
Description
Steps to reproduce
- Run two API requests in parallel to create
dbrp
mapping
2. All arguments are the same: database, retention_policy, orgID, bucketID
3. POST http://192.168.0.4:8086/api/v2/dbrps
Expected behavior
Only one of the requests succeeds, while the other gets rejected
Actual behavior
Both requests succeed. 🐞 Two equal dbrp
mappings are created, leading to an invalid state
Environment info
- System info: Linux-5.11.0-25-generic x86_64
- InfluxDB version: 2.0.7
Config
All default
Additional info for bug reproduction
This script can be used to reproduce the bug 100% of time: https://gist.github.com/hinst/5943f75d002eaa2a7398fe2181c81cff
- Run the script
- Check the number of mappings using command
3.influx v1 dbrp list -o HOME
4. -> there will be two mappings
If the same requests are run in a sequence, and not in parallel, then the second request to create the legacy mapping will fail with an error: such mapping already exists