DanielLeens opened a new pull request, #13697:
URL: https://github.com/apache/seatunnel/pull/13697

   Yes, I am contributing to Apache SeaTunnel.
   
   ### Purpose
   
   Fixes #13693.
   
   A Doris sink with otherwise valid long ASCII table paths can generate a 
label longer than Doris's default 128-character limit. A small smoke test can 
succeed and a later batch fail when the process-wide base36 sequence grows from 
one character to two. For example, a two-character configured prefix, 
21-character database, 56-character table, 19-digit job id and ordinary 
subtask/source/timestamp components produce a 129-character non-2PC label.
   
   The source discriminator and per-call sequence introduced by #13111 remain 
necessary. Truncating the final label would remove identity or uniqueness 
information. The shutdown behavior addressed by open #10060 is separate and is 
not changed here.
   
   ### Change
   
   - Bound the complete newly created ASCII writer prefix once, before 
constructing its label generator. Reserve the complete signed-long suffix 
budget: 107 prefix characters in 2PC mode and 92 in non-2PC mode.
   - Keep fitting prefixes byte-for-byte unchanged. For an over-budget ASCII 
prefix, retain a readable beginning and append a 64-hex SHA-256 digest of the 
complete original prefix. The hash is computed before truncation and includes 
the existing source-table discriminator together with the complete 
table/job/subtask prefix.
   - Preserve existing invalid-character and server-specific Unicode label 
behavior. The budget targets Doris's default 128-character setting; it does not 
discover custom server limits.
   - Preserve the exact prefix persisted by older state. When that prefix 
differs from the active prefix, abort both before starting the restored load. 
This also cleans a transaction created by a previous upgrade attempt that 
failed before completing its first new checkpoint. Equal prefixes are cleaned 
once; cleanup failures prevent starting a new load.
   - Extend existing writer tests and the existing Doris IT's 2PC/non-2PC 
configurations. The latter retains its full-value assertions and now exercises 
long prefixes and multiple single-row non-2PC loads.
   
   No public API, configuration key/default, dependency, POM or 
state-serialization change. `DorisSinkState` class bytes are unchanged. 
Checkpoint suffixes and the process-wide non-2PC sequence are unchanged.
   
   ### Validation
   
   Source baseline: dev `0bef81d003a9dcc3266a10140dc639534ad81bfd`.
   
   Executed affected-module formatting and verification with JDK 11:
   
   ```shell
   mvn -nsu -Dmaven.gitcommitid.skip=true -T 3C \
     -pl 
seatunnel-connectors-v2/connector-doris,seatunnel-e2e/seatunnel-connector-v2-e2e/connector-doris-e2e
 \
     spotless:apply
   mvn -q -nsu -Dmaven.gitcommitid.skip=true -T 3C \
     -pl seatunnel-connectors-v2/connector-doris -am -DskipTests verify
   mvn -nsu -Dmaven.gitcommitid.skip=true -T 3C \
     -pl seatunnel-connectors-v2/connector-doris -am verify
   ```
   
   The final affected reactor passed **835 tests, zero failures/errors/skips**. 
Writer tests: 23 passing. All three new regressions fail against the unchanged 
baseline writer and pass with the candidate. Coverage includes both budgets and 
their next character, deterministic/distinct identities, unchanged short 
labels, unchanged character policy, repeated old-state restore, new-state 
persistence, equal-prefix deduplication and abort failure propagation.
   
   The complete existing `DorisIT` and current E2E-common sources also compiled 
for Java 8. This is compilation evidence, not a claim that the Testcontainers 
lifecycle ran. Unchanged engine UI is outside the affected reactor.
   
   Real native writer/committer verification against an isolated Apache Doris 
2.1.11-rc01 instance also passed:
   
   - 45 single-row non-2PC loads with an overlong ASCII configured prefix; 
every Unicode value and row id compared exactly.
   - Seed a legacy-prefix pre-committed transaction, restore old checkpoint 7, 
pre-commit checkpoint 8 under the bounded active prefix, and fail before 
persisting a new checkpoint.
   - Restore the same legacy checkpoint again: both the legacy transaction and 
the active-prefix orphan are aborted, the deterministic checkpoint label is 
reused with a new transaction, and the replacement load reaches VISIBLE.
   - Restore the newly persisted bounded-prefix state and commit the following 
checkpoint. Exact final queries return only the two committed rows, excluding 
both deliberately orphaned rows.
   
   The executed writer class was loaded from the candidate canonical JAR 
(`51aed70abedd5655f0630e5ccac5d8d68fbe8d4f93a97dde5fd50b3393f983ee`). 
Private-destination enforcement and process-owned socket sampling passed. This 
is a direct native connector verification; it does not claim the complete 
Zeta/Flink/Spark Testcontainers matrix ran.
   
   This PR fixes a correctness blocker. It does not claim three-round 
full-engine superiority over DataX; that separate benchmark remains in progress 
and its negative/resource-rejected trials are retained.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to