Hello Gunnar,
Thanks much for the reply, and I'm sorry it's taken so long to get back to you.
For now, we're setting the binlog retention period to some long period of time, and are doing what we can to ensure that our connector isn't down/idle for long enough to lose the binlog. I'm still very interested in the "schema_only" snapshot mode, as the semantics described in the documentation seem to match exactly what we want ("
With the schema_only mode the connector reads the current binlog position, captures the current table schemas without reading any data, and then proceeds to read the binlog from its current position. "). Am I perhaps misinterpreting this? I'd assumed this meant that whenever the connector didn't have access to its previous binlog that it performed the steps outlined here:
https://debezium.io/docs/connectors/mysql/#snapshots while skipping step 7 (and 6 unless include_schema_changes = true) and then continued reading the binlog from the earliest position that MySQL knew about.
I've picked around in the code for a bit, and I can see that there is an "includeData" flag that is set to false on the schema_only SnapshotMode, and that tells the SnapshotReader to skip touching every row in the source db when a Snapshot is performed. I can also see that in MySQLConnectorTask an exception is thrown explicitly when we don't have the binlog and SnapshotMode is not "when_needed". Would it be safe for the MySQLConnectorTask to go ahead and re-run the snapshot when SnapShotMode is schema_only as well? From what I can see the SnapShotReader would just skip the data load (Step 8) as it does when it first fires up.
For what it's worth, I amended the if-statement where the exception is thrown in schema_only mode to set startWithSnapshot = true when SnapshotMode is schema_only, and all of the tests still pass ... but I'm fairly naively poking around and could definitely be missing something.
If I'm not out to lunch on the above I can create something on Jira and issue a PR so that there's a better forum to discuss the above-mentioned changes.
Cheers,
Cliff