I have a Go application where it is assumed that a sequence of transactions performed by one goroutine will be seen (by other goroutines within the same application) as occurring in the order in which the goroutine performed them. Is this always guaranteed?
I'm trying to understand a specific behavior I'm seeing that is something like this:
Goroutine 1:
Transaction 1:
Write b
Transaction 2:
Delete a
Goroutine 2:
Transaction 1:
Read a (using txn.Get inside db.View); it is not present (i.e. Get returns ErrKeyNotFound)
Transaction 2:
Read b (using txn.Get inside db.View); it is also not present
As long as no other goroutines delete a or b, shouldn't Goroutine 2 see at least one of a or b?
Question.
I have a Go application where it is assumed that a sequence of transactions performed by one goroutine will be seen (by other goroutines within the same application) as occurring in the order in which the goroutine performed them. Is this always guaranteed?
I'm trying to understand a specific behavior I'm seeing that is something like this:
b
a
a
(usingtxn.Get
insidedb.View
); it is not present (i.e.Get
returnsErrKeyNotFound
)b
(usingtxn.Get
insidedb.View
); it is also not presentAs long as no other goroutines delete
a
orb
, shouldn't Goroutine 2 see at least one ofa
orb
?