This topic describes the print format of clogs.
Generally, a clog file contains many types of logs. As the predominant log type, OB_LOG_SUBMIT indicates the logs committed by modules other than the clog module, including the clogs committed by a transaction module.
A clog consists of three parts: abstract, header, and content. See the following template log format:
$$$abstract |header ||| |||content
Abstract
The abstract describes the information about a log record in a log file, as shown in the following example:
file_id:*** offset:*** len:*** OB_LOG_SUBMIT
The following table describes the fields.
| Field | Description |
|---|---|
file_id |
The name of the clog file. |
offset |
The offset of the log record in the log file. |
len |
The length of the log record. |
OB_LOG_SUBMIT |
Indicates that the type of the clog file is OB_LOG_SUBMIT. |
Header
The header describes the information about the log record itself, as shown in the following example:
ObLogEntryHeader:{magic:***, version:***, type:***, partition_key:***, log_id:***, data_len:***, generation_timestamp:***, epoch_id:***, proposal_id:***, submit_timestamp:***, is_batch_committed:***, is_trans_log:***, data_checksum:***, active_memstore_version:***, header_checksum:***}
The following table describes some fields.
| Field | Description |
|---|---|
partition_key |
The identifier of the data partition corresponding to the log record. |
log_id |
The identifier of the log record. |
generation_timestamp_ |
The point in time when the log record was generated, in the format of Unix timestamp. |
epoch_id |
The identifier of the election period, in the format of Unix timestamp. |
proposal_id |
A Paxos protocol-related variable. |
is_trans_log |
Indicates whether the log record is a clog. |
Entity
The content describes the data contained in the log record, as shown in the following example:
Trans: log_type:***, trans_inc:*** {[trans_log]}||| [mutator]
The following table describes some fields.
| Field | Description |
|---|---|
log_type |
The type of the clog. |
trans_id |
The transaction identifier corresponding to the clog. |
[trans_log] |
The information about the clog. |
[mutator] |
The information about transaction modifications. This field is displayed for redo logs. |
Notice
The size of a log record is limited in OceanBase Database. If a transaction involves many modifications, multiple redo log records may be generated.