potential race problems in get_or_create_oid in mobject server
Before performing any operations within a
write_op, mobject checks oid existence by checking the kv mapping of names->oids. If the oid is not found it is created, a process involving the following:
- Hashing the object_name to an oid, verifying the generated OID does not already exist in the kv mapping oids->names
- Putting the name->oid mapping in a kv
- Putting the oid->name mapping in a kv
A server receiving a number of different
write_ops referencing the same underlying oid is susceptible to races here. E.g., 2 clients writing to an object that does not yet exist on a specific server will result in both of them attempting steps 1--3. If one client is able to finish step 3 while another is checking for potential hash collisions, we get some inconsistent state that is going to cause issues (namely, two different oids referring to the same underlying object).