Document the state by adding a label to the FLIP page with one of "discussion", "accepted", "released", "rejected".

Discussion threadhttps://lists.apache.org/thread/545wcwg8lhcqf5j7nf1w2bywz857wyth
Vote threadhere (<- link to https://lists.apache.org/list.html?dev@flink.apache.org)
JIRA

FLINK-40108 - Getting issue details... STATUS

Release<Flink Version>

Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).

Motivation

The JDBC connector can already read tables in parallel, but everything that makes a parallel read correct and balanced is currently the user's responsibility:

  • The Table/SQL API splits only on a user-provided numeric column with explicit lower/upper bounds (scan.partition.column), which fails on skewed data and on non-numeric keys (this is the gap FLIP-602 addresses for the scan).
  • The DataStream API requires a hand-written parameterized query plus a JdbcParameterValuesProvider (or a PreparedSplitterEnumerator with hand-written chunking SQL). There is no metadata-driven discovery: the user must know the tables, the primary keys, and the value ranges, and must re-tune the job when data volume changes.
  • There is no cross-split consistency. Each parallel reader opens its own transaction at its own time, so rows can move between chunk boundaries (or vanish/reappear) while the scan is running. For an initial snapshot that feeds a CDC pipeline, or for a full-database migration, this silently produces inconsistent results. FLIP-602 is explicit about this: physical-id (ctid/ROWID) partitioning "is suitable for static tables... no concurrent DML", precisely because it has no snapshot isolation.

FLINK-38733 introduced the SplitterEnumerator SPI on JdbcSource, which turns split generation from a static parameter array into a pluggable, dynamic component. This FLIP builds the two flagship implementations on top of that SPI:

FeatureTodayWith snapshot splitters
Query definitionManual SQL with explicit range predicatesMetadata-driven scanning; query generated from table metadata
ChunkingCustom pagination/boundary logicAutomatic keyset chunking over the primary key
Database-wide scalingOne source/job per tableOne enumerator discovers and orchestrates all tables
ConsistencyNone across splitsAll splits of a run read one exported snapshot (PostgreSQL)
Failure recoveryRe-run enumeration from scratchCheckpointed per-table progress; resume, no split loss

Goals

  • TableSplitterEnumerator — read one table as primary-key ranged chunks, derived automatically from database metadata, with no user SQL.
  • DatabaseSplitterEnumerator — discover all tables of a schema (or an allowlist) and emit chunked splits across them from a single source.
  • Point-in-time consistency: all splits enumerated in one run read the same database snapshot, implemented for PostgreSQL via pg_export_snapshot() / SET TRANSACTION SNAPSHOT, with a dialect-neutral SPI in core so other databases with snapshot export can follow.
  • Resumability: enumeration progress is checkpointed; a failover resumes where it stopped and never re-emits completed ranges or silently drops enumerated ones.
  • Bounded memory: enumeration is streamed and paced, so the enumerator heap is independent of the table size.

Non-goals

  • Table/SQL API integration (scan.* options for this feature). This FLIP is scoped to the DataStream source; a Table API option set can be added on top of it later.
  • Exactly-once reading. Re-reading a split is required for failover; see Delivery semantics.
  • Snapshot-consistent CDC or incremental reads. This FLIP covers the bounded snapshot read, not the change stream that follows it.
  • Physical-id partitioning (ctid/ROWID) and boundary-query partitioning: both are already proposed in FLIP-602 and are complementary, not competing (see Relationship to FLIP-602).

Public Interfaces

Public API is exactly what is listed in this section, marked @PublicEvolving in the JDBC connector artifact: ConnectionProvider and AbstractConnectionProvider (the base class a new dialect extends — the dialect extension surface), the two splitters and their builders, the SplitterEnumerator additions, ConnectionOptions/ConnectionOptionsBuilder, ConnectionException, and the metadata value types (Table, TableId, TableColumn, TableBounds). Pure plumbing that only appears inside provider implementations — ConnectionDataSource, StatementPreparer, ResultSetMapper — is @Internal and users must not depend on it.

1. New core abstraction: ConnectionProvider

The snapshot splitters need more from the database than "give me a JDBC connection": table/column discovery, min/max, chunk-bound probing, bounds-parameterized queries, and snapshot export/join. Today all of that lives in dialect-specific SplitDataStrategy code that is not reachable from the DataStream source. This FLIP introduces a provider-level SPI in core:

org.apache.flink.connector.jdbc.core.datastream.connection.ConnectionProvider

@PublicEvolving
public interface ConnectionProvider extends JdbcConnectionProvider {

    Set<Table> getTables(String catalog, String schema);

    Set<TableColumn> getTableColumns(TableId tableId);

    String createQueryWithBounds(
            TableId tableId, Set<String> tableColumns, TableColumn pkColumn, TableBounds bounds);

    TableBounds queryMinMax(TableId tableId, TableColumn column);

    Optional<Object> queryNextChunkMax(
            TableId tableId, TableColumn column, Object lowerBound, long chunkSize);

    /** Independent instance backed by its own connection (borrowing from the shared pool). */
    ConnectionProvider newInstance();

    /** Pool capacity; splitter fan-out caps its concurrency at this value. Implementations must
     *  report the configured size (AbstractConnectionProvider uses ConnectionOptions#getConnectionPoolSize). */
    int maxPoolSize();

    // ---- global snapshot participation (all defaults: existing providers unaffected) ----

    /** Exports a snapshot on this provider's connection, held open for the connection's life. */
    default void createGlobalSnapshot() throws SQLException, ClassNotFoundException {}

    @Nullable
    default String getGlobalSnapshotId() { return null; }

    /** Configures this provider's connection (REPEATABLE READ, tx open) to join an exported snapshot. */
    default void joinGlobalSnapshot(String snapshotId) throws SQLException, ClassNotFoundException {}

    /** Readers refuse a snapshot-bearing split when this is false. Defaults to false. */
    default boolean supportsGlobalSnapshot() { return false; }
}


Supporting public types in the same package:

  • ConnectionOptions / ConnectionOptionsBuilder — plain JDBC options (url, driver, credentials, autoCommit) plus withConnectionPoolSize(int): the pool capacity, which also caps splitter fan-out (see maxPoolSize()), replacing the previous implicit coupling between two unrelated constants.
  • AbstractConnectionProvider — shared connection/pool lifecycle, statement caching, prepareQueryAndMap(...) helper; snapshot state is cleared whenever the physical connection is closed, so a stale snapshot id can never be re-applied to a new connection.
  • ConnectionException — public failure wrapper raised by the splitters.
  • ConnectionDataSource, StatementPreparer, ResultSetMapper — @Internal plumbing used inside providers only.
  • Table, TableId, TableColumn, TableBounds (in ...enumerator.splitter.snapshot.domain) — serializable metadata value types.

2. Snapshot splitters

New package org.apache.flink.connector.jdbc.core.datastream.source.enumerator.splitter.snapshot:

@PublicEvolving
public class TableSplitterEnumerator extends AsyncSnapshotSplitterEnumerator {
    public static TableSplitterEnumeratorBuilder builder();
}

@PublicEvolving
public class TableSplitterEnumeratorBuilder {
    public TableSplitterEnumeratorBuilder withCatalogName(String catalogName);
    public TableSplitterEnumeratorBuilder withSchemaName(String schemaName);
    public TableSplitterEnumeratorBuilder withTableName(String tableName);
    public TableSplitterEnumeratorBuilder withColumnNames(String... columnNames);
    public TableSplitterEnumeratorBuilder withColumnNames(Set<String> columnNames);
    /** Rows per chunk. Defaults to 100_000. */
    public TableSplitterEnumeratorBuilder withChunkSize(int chunkSize);
    /** Defaults to BOUNDED; see "Boundedness". */
    public TableSplitterEnumeratorBuilder withBoundedness(Boundedness boundedness);
    public TableSplitterEnumerator build();
}

@PublicEvolving
public class DatabaseSplitterEnumerator extends AsyncSnapshotSplitterEnumerator {
    public static DatabaseSplitterEnumeratorBuilder builder();
}

@PublicEvolving
public class DatabaseSplitterEnumeratorBuilder {
    public DatabaseSplitterEnumeratorBuilder withCatalogName(String catalogName);
    public DatabaseSplitterEnumeratorBuilder withSchemaName(String schemaName);
    /** Restrict discovery to these tables; default: all tables of the schema. */
    public DatabaseSplitterEnumeratorBuilder withTableNames(String... tableNames);
    public DatabaseSplitterEnumeratorBuilder withTableNames(Set<String> tableNames);
    /**
     * Restrict the SELECT projection of every table to these columns, in order; every table
     * must contain them all. Default: all columns in ORDINAL_POSITION order.
     */
    public DatabaseSplitterEnumeratorBuilder withColumnNames(String... columnNames);
    public DatabaseSplitterEnumeratorBuilder withColumnNames(Set<String> columnNames);
    /** Rows per chunk, applied to every table. Defaults to 100_000. */
    public DatabaseSplitterEnumeratorBuilder withChunkSize(int chunkSize);
    public DatabaseSplitterEnumeratorBuilder withBoundedness(Boundedness boundedness);
    public DatabaseSplitterEnumerator build();
}


Example — the whole feature composes with the existing JdbcSource builder:

JdbcSource<Order> source =
        JdbcSource.<Order>builder()
                .setConnectionProvider(new PostgresConnectionProvider(pgOptions))
                .setSplitter(
                        TableSplitterEnumerator.builder()
                                .withSchemaName("public")
                                .withTableName("orders")
                                .withChunkSize(8192)
                                .build())
                .setResultExtractor(orderExtractor)
                .setTypeInformation(orderType)
                .build();

env.fromSource(source, WatermarkStrategy.noWatermarks(), "orders-snapshot");


3. SplitterEnumerator additions (additive, default methods)

Existing implementations (PreparedSplitterEnumerator, SqlSplitterEnumerator, SlideTimingSplitterEnumerator) are unaffected:

@PublicEvolving
public interface SplitterEnumerator extends AutoCloseable, Serializable {
    // ... existing methods unchanged ...

    /**
     * Confirms that splits returned by a previous enumerateSplits() call have been handed to
     * the enumerator. Until confirmed, enumerated splits are retained in the serializable
     * state so a checkpoint cut in between cannot lose them. Default: no-op.
     */
    default void confirmSplitsDelivered(List<JdbcSourceSplit> splits) {}

    /**
     * Id of the global snapshot the current enumeration runs within, or null. The source
     * re-stamps restored splits (which carry the failed attempt's dead snapshot id) with this
     * value at hand-over. Default: null.
     */
    @Nullable
    default String currentSnapshotId() { return null; }
}


4. Split and enumerator state (serialization version bump)

  • JdbcSourceSplit gains a nullable snapshotId field; its serializer bumps from version 0 to 1. Version 0 bytes remain readable (restored split has no snapshot).
  • JdbcSourceEnumStateSerializer bumps 0 → 1 for the same reason; version 0 remains readable. No released connector version writes v1, so this FLIP defines v1 as the first on-disk format of this feature.

5. PostgreSQL module additions

org.apache.flink.connector.jdbc.postgres.datastream:

  • connection.PostgresConnectionOptions — fluent builder for Postgres connection settings (create().withHost(...).withPort(...).withDatabase(...).withUsername(...).withPassword(...).build()).
  • connection.PostgresConnectionProvider — the first ConnectionProvider implementation and the only snapshot-capable one in this FLIP:
  • createGlobalSnapshot() runs SELECT pg_export_snapshot() on a REPEATABLE READ transaction that is held open for the provider's life.
  • joinGlobalSnapshot(id) runs SET TRANSACTION SNAPSHOT '<id>' — the id is inlined as a literal (PostgreSQL does not accept bind parameters there) and validated against a strict allowlist ([0-9A-Za-z_-]{1,64}); rejected ids are reported without echoing the forged value.
  • Metadata queries against information_schema/pg_catalog; system schemas (pg_*, information_schema) are filtered out when no schema is configured.
  • supportsGlobalSnapshot() → true.
  • PostgresJdbc / PostgresJdbcConsumer — convenience facade equivalent to the JdbcSource builder path:
JdbcSource<Order> source =
        PostgresJdbc.of(
                        PostgresConnectionOptions.create()
                                .withHost("pg-host").withDatabase("app")
                                .withUsername("flink").withPassword("••••"))
                .asConsumer()
                .withSplitterEnumerator(
                        DatabaseSplitterEnumerator.builder().withSchemaName("public").build())
                .build(new OrderExtractor());   // ResultExtractor + TypeInformation in one


6. New dependency

com.zaxxer:HikariCP (currently 7.0.2), declared at the default (compile) scope in flink-connector-jdbc-core and flink-connector-jdbc-postgres, used by AbstractConnectionProvider for pooling. Rationale: one snapshot run multiplexes many concurrent consumers (coordinator metadata queries, one held-open export connection, N readers) over few physical connections; per-split raw DriverManager connections would multiply snapshot-hold time and connection churn. Note on scope: AbstractConnectionProvider exposes HikariDataSource in its protected API (pool-sharing constructor, getOrCreatePool()), so dialect modules must compile against Hikari — it is a compile-scope dependency, not shaded or relocated today, and it therefore lands on the user classpath as a transitive dependency of the connector. Hiding Hikari behind the provider API (or shading it into the distribution) is a listed follow-up. This is exactly the kind of dependency change the FLIP process asks to centralize (commit de12859, "add FLIP to be able to change dependencies"). The connector's existing shade configuration applies to it.

Proposed Changes

1. Architecture and lifecycle

JdbcSourceEnumerator (source coordinator)
 │  start():
 │   ├── connectionProvider.createGlobalSnapshot()      // fail-fast, before any split
 │   └── splitterEnumerator.start(provider)
 │
 ├── pollNext() ──► splitterEnumerator.enumerateSplits() │ confirmSplitsDelivered(...)
 ├── addReader / assign ──► refreshSnapshotId(split)     // re-stamp stale ids
 │
 └── snapshotState() ──► JdbcSourceEnumeratorState { splitterState, ... }

JdbcSourceSplitReader (reader)
    if (split.hasSnapshotId()) {
        provider.supportsGlobalSnapshot() ? provider.joinGlobalSnapshot(id)
                                          : fail closed;                        // never silently read outside the snapshot
    }
    run split.query


AsyncSnapshotSplitterEnumerator (the shared base class) drives split generation on a single background worker thread and hands finished splits to the coordinator's main thread via callAsyncInTheFuture. This keeps multi-second metadata/chunk queries off the coordinator's event-loop callback. (Note: in Flink 2.x the SourceCoordinator runs on a TaskManager; DB work still must not block the single worker that also serves checkpoint barriers.)

Bounded memory. Split generation is streamed, never materialized:

  • a table splitter keeps at most 1,000 computed-but-unemitted chunk bounds queued (it blocks on the cap instead of scanning the whole key range up-front — otherwise a 2 B-row table at default chunk size would queue 20 k bound pairs on the coordinator),
  • the source enumerator keeps at most 10,000 unassigned splits and 2 pending background enumeration calls.

The coordinator heap is therefore independent of the table/database size.

2. Table chunking

  • Resolve the primary key from getTableColumns(tableId). Tables without a primary key fail with a descriptive error (chunking is undefined); for composite keys the first column is used and a warning is logged. Chunk bounds are computed on that column alone (pk > ? keyset pagination), so a composite-PK table parallelizes only by distinct leading value: rows sharing one leading value can never end up in different splits, and a table whose leading column has a single distinct value (e.g. events(tenant_id, id) with one tenant) collapses to one split. Nothing is lost or duplicated; only parallelism is capped. Composite-aware keyset chunking (and a leading-column cardinality check) are follow-ups.
  • Seed bounds from queryMinMax (two single-aggregate queries — PostgreSQL serves each from the PK index without a sort).
  • Advance the cursor by keyset pagination: SELECT pk FROM t WHERE pk > ? ORDER BY pk ASC OFFSET chunkSize-1 LIMIT 1 yields the next chunk upper bound, walking the PK index only.
  • Emit each chunk as a split whose query is generated by the provider, left-inclusive / right-exclusive: SELECT <cols> FROM <schema>.<table> WHERE pk >= ? AND pk < ? (last chunk: WHERE pk >= ? only; empty table: one bound-less split). UUID PKs are compared via (?::uuid) casts; string/text bounds are cast via ::text for lexicographic comparison.
  • Split ids are stable SHA-256 fingerprints of (tableId, pk column, bounds) — short, deterministic across restarts, and they do not leak data values into metrics or logs.

Column projection (withColumnNames) and per-table chunk size are supported; the enumerator caches the constant SELECT … FROM prefix per (table, columns) so N chunk splits do not re-render N identical prefixes.

3. Database-wide enumeration

DatabaseSplitterEnumerator discovers tables with getTables(catalog, schema) (system schemas filtered when no schema is configured, and an explicit allowlist is honored), instantiates one internal table splitter per table, and interleaves their output — one split stream, one checkpointed state. Table metadata (columns/PK) is fetched once per table and reused for all its chunks.

4. Global snapshot coordination

The consistency contract: every split enumerated within one run reads the same database snapshot. Mechanics on PostgreSQL:

  • The coordinator exports once in start() (pg_export_snapshot() inside an open REPEATABLE READ transaction that stays alive with the provider's connection). Export failure fails the job immediately instead of degrading to inconsistent reads.
  • Each emitted split carries the snapshot id (JdbcSourceSplit v1).
  • A reader sets SET TRANSACTION SNAPSHOT '<id>' on its connection before running the split query. The reader re-acquires the connection after joining, because joining configures the connection's transaction.
  • Capability gate. supportsGlobalSnapshot() defaults to false, and a reader that finds a snapshot id on a split but a provider that cannot join fails the split rather than silently reading outside the snapshot (the base joinGlobalSnapshot no-op would otherwise make the guarantee a lie).
  • Stale-id re-stamping. Splits restored from a checkpoint carry the id exported by the failed attempt; that exporting connection is gone, so the id is dead. On restore the source exports a new snapshot and the enumerator re-stamps every restored split with currentSnapshotId() at hand-over (request and assign), so the restored run is self-consistent within the new snapshot. The exported snapshot cannot survive a full cluster restart; consistency is per attempt, which is the honest and only possible guarantee for a resumable scan.
  • Security: the snapshot id is embedded as a SQL literal (PG rejects placeholders in SET TRANSACTION), so the provider validates it against [0-9A-Za-z_-]{1,64} — the shape pg_export_snapshot() produces — before interpolation, and error messages do not echo a rejected value. Identifiers (tables/columns) go through dialect quoting, never raw concatenation.

5. Checkpointing, recovery and delivery semantics

Two races are handled explicitly:

  • Loss between enumerate and assign. Splits returned by enumerateSplits() are staged as pending in the splitter's serializable state until the source confirms them (confirmSplitsDelivered) after handing them to the enumerator's assignment buffers. A checkpoint landing between generation and delivery persists them, so restore replays them instead of losing them.
  • Restart-from-scratch re-enumeration. Each table splitter checkpoints its cursor: (boundsInitialized, tableMinMax, currentLowerBound, pendingBounds) (TableSplitProgress); the database splitter checkpoints per-table progress keyed by TableId plus its pending splits (DatabaseSplitProgress). A restored run resumes each table at its cursor and re-emits only the not-yet-delivered bounds — completed ranges are never re-read.

Delivery semantics: at-least-once. A reader that fails mid-split causes the split to be re-assigned and re-read (possibly under a newer snapshot after a coordinator failover). Rows may therefore be delivered more than once across attempts; no split is lost or skipped. Exactly-once is not a property a JDBC read source can offer by itself and is explicitly out of scope; idempotent sinks are the norm for bulk ingestion.

6. Boundedness

Both builders default to Boundedness.BOUNDED: after the last chunk is drained the source finishes, which is what a bulk snapshot ingestion wants. withBoundedness(CONTINUOUS_UNBOUNDED) is offered for jobs that must stay alive after the snapshot (e.g., as the bounded first phase in front of a separately managed change-capture stage). Note that a continuous mode does not re-scan into new data: post-snapshot reads would be outside the snapshot's guarantee; the flag exists for pipeline shape, not freshness.

7. Relationship to FLIP-602

FLIP-602 (Physical-ID / Boundary-Query partitioning) and this FLIP attack the same "parallel JDBC read" space from different angles and are compatible:


FLIP-602This FLIP
SurfaceTable/SQL API (scan.partition.* options)DataStream JdbcSource + SplitterEnumerator SPI
Chunkingphysical row id (ctid/ROWID) or user boundary querylogical PK keyset pagination (automatic)
Cross-split consistencyexplicitly none ("no concurrent DML" requirement)one exported snapshot per run (PostgreSQL)
Discoverysingle configured tableoptional whole-schema discovery
Resumere-run the scancheckpointed per-table progress

A ConnectionProvider is a natural home for FLIP-602's physical-id chunk strategy as a future SplitterEnumerator, and this FLIP's keyset chunking benefits FLIP-602's own motivation (skew without a numeric column: PK keyset chunking derives bounds from the actual data instead of a user-declared uniform range — with the caveat that split granularity is the first PK column, see Table chunking).

Compatibility, Deprecation, and Migration Plan

  • No behavior change for existing users. Everything is new package/classes or default methods; existing setSplitter(...) users, SQL/Table connector, and all current dialects are untouched. Providers that do not override the snapshot defaults behave exactly as before.
  • State compatibility. v0 checkpoint bytes (pre-v1 serializers) remain restorable. v1 is written only by this connector version onward. As always with enum-state bumps: a v1 checkpoint cannot be restored by an older connector — rollback guidance in docs.
  • PostgreSQL requirements. Snapshot export/join requires PostgreSQL ≥ 9.2 (the release that added pg_export_snapshot() / SET TRANSACTION SNAPSHOT) and a user without IDLE restrictions; readers join with REPEATABLE READ and must not toggle auto-commit afterwards. The exporting transaction holds back vacuum of dead tuples for its lifetime; a stuck or abandoned snapshot run keeps pg_export_snapshot active — the connector closes the holding connection when the coordinator/provider closes, but long-running snapshot scans have the same xmin horizon implication as any long REPEATABLE READ transaction and should be documented.
  • No concurrent-DDL caveat: PK-range chunks within one snapshot tolerate concurrent DML (unlike ctid partitioning); structural changes that drop/rename the PK mid-run still fail the affected splits, which is the desired loud failure.

Test Plan

Unit (core + postgres, ≈440 assertions):

  • Chunk generation: min/max seeding, keyset advance, trailing open chunk, empty table, UUID/text casting, composite/missing PK errors, split-id fingerprint stability across runs.
  • State roundtrip: per-table progress capture/restore (resume replays only undelivered bounds), pending-split staging, v0↔v1 serializer compatibility.
  • Snapshot protocol: synchronous export before any split at start(), fail-fast on export failure, stale-id re-stamping at request/assign, fail-closed reader on unsupported provider, bounds-queue pacing.
  • Postgres-specific: snapshot-id allowlist rejection (no echo), join re-application when the id changes on a reused connection, system-schema filtering in discovery, statement-cache reset on re-established connections, credential-safe messages.

Integration (testcontainers PostgreSQL):

  • Full snapshot read of a table and of a schema via DatabaseSplitterEnumerator through the PostgresJdbc facade; row count + PK-range coverage assertions.
  • Failover during enumeration (task failure injected mid-scan) completes with all rows — no split loss.
  • Connection-level ITCase: pg_export_snapshot/SET TRANSACTION SNAPSHOT roundtrip, including the stale-snapshot lifecycle.

The mutations of the key guards (ready-gate for restored splits, snapshot re-stamping, stale-state clearing on connection close, metadata-fetch reuse) were each verified to fail the corresponding test.

Rejected Alternatives

  • User-written chunking SQL (PreparedSplitterEnumerator + hand-written queries) — status quo. Requires the user to know ranges up front, breaks on skew/non-numeric keys, and carries no consistency or resume story. This FLIP automates exactly that manual heavy lifting (the motivation of FLINK-40108).
  • Offset/ROWNUM-based pagination. OFFSET n LIMIT m re-skips n rows per page (O(n²) total) and is unstable under concurrent writes even inside a transaction that starts late. Keyset pagination on the PK index is O(table size) once and stable.
  • Per-connection REPEATABLE READ without an exported snapshot. Each reader picks its own snapshot start point: chunk boundaries computed by the coordinator disagree with what readers see, and cross-table totals do not reconcile. Only a single exported snapshot shared by all splits gives the cross-split guarantee; databases without snapshot export opt out via the capability flag.
  • ctid/ROWID physical-id chunking instead of PK keyset chunking. Considered; rejected for this FLIP's use case. Physical ids move on every UPDATE/vacuum-full, making the scan unsafe under concurrent DML (FLIP-602 states the same limitation); PK ranges are stable logical boundaries and the PK index already exists on any snapshot-worthy table. Physical-id chunking can be added later as another ConnectionProvider strategy without changing this FLIP's contracts.
  • Reusing JdbcConnectionProvider (or the table module's SplitDataStrategy) as the splitter's database SPI. The existing JdbcConnectionProvider only hands out connections — no metadata or chunk-bound primitives; SplitDataStrategy is table module internals with SQL-type plumbing irrelevant to the DataStream path. A small dedicated provider SPI in core keeps the splitters dialect-neutral and makes snapshot capability an explicit, testable interface property.
  • Materializing all splits up front / checkpointing the full split list. Simplest to reason about, but unbounded on the coordinator heap for large tables/databases (20 k+ splits per big table). Streaming generation with checkpointed cursors moves state size from O(rows/chunk) to O(pending bounds).
  • Exactly-once split delivery. Impossible for re-assignable splits (the reader may have emitted rows before failing); pretending otherwise via 2PC would block checkpointing on the slowest split. At-least-once with re-readable chunks is the honest contract and matches every bulk-load precedent (Sqoop, DataX, Spark JDBC).
  • Table API options in this FLIP (scan.snapshot.*). Deliberately deferred: the table module would bind this feature to the table option validation surface and one more round of FLIP-602-style option matrix review; the DataStream SPI can ship and stabilize first, then a thin table option layer can expose it.