Commit/prepare position in ALL stream


Wanted to make sure my understanding is right on the ALL stream - specifically, do the commit/prepare position always increase monotonically?

For events A and B, if A after B in ALL stream: commitPosition(A) >= commitPosition(B) and preparePosition(A) > preparePosition(B) ?

Also, what is the logic behind the growth of commit/prepare positions? We have about ~300k events in our test environment (including the $stats) and the commit position is at 12 billion.

Thanks in advance

This is correct but you shouldn’t need to be dealing with this directly.

As for what they are they represent the logical log points of a journal at the time of writing (does not match physical).




minor correction

you should check preparePosition(A) > preparePosition(B) if and only if commitPosition(A) == commitPosition(B).

It is possible to have (at least in case of explicit transactions) when

commitPosition(A) > commitPosition(B) but

preparePosition(A) < preparePosition(B)

In the case above event A is after the event B as it was committed later.