Changing tag definition quickly could result in inconsistent data
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Released
|
Low
|
Unassigned | ||
1.2 |
Fix Released
|
High
|
Julian Edwards |
Bug Description
Because we might have multiple workers for one nodegroup, and rabbit doesn't ensure FIFO anyway, it is possible to change a tag definition quick enough that you have 2 workers working on the same nodes, but different definitions concurrently. With multiple nodegroups, this concurrency gets even worse.
Essentially there is a race condition, that whichever worker finishes first, will get their node <=> tag mapping overwritten by the one that finishes last. In practice, the last definition will start later, and will likely win.
A possible way to guarantee the last definition wins is to have the workers pass back the tag definition that they used for the processing. If it matches the current value in the database, accept it, otherwise reject or ignore it.
Related branches
- Martin Packman (community): Approve
-
Diff: 215 lines (+82/-11)4 files modifiedsrc/maasserver/api.py (+10/-0)
src/maasserver/tests/test_api.py (+18/-0)
src/provisioningserver/tags.py (+20/-7)
src/provisioningserver/tests/test_tags.py (+34/-4)
- Julian Edwards (community): Approve
-
Diff: 215 lines (+82/-11)4 files modifiedsrc/maasserver/api.py (+10/-0)
src/maasserver/tests/test_api.py (+18/-0)
src/provisioningserver/tags.py (+20/-7)
src/provisioningserver/tests/test_tags.py (+34/-4)
summary: |
- Changing tag definition quickly can result in inconsistent data + Changing tag definition quickly could result in inconsistent data |
Changed in maas: | |
status: | Triaged → Fix Committed |
Changed in maas: | |
status: | Fix Committed → Fix Released |
> Because we might have multiple workers for one nodegroup
This should never be the case, the architecture is explicit about one worker per nodegroup.
Does this affect your bug report?