Comment 27 for bug 1605089

Revision history for this message
Han Zhou (zhouhan) wrote :

@Kevin, let me explain more about the locking mechanism. For every object in the journal it has a state. Each thread trying to sync the object to backend must do an atomic check-and-update operation to update the state to "processing" ensure it is not yet in "processing" by other threads. 'with_for_update' is NOT to block the thread, but used to implement this atomic operation for updating the state field. If Galera implement the isolation levels correctly, then this should work. It means in Galera deployment, if there are 2 nodes trying to acquire the lock, i.e. updating the state of an object to "processing" in race, the later one doing commit will just fail and should give up handling that object.