We have a race condition here that the ```__call__``` method will be run before this change propagates to all mongo nodes. We can prepare for this by doing an upsert here, and using ```$setOnInsert``` on the state attribute only, and ```$set``` on the others. Then in the ```__call__``` method, it can do an upsert also, and only set the task_id and state, both using the ```$set``` operator. That should be completely safe and immune to race conditions. http://docs.mongodb.org/manual/reference/operator/update/setOnInsert/#up._S_setOnInsert