Skip to content

Commit 27ee38c

Browse files
committed
Update documentations describing startup mode
1 parent 7d3d6bd commit 27ee38c

File tree

1 file changed

+30
-5
lines changed

1 file changed

+30
-5
lines changed

docs/content/connectors/mysql-cdc.md

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,30 @@ Connector Options
218218
<td>optional</td>
219219
<td style="word-wrap: break-word;">initial</td>
220220
<td>String</td>
221-
<td>Optional startup mode for MySQL CDC consumer, valid enumerations are "initial"
222-
and "latest-offset".
223-
Please see <a href="#startup-reading-position">Startup Reading Position</a>section for more detailed information.</td>
224-
</tr>
221+
<td>Optional startup mode for MySQL CDC consumer, valid enumerations are "initial","earliest-offset", "latest-offset", "specific-offset" and "timestamp".
222+
Please see <a href="#startup-reading-position">Startup Reading Position</a> section for more detailed information.</td>
223+
</tr>
224+
<tr>
225+
<td>scan.startup.specific-offset.file</td>
226+
<td>optional</td>
227+
<td style="word-wrap: break-word;">(none)</td>
228+
<td>String</td>
229+
<td>Optional binlog file name used in case of "specific-offset" startup mode</td>
230+
</tr>
231+
<tr>
232+
<td>scan.startup.specific-offset.pos</td>
233+
<td>optional</td>
234+
<td style="word-wrap: break-word;">(none)</td>
235+
<td>Long</td>
236+
<td>Optional GTID set used in case of "specific-offset" startup mode</td>
237+
</tr>
238+
<tr>
239+
<td>scan.startup.specific-offset.gtid-set</td>
240+
<td>optional</td>
241+
<td style="word-wrap: break-word;">(none)</td>
242+
<td>Long</td>
243+
<td>Optional binlog file position used in case of "specific-offset" startup mode</td>
244+
</tr>
225245
<tr>
226246
<td>server-time-zone</td>
227247
<td>optional</td>
@@ -527,10 +547,15 @@ both snapshot phase and binlog phase, MySQL CDC connector read with **exactly-on
527547
The config option `scan.startup.mode` specifies the startup mode for MySQL CDC consumer. The valid enumerations are:
528548

529549
- `initial` (default): Performs an initial snapshot on the monitored database tables upon first startup, and continue to read the latest binlog.
550+
- `earliest-offset`: Skip snapshot phase and start reading binlog events from the earliest accessible binlog offset.
530551
- `latest-offset`: Never to perform snapshot on the monitored database tables upon first startup, just read from
531552
the end of the binlog which means only have the changes since the connector was started.
553+
- `specific-offset`: Skip snapshot phase and start reading binlog events from a specific offset. The offset could be
554+
specified with binlog filename and position, or a GTID set if GTID is enabled on server.
555+
- `timestamp`: Skip snapshot phase and start reading binlog events from a specific timestamp.
532556

533-
_Note: the mechanism of `scan.startup.mode` option relying on Debezium's `snapshot.mode` configuration. So please do not using them together. If you speicifying both `scan.startup.mode` and `debezium.snapshot.mode` options in the table DDL, it may make `scan.startup.mode` doesn't work._
557+
**Note:** MySQL source will print the current binlog position into logs with INFO level on checkpoint, with the prefix
558+
"Binlog offset on checkpoint {checkpoint-id}". It could be useful if you want to restart the job from a specific checkpointed position.
534559

535560
### DataStream Source
536561

0 commit comments

Comments
 (0)