2007/8/13, Junko IKEDA <[EMAIL PROTECTED]>: > > > If Node B updates the lock status _at just the right moment_, > > > sfex_update() detects that the other node is trying to update its > status, > > > and it will be terminated with exit(2). > > This time window is enough to destroy all data if you are bad luck ;-( > > Node B is just updating its lock status, it's not the data. > Node B can get the lock and access the shared disk after Node A gets out > both of the lock and its data. OK. I think you are mis-understanding the problem.
When the communication between Node A & B is fine, you don't need any kind of lock. Heartbeat itself can ensure the resource runs on one selected node, and on one node only. sfex_lock is valuable when the communication between A & B is broken. But when the communication IS broken, you can't assume sfex_lock will run in order any more. > > > > This statement is wrong according to your code. > > > > Especially, your check-and-reserve is not an atomic CAS operation. > > > > > > By the way, the lock status stores on the partition, (not using file > system) > > > so, as a communication media, it can keep read-write operation > atomicity. > > > All nodes' action, like read (check) or write (reserve) the status won't > > > bump against each other. > > > inconsequent remark? > > Yes, but still, the CAS operation is not atomic unless we do some tricks > like > > scsi reservation. > > well...I'm not sure the following comment is essential or not, > this is a later-come basis system (inverse of a first-come basis). > Once one node detects its status is updated from the other node, > the comparing will be terminated here. > basically, there is no the second bite at the cherry to get the lock. > > Thanks, > Junko > > _______________________________________________________ > Linux-HA-Dev: [email protected] > http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev > Home Page: http://linux-ha.org/ > _______________________________________________________ Linux-HA-Dev: [email protected] http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev Home Page: http://linux-ha.org/
