stephentu / silo

Multicore in-memory storage engine
MIT License
372 stars 115 forks source link

about silo OCC's writeset lock #14

Closed chpooo closed 9 years ago

chpooo commented 9 years ago

There are serveral question's about silo's OCC writeset lock during commit time. 1, Is the lock always set to true when the tuple is a inserted one? 2, If tuples are modified ones, are there any locks during commit time? Does Silo create a new version in thread-or-numanode local memory and update the index?

stephentu commented 9 years ago

To answer 1), yes, this is an optimization.

To answer 2), there are two cases. Case (a) is if the modification is in the same epoch, in which case the data is overwritten in place. Case (b) is if the modification is in a later epoch, in which case a new tuple is created and the index updated. In both cases locks on the tuple must be acquired.

Hope this helps.

chpooo commented 9 years ago

thanks