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>

Header

The format of the the header is:

<dbid: u32, xid: u32, read-length: u32>
  • dbid is the id of the database.
  • xid is the id of the transaction.
  • read-length is the length of the read section.

Read section

Read section comprises of multiple groups, each group can be a Table group or an Index group.

Table group

A Table group starts with

<'T', relid: u32, nitems: u32, csn: u32>
  • relid is the id of the table.
  • nitems is the number of tuples being read from the table. This value and the following nitems tuples are ignored if csn is larger than zero.
  • csn is the commit sequence number of the latest transaction that modified the table. If this is zero, the following nitems tuples are validated.

followed by an array of size nitems (possibly zero) of

<blocknum: u32, offset: u16>
<blocknum: u32, offset: u16>
...
  • blocknum is the block number of the page containing the tuple.
  • offset is the offset of the tuple within the page.

Index group

An Index group starts with

<'I', relid: u32, nitems: u32>
  • relid is the id of the index.
  • nitems is the number of pages read.

followed by an array of size nitems (possibly zero) of

<blocknum: u32, csn: u32>
<blocknum: u32, csn: u32>
...
  • blocknum is the block number to identify the page.
  • csn is the commit sequence number of the latest transaction that modified the page.

Write section

This section uses a subset of the logical replication message formats of PostgreSQL. The messages being used are: Relation, Insert, Update, and Delete.

⚠️ **GitHub.com Fallback** ⚠️