etcd driver implement allocate_unique_key in a raceful manner
Bug #1713496 reported by
Dima Kuznetsov
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
DragonFlow |
Fix Released
|
High
|
Unassigned |
Bug Description
The code that allocates unique keys for etcd is susceptible to a race where a number of execution contexts will get value 1.
When a unique key is generated it is retrieved, incremented, and stored using compare&swap operation. If a key is not present, 1 is stored and returned.
If several contexts perform the lookup at the same time, all will choose 1 and write it to the database.
summary: |
- etcd driver implement allocate_unique_key in a receful manner + etcd driver implement allocate_unique_key in a raceful manner |
Changed in dragonflow: | |
importance: | Medium → High |
To post a comment you must log in.
This bug needs two side-by-side solutions:
1. The etcd driver should avoid race conditions on the first unique ID allocation
2. All unique keys should be allocated by df-db init and df-db upgrade (Where new models are added between versions).