Message format - umd-dslam/sunstorm GitHub Wiki
This page describes the serialization format of the read and write sets of a transaction. The overall format is:
<header>
<read-section>
<write-section>
The format of the the header is:
<dbid: u32, xid: u32, read-length: u32>
-
dbidis the id of the database. -
xidis the id of the transaction. -
read-lengthis the length of the read section.
Read section comprises of multiple groups, each group can be a Table group or an Index group.
A Table group starts with
<'T', relid: u32, nitems: u32, csn: u32>
-
relidis the id of the table. -
nitemsis the number of tuples being read from the table. This value and the followingnitemstuples are ignored ifcsnis larger than zero. -
csnis the commit sequence number of the latest transaction that modified the table. If this is zero, the followingnitemstuples are validated.
followed by an array of size nitems (possibly zero) of
<blocknum: u32, offset: u16>
<blocknum: u32, offset: u16>
...
-
blocknumis the block number of the page containing the tuple. -
offsetis the offset of the tuple within the page.
An Index group starts with
<'I', relid: u32, nitems: u32>
-
relidis the id of the index. -
nitemsis the number of pages read.
followed by an array of size nitems (possibly zero) of
<blocknum: u32, csn: u32>
<blocknum: u32, csn: u32>
...
-
blocknumis the block number to identify the page. -
csnis the commit sequence number of the latest transaction that modified the page.
This section uses a subset of the logical replication message formats of PostgreSQL. The messages being used are: Relation, Insert, Update, and Delete.