Skip to content

[Docs] Fix connector and transform doc inaccuracies verified against source code - #13410

Merged
nzw921rx merged 2 commits into
apache:devfrom
zhangshenghang:docs/fix-doc-issues-20261123
Nov 25, 2026
Merged

nzw921rx merged 2 commits into
apache:devfrom
zhangshenghang:docs/fix-doc-issues-20261123

Conversation

@zhangshenghang

Copy link
Copy Markdown
Member

Yes, I am contributing to Apache SeaTunnel.

What documentation issues were found

While auditing connector/transform docs against the Java source code (option definitions, factory optionRule()s, and reader/writer implementations), I found the following real inaccuracies:

  1. Stale option key names in JDBC family docs — the prose and example rows in Jdbc.md, Mysql.md, PostgreSQL.md, Oracle.md, SqlServer.md, Kingbase.md referenced chunk-key.even-distribution.factor.upper-bound/lower-bound, but the JDBC source defines these options as split.even-distribution.factor.* (JdbcSourceOptions.java:57,68). The CDC connectors genuinely use chunk-key.* (cdc-base JdbcSourceOptions), so only the non-CDC JDBC docs were corrected.
  2. JDBC connect_timeout_ms/socket_timeout_ms documented as general timeouts — code only applies them in the Hive dialect provider (HiveJdbcConnectionProvider); other dialects ignore them. Docs now say so, and 0 is described accurately (driver default, not "no timeout").
  3. Undocumented JDBC options added — multi_table.failure_policy (source, default FAIL_FAST, MultiTableCommonOptions.java) and multi_table_sink_replica (sink, default 1, SinkConnectorCommonOptions.java), plus the legacy base-url fallback key for url.
  4. Embedding transform docs — process_batch_size (default 100, alias inference_batch_size) and the multi-table options (table_transform, table_match_regex, rule_match_mode) were missing entirely; custom_config, oauth_path, dimension, aws_region are conditionally required per EmbeddingTransformFactory.optionRule() but were documented as plain "no"; the custom_config example had an unclosed string quote ("Bearer xxxxxxx → config would not parse).
  5. MQTT sink — doc claimed retry uses "exponential backoff", but MqttSinkWriter sleeps a fixed 200 ms (RETRY_BACKOFF_MS = 200L).
  6. RabbitMQ source — delivery_timeout is parsed but never read by the connector (getDeliveryTimeout() has no callers); docs now disclose this. Sink rabbitmq.config default corrected to {} (code default is an empty map, not unset).
  7. InfluxDB — sink write_timeout is dead (never applied to the OkHttp client); docs disclose this. Source epoch examples H/MS are wrong: the source passes the value raw to the InfluxDB HTTP API which only accepts lowercase (h,m,s,ms,u,n).
  8. TiDB CDC — docs claimed "exactly-once streaming" and [x] exactly-once, but nothing in connector-cdc-tidb implements exactly-once (no option, plain SourceReader); driver is consumed via TiDBCatalogFactory and used in the doc's own examples but was missing from the option table.
  9. Oracle CDC — database-names marked optional, but OracleSourceConfigFactory.create() calls checkNotNull(databaseList.get(0)) so the job fails without it → now documented as required; table-pattern is not applied to the Debezium capture list (only table-names is) → clarified; server-time-zone default corrected to "JVM system time zone" (JdbcSourceOptions default ZoneId.systemDefault()).
  10. DB2 CDC — same server-time-zone default fix, same table-pattern clarification, and added the missing split.allow-sampling row (honored via the shared JdbcSourceConfigFactory).
  11. StarRocks sink — documented that the default load format is JSON via starrocks.config.format (StreamLoadFormat.JSON) and that label_state_timeout_ms must be > 0 (Conditions.greaterThan(..., 0L)).
  12. zh sink Jdbc.md — heading #### 示例可选 was a mistranslation of en's #### dialect list → #### 方言列表.

What was changed

  • Fixed stale/wrong option keys, defaults, and required flags in option tables and prose
  • Added missing option rows (multi_table.failure_policy, multi_table_sink_replica, driver, split.allow-sampling, process_batch_size, multi-table options)
  • Added honest disclosures for parsed-but-unused options (delivery_timeout, write_timeout)
  • Fixed claims contradicted by code (exponential backoff, exactly-once, epoch casing)
  • Fixed a broken HOCON example (unclosed quote)
  • All fixes applied to both English and Chinese docs where the text exists in both

Areas/files updated

31 files (en + zh): connectors Jdbc (source/sink), Mysql, PostgreSQL, Oracle, SqlServer, Kingbase, Oracle-CDC, DB2-CDC, TiDB-CDC, StarRocks (sink), Rabbitmq (source/sink), Mqtt (sink), InfluxDB (source/sink); transform embedding.

English and Chinese docs

Yes, both were checked and fixed in lockstep; every en fix has its zh counterpart except where zh text differs structurally (e.g., the MQTT backoff claim only existed in en).

Duplicate PR check (last 7 days)

I listed all PRs authored in the last 7 days and diffed their file lists against this branch's changed files:

Verification

  • Ran a markdown table-consistency checker over all 31 changed files: all tables render with consistent columns (the one flag on Mqtt.md is a pre-existing escaped-pipe \| false positive present on upstream/dev).
  • Re-ran the broken-relative-link scan across docs/en + docs/zh: no new broken links introduced.
  • Cross-checked every changed claim against the source files named above (option keys/defaults quoted from code before editing).
  • Not run: ./mvnw spotless:apply / ./mvnw verify — this PR contains no Java/config changes (docs-only), and Spotless does not process Markdown; the documentation checks above cover the changed files.

@DanielLeens DanielLeens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing to Apache SeaTunnel! I reviewed the complete current diff and followed its entry points and failure paths. The items below need attention before merging; I hope the concrete paths make the next step straightforward.

What problem does this PR solve?

User pain: several published option names, timeout promises and provider requirements do not match the implementations.

Fix: correct31 connector/transform guides against option definitions and their actual consumers.

In one sentence: users can choose settings based on what this version actually does. For example, setting an InfluxDB write_timeout does not change its HTTP client timeout today; the guide now says so.

1. Code changes

1.1 Core logic

Complete runtime path:

Documentation -> user config -> ReadonlyConfig / factory OptionRule -> connector config -> actual consumer
InfluxDB: SinkConfig.loadConfig -> InfluxDBClient.getInfluxDB only applies connect/read timeout
JDBC: connection config -> HiveJdbcConnectionProvider applies positive connect/socket timeouts
RabbitMQ: RabbitmqConfig parses delivery_timeout -> reader still queue.poll(5000ms)
MQTT: flushBuffer -> publishWithRetry -> fixed RETRY_BACKOFF_MS sleeping until retry deadline
DB2/Oracle CDC: table-pattern discovery -> source configuration; only tableList writes Debezium table.include.list
TiDB: factory -> TiDBCatalogFactory -> optional driver preference -> snapshot/stream reader
Embedding: conditional OptionRule -> provider config -> per-table/batched transform -> model request
StarRocks: SinkConfig.loadConfig -> production visitor constructor passes0 -> nonpositive config falls back180000ms -> nonfinal-label polling

Key findings and correctness:

  • All31 changed files are documentation; no executable default or protocol is changed. Corrected JDBC split key names match the split options; url/base-url and embedding fallback aliases match ReadonlyConfig fallback handling.
  • The unused-timeout statements are supported by consumer searches, not merely by the presence of a setter. Hive is the only JDBC timeout applier; RabbitMQ still uses a fixed poll; InfluxDB never forwards write_timeout.
  • Embedding requirements match the provider-specific OptionRule, including the distinction between ZHIPU runtime API-key access and its dimension-only validation. Batch and multi-table defaults match their shared options.
  • TiDB snapshotState returns split state, but that alone is not proof of end-to-end exactly-once delivery; removing the unqualified guarantee is appropriately conservative. The optional driver really is forwarded to the catalog and null falls back to DriverManager.
  • One added assertion does not match current source: nonpositive StarRocks label timeouts are accepted and fall back to180000ms; there is no greater-than-zero validation in this path.

Before:

write_timeout: Write timeout used by the InfluxDB client.

After:

write_timeout: parsed for backward compatibility; currently not applied.
Only connect_timeout_ms and query_timeout_sec affect the HTTP client.

1.2 Compatibility

Fully compatible as documentation corrections: existing APIs, option names/defaults, protocols, serializers and runtime behavior are unchanged. The TiDB feature badge withdraws an unsupported blanket promise; it does not add a migration or change checkpoint bytes.

1.3 Performance and side effects

No CPU, memory, GC, network, lock, retry, idempotency or resource-lifecycle code changes. Better option guidance avoids relying on settings that are parsed but not applied.

1.4 Errors, logging, and findings

Issue 1: Describe the actual nonpositive label-timeout fallback

  • Location: docs/en/connectors/sink/StarRocks.md:55.
  • Description and risk: The new EN/ZH requirement implies that zero or negative label_state_timeout_ms is rejected. Production StarRocksStreamLoadVisitor.java:69-70 passes0 to the overload; lines98-105 choose the positive config value or DEFAULT_LABEL_STATE_TIMEOUT_MS. SinkConfig.loadConfig:103 simply copies the option, and the Option has no positive-value validator. Operators with0 therefore receive the built-in3-minute fallback, not a validation error. This documentation-only PR should describe that actual behavior.
  • Best improvement: Replace the mandatory-positive claim in both languages with the actual nonpositive fallback to180000ms. A new rejection rule would change existing behavior and should not be introduced incidentally to make this documentation statement true.
  • Responsibility and trade-off: Keep these corrections in the guides. Do not change runtime timeout validation, CDC capture policy or driver behavior merely to fit a new sentence.
  • Severity: Medium; blocking: true.
  • Previously raised by another reviewer: No, unless explicitly attributed above.

Community input: no independent technical finding or maintainer approval/change request was present in the collected discussion.

2. Code quality

2.1 Conventions

Reviewed all changed files for license, imports, naming, core-method and state-field comments. See the numbered findings for the required changes.

2.2 Test coverage and stability

Stability rating: Stable. Not applicable to UT/E2E stability: no test code changes. The current fork Build45210799698 is successful. Source searches and git show checked the consumers above; no local build, test or live connector validation was run. Java test lanes skipped for a docs-only change do not establish database behavior.

2.3 Documentation

EN/ZH matching changes were read in full. The untouched Chinese MQTT section already describes waiting/retry without claiming exponential backoff, so the EN-only correction does not introduce that contradiction. Matching guides for split-name fixes were checked; the new StarRocks positivity claim needs the bilingual correction below.

3. Architecture

3.1 Change location

Keep these corrections in the guides. Do not change runtime timeout validation, CDC capture policy or driver behavior merely to fit a new sentence.

3.2 Maintainability

Keep the behavior, lifecycle ownership, and failure contract together. Keep these corrections in the guides. Do not change runtime timeout validation, CDC capture policy or driver behavior merely to fit a new sentence.

3.3 Extensibility

Prefer the existing component boundary and tests over unrelated shared abstractions.

3.4 Upgrade impact

Fully compatible as documentation corrections: existing APIs, option names/defaults, protocols, serializers and runtime behavior are unchanged. The TiDB feature badge withdraws an unsupported blanket promise; it does not add a migration or change checkpoint bytes.

4. Findings summary

Completeness check: All changed files and affected entry/failure paths were reviewed; configuration/serialization compatibility, test failure capability and stability, documentation/examples, change ownership, and current CI/conflict/review gates are covered above. No unreviewed source scope is claimed complete.

# Finding Location Severity
1 Describe the actual nonpositive label-timeout fallback docs/en/connectors/sink/StarRocks.md:55 Medium

5. Merge recommendation

Merge after fixes

Blocking items: Issues 1. Current-head CI and write-capable maintainer review remain independent requirements.

Non-blocking suggestions: None beyond the validation limits above.

Overall: the approach addresses a real path, but the listed blockers must be closed. Daniel has READ permission, so this COMMENT cannot dismiss historical requested changes or satisfy a write-capable maintainer approval gate.

CI and repository state: Signal pull request update: SUCCESS; Build: SUCCESS; Build: success. GitHub reports BLOCKED / REVIEW_REQUIRED.

Verification: Reviewed all changed files and the referenced call sites at 169fb4d157e3cb74ddb52b0e79ae2645797688cc against merge base ef9c7ee2586c97115ecc0baf6d928cba4f46d6d9. git diff --check passed. I did not build, run tests, or execute SeaTunnel locally.

Review time: 2026-11-24T07:07:20.291305-05:00

Local evidence: git fetch obtained head 169fb4d157e3cb74ddb52b0e79ae2645797688cc; git merge-base returned ef9c7ee2586c97115ecc0baf6d928cba4f46d6d9; git diff --stat reports 31 files changed, 119 insertions(+), 76 deletions(-). git show and source searches were used for the entry points above. No local build, unit test, E2E, Docker run or service startup was executed.

…meout_ms fallback

StarRocksStreamLoadVisitor treats a non-positive label_state_timeout_ms
as 'unset' and falls back to the built-in 180000 ms default instead of
rejecting the value; the option has no positive-value validator, so the
new 'must be greater than 0' wording in en/zh was inaccurate. Describe
the real fallback behavior instead.

@nzw921rx nzw921rx left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 LGTM

block issue fixed

@nzw921rx
nzw921rx added this pull request to the merge queue Nov 25, 2026
Merged via the queue into apache:dev with commit 9d33859 Nov 25, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants