wal: add more explanation to wal filename format

release-2.0
Brandon Philips 2014-09-11 12:51:50 -07:00
parent 04abd5603f
commit 413b6a59ff
1 changed files with 6 additions and 1 deletions

View File

@ -31,11 +31,16 @@ When a user has finished using a WAL it must be closed:
WAL files are placed inside of the directory in the following format:
$seq-$index.wal
The first WAL file to be created will be 0000000000000000-0000000000000000.wal
indicating an initial sequence of 0 and an initial raft index of 0.
Periodically a user will want to "cut" the WAL and place new entries into a new
file. This will increment an internal sequence number and cause a new file to
be created. If the last raft index saved was 0x20 and this is the first time
Cut has been called on this WAL then the sequence will increment from 0x0 to
0x1. The new file will be: 0000000000000001-0000000000000020.wal
0x1. The new file will be: 0000000000000001-0000000000000020.wal. If a second
Cut is issues 0x10 entries later then the file will be called:
0000000000000002-0000000000000030.wal.
At a later time a WAL can be opened at a particular raft index: