-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transaction bug in functional db, the 'ts' field will be incorrect if execute more than one operations in a single transaction? #247
Comments
@mlmhl Let's start with understanding the semantics of "execute more than two update operations in a single transaction". |
@yoavrubin The build.py script in this project is broken, do you offer an online pdf version of your functional DB, or sth else containing your work? |
@Shuumatsu |
@yoavrubin Thank you |
@yoavrubin
The functional db project is really cool, and I learned a lot from it. After reading it, I have a doubt about the Transaction section. I'm not familiar with
Clojure
, if I have a wrong understanding, please forgive me, thank you very much.In the
transact-on-db
function, each operations will be executed on theinitial-db
and finally generated an updated database namedtransacted
, and then the newest layer intransacted
will be appended to theinitial-db
as the newest layer. I think there is a bug in the last process if more than one operations need to be executed in an transaction. Consider the following example:initial-db
has two layers, the first layer is empty(ts
is0
), and the second one has only one entitye
with an attribute nameda
, anda
's value isv1
,ts
is1
.a
tov2
and the second one will updatea
tov3
. The first operation will generate a new layer, in whicha
's value isv2
andts
is2
,prev-ts
is1
. The second operation will generate a new layer too, in whicha
's value isv3
,ts
is3
,prev-ts
is2
.transact-on-db
will append the layer generated by second operation toinitial-db
's layers, now theinitial-db
has three layers, the first one'sts
is0
, the second one'sts
is1
, but the third one'sts
is3
, anda
'sprev-ts
is2
in the third layer. At this time, if we invoke theevolution-of
function oninitial-db
, we will fall into an infinite loop.The above example is just one possible error, if we execute more than two update operations in a single transaction and then invoke
evolution-of
, we will fall into a 'layer not found' error.The text was updated successfully, but these errors were encountered: