Comment 4 for bug 1277053

Revision history for this message
Alex Yurchenko (ayurchen) wrote :

Jay,

1) causal wait is part of trans_begin() method, so you can always establish a proper read view. The fact that trans_begin() is not called on autocommit writes suggests (to me) that there are reasons why autocommit writes are supposed to be treated somewhat differently.

2) we would rather rely on certification to detect a conflict/out-of-date write, rather than on dumb wait. The problem comes out of late INSERTS - if you don't have a row, you can't detect a conflict (we don't even have anything to replicate, since the write was ineffective). As such it touches only UPDATEs and DELETEs. (INSERTs a) can be resolved by certificaiton, b) it is very unlikely use case that you will be inserting the same PK because of stale data (only if you have auto increment control turned off))

- the latter consideration brings us to an interesting point: we need a mask to specify events that we want to do causal wait. Perhaps we should introduce

wsrep_causal_wait = <mask> (1 - SELECT, SHOW, BEGIN, 2 - UPDATE/DELETE, 4 - INSERT)

wsrep_causal_reads=ON would be equivalent to wsrep_causal_wait=1