Subject | Re: [Firebird-Architect] Re: Special Relativity and the Problem of Database Scalability |
---|---|
Author | Paul Ruizendaal |
Post date | 2010-02-10T17:00:58Z |
>> The point that I am making when talking about "ordering" is *not* theonly
>> ordering on a single node, but the relative ordering between nodes. If
>> snapshot isolated transaction A commits before snapshot isolated
>> transaction B and if both A and B updated the same record, then and
>> then must A commit before B on all nodes.Only if A commits after B started, otherwise it succeeds (assuming no
>
> In the Firebird/Netfrastructure/NimbusDB world, that case requires
> that B fail.
other conflicts).
> The other model - mixed snapshots and locks - allowsHow about the "new jersey" solution: B fails on commit because of a
> B to wait for A's commit and proceed with its updates. That's a
> great advantage for TPC/C, but, as I said, it has some odd side-effects.
>
> If write-ordering is performed at commit, and running transactions
> see a stable snapshot of data, how does the system detect and avoid
> lost updates? For example, Transaction A does a bunch of stuff
> including updating a specific record by adding 5 to one field.
> Transaction B does the same, including updating the same record.
> Neither sees the other's change. Even if B waits for A to commit
> everywhere, it will still have read an old value and stored a value
> that doesn't include A's change. Yes, all copies of the database
> will have the same result, but A's change is lost on all of them.
concurrent update and restarts itself from the beginning in a new
transaction, either automatically or with the application's help? In
today's world, where transactions tend to be short, the cost is modest as
compared to the gain of scaling out.
Paul