distributedlog-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sijie Guo <si...@apache.org>
Subject Re: Question about the sequence numbers
Date Sat, 10 Sep 2016 19:31:05 GMT
Hello Jay,

There is an explanation in the API page -
http://distributedlog.io/api/core.html#sequence-numbers

In short, the transaction id is an application supplied sequence number. It
is required to be non-decreasing. Users usually use either timestamp or
offset (bytes written so far) as the transaction id, so that they can use
transaction id to rewind either by time or offset.

The sequence id is the system generated sequence number. It indicates that
global sequence of a log record in the stream. if you are familiar with Raft
<https://raft.github.io/raft.pdf>, it is same as the log *index *in Raft.
There are two typical use cases of sequence id. You can use sequence id to
identify the number of records in between of any two records. You can use
sequence id to do any sanity check on the delivery sequence.

Let me know if you have any questions.

- Sijie



On Thu, Sep 8, 2016 at 11:47 PM, Jay Juma <jayk.juma@gmail.com> wrote:

> Hello,
>
> I am newbie to distributed log. What is the major difference between the
> sequence id and transaction id of a log record? They seem to be both long
> numbers.
>
> Thanks,
> Jay
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message