Module mysql

Source
Expand description

Code to render the ingestion dataflow of a MySqlSourceConnection.

This dataflow is split into Snapshot and Replication operators.

ยงSnapshot

The snapshot operator is responsible for taking a consistent snapshot of the tables involved in the ingestion from the MySQL server. Each table that is being ingested is snapshot is assigned a specific worker, which performs a SELECT * FROM table and emits updates for all the rows in the given table.

For all tables that are snapshotted the snapshot operator also emits a rewind request to the replication operator containing the GTID-set based frontier which will be used to ensure that the requested portion of the replication stream is subtracted from the snapshot.

See the snapshot module for more information.

ยงReplication

The replication operator is responsible for ingesting the MySQL replication stream which must happen from a single worker.

See the replication module for more information.

ยงError handling

There are two kinds of errors that can happen during ingestion that are represented as two separate error types:

DefiniteErrors are errors that happen during processing of a specific collection record. These are the only errors that can ever end up in the error collection of a subsource.

TransientErrors are any errors that can happen for reasons that are unrelated to the data itself. This could be authentication failures, connection failures, etc. The only operators that can emit such errors are the MySqlReplicationReader and the MySqlSnapshotReader operators, which are the ones that talk to the external world. Both of these operators are built with the AsyncOperatorBuilder::build_fallible method which allows transient errors to be propagated upwards with the standard ? operator without risking downgrading the capability and producing bogus frontiers.

The error streams from both of those operators are published to the source status and also trigger a restart of the dataflow.

Modulesยง

replication ๐Ÿ”’
Renders the replication side of the MySqlSourceConnection ingestion dataflow.
schemas ๐Ÿ”’
snapshot ๐Ÿ”’
Renders the table snapshot side of the MySqlSourceConnection dataflow.
statistics ๐Ÿ”’
Renders the statistics collection of the MySqlSourceConnection ingestion dataflow.

Structsยง

MySqlTableName ๐Ÿ”’
A reference to a MySQL table. (schema_name, table_name) NOTE: We do not use mz_sql_parser::ast:UnresolvedItemName because the serialization behavior is not what we need for mysql.
RewindRequest ๐Ÿ”’
SourceOutputInfo ๐Ÿ”’

Enumsยง

DefiniteError
A definite error that always ends up in the collection of a specific table.
ReplicationError
TransientError
A transient error that never ends up in the collection of a specific table.

Functionsยง

return_definite_error ๐Ÿ”’
validate_mysql_repl_settings ๐Ÿ”’

Type Aliasesยง

StackedAsyncOutputHandle ๐Ÿ”’