Details
-
Improvement
-
Resolution: Fixed
-
Critical
-
5.0.0
Description
- When SG sees a change over DCP it evaluates if XATTRS.mobile.CAS == doc.CAS. If they don't match, it recalculates the mobile meta and updates XATTRS.mobile.
- The way XATTRS is implemented, if either doc or XATTRS changes doc.CAS changes.
- So, if another actor is doing the same thing as SG then #1 will thrash between SG and the other actor.
This ticket is to determine the best / most efficient way for these independent actors (e.g. SGW / eventing) competing to be the last entity to update a doc. Some suggestions include:
- Instead of using CAS - each actor performs its own hash of the body and records that instead. If another actor updates some unrelated xattrs, the hash of the body will not change and thus no further action is needed.
- Rather than rely on each actor perform their own hashing, the server could provide this facility, possibly via an XATTR macro
- (Maybe the same as above?) maintain a separate CAS for the body only which doesn't change if XATTRs are updated.