You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "CloverDew (via GitHub)" <gi...@apache.org> on 2026/02/21 14:42:51 UTC

[PR] [Feature][Core] Add Dirty Data Collection Framework [seatunnel]

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

   ### Purpose of this pull request
   Implement dirty data collection framework to record and handle dirty records across SeaTunnel sinks, enabling configurable collectors, validators, SPI extensions, and threshold-based failure policies.
   **Design from:** https://github.com/apache/seatunnel/issues/4587
   
   ### Summary of changes
   
   - Add `DirtyRecordCollector` interface with overloads, init, validation integration, and threshold support.
   
   - Implement `LogDirtyRecordCollector`, `NoOpDirtyRecordCollector`, and example SPI collector `CountingDirtyRecordCollector` with providers.
   
   - Add `DirtyDataValidator` SPI and `ValidatingDirtyRecordCollector` wrapper to support user-defined validation rules.
   
   - Add `DirtyRecordCollectorFactory` and `DirtyCollectorConfigProcessor` to merge env and sink configs, instantiate collectors/validators and inject into sink writer context.
   
   - Integrate collector initialization and propagation into engine/translation layers so writer contexts receive a collector instance.
   
   - Add unit and e2e tests and example configs for built-in and custom collectors/validators.
   
   ### Architecture
   
   - Config-driven: collector and validator configured under `env.dirty.collector` / `env.dirty.validator` or per-sink `dirty.collector` / `dirty.validator`. `DirtyCollectorConfigProcessor` merges env and sink configs and prefers sink-specific config.
   
   - SPI extensibility: collectors and validators discovered via Factory/SPI. Built-in "log" collector provided; custom types (e.g., "counting") can be registered via ServiceLoader.
   
   - Validation pipeline: when a `dirty.validator` is configured, a `ValidatingDirtyRecordCollector` wraps the collector and calls validator.validate(record, catalogTable); records flagged dirty are collected by the delegate.
   
   - Runtime behavior: sinks call context.getDirtyRecordCollector().collect(...) on write failures; writers may call validateAndCollectIfDirty(...) before writing. Collectors track counts and enforce thresholds.
   
   - Serialization/Injection: collector objects are instantiated and injected into sink writer
   
   **Configuration Example:**
   ```
   env {
     parallelism = 1
     job.mode = "BATCH"
   
     dirty.collector = {
       type = "log"
       log_level = "ERROR"
       threshold = 10
       fail_on_threshold = true
     }
     
     dirty.validator = {
       type = "AlwaysDirtyDataValidator"
     }
   }
   
   source {
     FakeSource {
       row.num = 100
       schema = {
         fields {
           id = "bigint"
           name = "string"
           age = "int"
           status = "string"
         }
       }
       plugin_output = "fake"
     }
   }
   
   sink {
     Console {
       plugin_input = "fake"
     }
   }
   ```
   
   ### Does this PR introduce _any_ user-facing change?
    
   Yes. Previously, there was no unified dirty data collection capability; this PR introduces a configurable dirty data collection framework, allowing users to record and process dirty data via configuration or SPI-enabled collectors/validators.
   
   **Major Changes:** Added configuration items `env.dirty.collector`  and `env.dirty.validator`(Currently, only the relevant configurations have been added for ConsoleSink; the others sink need to be implemented manually.); provided built-in log and example counting collectors; supports custom collectors/validators via SPI.
   
   **Compatibility and Default Behavior:** `NoOpDirtyRecordCollector` is used when not configured. Enabling a threshold allows configuration to determine whether tasks fail due to exceeding the threshold.
   
   
   ### How was this patch tested?
   
   Unit tests for config merging, factory discovery and basic collector behaviors.
   E2E tests `DirtyDataCollectionIT`, `DirtyDataCustomExtensionIT` for:
   
   - [ ] Built-in log collector.
   - [ ] Custom SPI collector/validator usage.
   - [ ] Threshold and fail-on-threshold behavior.
   
   
   ### Check list
   
   * [ ] If any new Jar binary package adding in your PR, please add License Notice according
     [New License Guide](https://github.com/apache/seatunnel/blob/dev/docs/en/contribution/new-license.md)
   * [ ] If necessary, please update the documentation to describe the new feature. https://github.com/apache/seatunnel/tree/dev/docs
   * [ ] If necessary, please update `incompatible-changes.md` to describe the incompatibility caused by this PR.
   * [ ] If you are contributing the connector code, please check that the following files are updated:
     1. Update [plugin-mapping.properties](https://github.com/apache/seatunnel/blob/dev/plugin-mapping.properties) and add new connector information in it
     2. Update the pom file of [seatunnel-dist](https://github.com/apache/seatunnel/blob/dev/seatunnel-dist/pom.xml)
     3. Add ci label in [label-scope-conf](https://github.com/apache/seatunnel/blob/dev/.github/workflows/labeler/label-scope-conf.yml)
     4. Add e2e testcase in [seatunnel-e2e](https://github.com/apache/seatunnel/tree/dev/seatunnel-e2e/seatunnel-connector-v2-e2e/)
     5. Update connector [plugin_config](https://github.com/apache/seatunnel/blob/dev/config/plugin_config)


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Core] Add Dirty Data Collection Framework [seatunnel]

Posted by "DanielCarter-stack (via GitHub)" <gi...@apache.org>.
DanielCarter-stack commented on PR #10502:
URL: https://github.com/apache/seatunnel/pull/10502#issuecomment-3939843020

   <!-- code-pr-reviewer -->
   <!-- cpr:pr_reply_v2_parts {"group": "apache/seatunnel#10502", "part": 1, "total": 1} -->
   ### Issue 1: AbstractSinkWriter Template Method Breaks Existing Subclass Compatibility
   
   **Location**: `seatunnel-connectors-v2/connector-common/src/main/java/org/apache/seatunnel/connectors/seatunnel/common/sink/AbstractSinkWriter.java:27-47`
   
   **Related Context**:
   - Subclass 1: `seatunnel-connectors-v2/connector-slack/src/main/java/org/apache/seatunnel/connectors/seatunnel/slack/sink/SlackWriter.java:49`
   - Subclass 2: `seatunnel-connectors-v2/connector-dingtalk/src/main/java/org/apache/seatunnel/connectors/seatunnel/sink/DingTalkWriter.java:49`
   - Subclass 3: `seatunnel-connectors-v2/connector-email/src/main/java/org/apache/seatunnel/connectors/seatunnel/email/sink/EmailSinkWriter.java:70`
   - Other 27+ subclasses
   
   **Problem Description**:
   `AbstractSinkWriter` added an implementation for `write(T element)`, changing it to a template method pattern that requires subclasses to implement `doWrite(T element)`. However:
   1. The `write()` method in the code is not marked as `final` or `abstract`
   2. Existing 30+ subclasses all implement the `write()` method
   3. The `write()` methods of these subclasses will override the parent class implementation
   4. This causes dirty data collection logic to never be called
   
   **Potential Risks**:
   - **Risk 1**: All Connectors inheriting from `AbstractSinkWriter` cannot use the dirty data collection feature
   - **Risk 2**: Subclasses calling `super.write()` may cause recursion
   - **Risk 3**: No compile-time errors, only runtime behavior anomalies
   
   **Impact Scope**:
   - **Direct Impact**: Connectors such as Slack, DingTalk, Email, Assert, HugeGraph, Druid, Console, Redis, RocketMQ, Qdrant, TDengine, etc.
   - **Indirect Impact**: User-configured dirty data collectors do not take effect in these Connectors
   - **Impact Area**: 30+ Connectors, requiring adaptation one by one
   
   **Severity**: BLOCKER
   
   **Improvement Suggestions**:
   ```java
   // AbstractSinkWriter.java
   public abstract class AbstractSinkWriter<T, StateT> implements SinkWriter<T, Void, StateT> {
   
       protected SinkWriter.Context context;
   
       protected AbstractSinkWriter() {}
   
       protected AbstractSinkWriter(SinkWriter.Context context) {
           this.context = context;
       }
   
       /**
        * Template method that wraps {@link #doWrite(Object)} with dirty data collection.
        * 
        * <p><b>IMPORTANT:</b> Subclasses must override {@link #doWrite(Object)} instead of this method.
        * If you override this method directly, dirty data collection will not work.
        * 
        * @throws IOException if write fails and the record cannot be collected as dirty data
        */
       @Override
       public final void write(T element) throws IOException {  // Add final
           if (validateDirtyRecord(element)) {
               return;
           }
           try {
               doWrite(element);
           } catch (Exception e) {
               if (!tryCollectDirtyRecord(element, e)) {
                   if (e instanceof IOException) {
                       throw (IOException) e;
                   }
                   throw new IOException(e);
               }
           }
       }
   
       /**
        * Subclasses implement this method for actual write logic.
        * 
        * @param element the data to write
        * @throws IOException if write fails
        */
       protected abstract void doWrite(T element) throws IOException;  // Change to abstract
   
       // ... other methods
   }
   ```
   
   At the same time, all subclasses need to be checked during the code review phase to rename `write()` to `doWrite()`.
   
   ---
   
   ### Issue 2: getPluginConfig() Interface Method Improper Design Causes Configuration Passing Failure
   
   **Location**: 
   - `seatunnel-api/src/main/java/org/apache/seatunnel/api/common/SeaTunnelPluginLifeCycle.java:50-53`
   - `seatunnel-api/src/main/java/org/apache/seatunnel/api/sink/DirtyCollectorConfigProcessor.java:99-114`
   
   **Related Context**:
   - Caller: `DirtyCollectorConfigProcessor.initializeCollector(SeaTunnelSink, CatalogTable[])`
   - Implementation Class: `seatunnel-connectors-v2/connector-console/src/main/java/org/apache/seatunnel/connectors/seatunnel/console/sink/ConsoleSink.java:62-65`
   - Other Sinks: JDBC, Kafka, Hudi, Paimon, etc. (this method not implemented)
   
   **Problem Description**:
   1. The `SeaTunnelPluginLifeCycle` interface added the `getPluginConfig()` method, default throwing `UnsupportedOperationException`
   2. `DirtyCollectorConfigProcessor` calls this method when initializing the collector
   3. Only `ConsoleSink` implements this method
   4. Other Sinks will throw exceptions, making it impossible to obtain configuration, and the dirty data collector downgrades to `NoOpDirtyRecordCollector`
   
   **Potential Risks**:
   - **Risk 1**: All Sinks except ConsoleSink cannot use per-sink dirty data configuration
   - **Risk 2**: Users configured `sink.dirty.collector` but it does not take effect, with no error prompt
   - **Risk 3**: Violates the "interface minimization" principle (interfaces should not know about implementation details like "configuration")
   
   **Impact Scope**:
   - **Direct Impact**: All SeaTunnelSinks that do not implement `getPluginConfig()`
   - **Indirect Impact**: User configurations do not take effect, difficult to troubleshoot
   - **Impact Area**: Core framework, affecting all Connectors
   
   **Severity**: CRITICAL
   
   **Improvement Suggestions**:
   ```java
   // Solution 1: Remove interface method, pass configuration in SinkAction instead
   // MultipleTableJobConfigParser.java
   Config envConfig = seaTunnelJobConfig.hasPath("env") 
       ? seaTunnelJobConfig.getConfig("env") : null;
   Config mergedSinkConfig = DirtyCollectorConfigProcessor.getMergedSinkConfigForDirty(
       envConfig, sinkConfig);
   
   // Create collector directly here instead of in Sink
   DirtyRecordCollector collector = DirtyCollectorConfigProcessor.processConfig(
       envConfig, sinkConfig, catalogTable);
   sinkAction.setDirtyRecordCollector(collector);
   
   // Solution 2: If the interface must be kept, provide a reasonable default implementation
   // SeaTunnelPluginLifeCycle.java
   default Config getPluginConfig() {
       return ConfigFactory.empty();  // Return empty configuration instead of throwing exception
   }
   ```
   
   Solution 1 is recommended because configuration is a concern of the Job parsing phase and should not be the responsibility of Sink implementation classes to trace back configuration.
   
   ---
   
   ### Issue 3: Dirty Data Counters Cannot Aggregate Across Distributed Executors in Spark Environment
   
   **Location**: 
   - `seatunnel-api/src/main/java/org/apache/seatunnel/api/sink/LogDirtyRecordCollector.java:41`
   - `seatunnel-translation/seatunnel-translation-spark/seatunnel-translation-spark-2.4/src/main/java/org/apache/seatunnel/translation/spark/sink/SparkSinkInjector.java:68-71`
   - `seatunnel-translation/seatunnel-translation-spark/seatunnel-translation-spark-3.3/src/main/java/org/apache/seatunnel/translation/spark/sink/SparkSinkInjector.java:102-107`
   
   **Related Context**:
   - Serialization: `SparkSinkInjector.inject()` method serializes collector through `SerializationUtils.objectToString()`
   - Deserialization: `SparkDataSourceWriter` or `SparkDataWriterFactory` deserializes collector
   - Counter: `AtomicLong dirtyRecordCount` is independent in each Executor instance
   
   **Problem Description**:
   1. Collector is created in Driver, containing `AtomicLong dirtyRecordCount = new AtomicLong(0)`
   2. After serialization, it is sent to each Executor
   3. Each Executor deserializes to get an independent `AtomicLong` instance (value resets to 0)
   4. Threshold check `dirtyRecordCount >= threshold` only takes effect locally
   5. **Result**: When configuring `threshold=10`, each Executor will collect 10 dirty data before triggering the threshold
   
   **Example Scenario**:
   ```
   配置: threshold=10, parallelism=4
   
   预期: 全局收集 10 条脏数据后失败
   实际: Executor1 收集 10 条, Executor2 收集 10 条, Executor3 收集 10 条, Executor4 收集 10 条
        全局共 40 条,但每个 Executor 都只看到自己的 10 条
   ```
   
   **Potential Risks**:
   - **Risk 1**: Threshold configuration becomes ineffective, user expectations differ from actual behavior
   - **Risk 2**: Statistical data is inaccurate, unable to obtain global dirty data total count
   - **Risk 3**: In high-concurrency scenarios, far more dirty data than expected may be collected
   
   **Impact Scope**:
   - **Direct Impact**: All Sinks under Spark engine (versions 2.4 and 3.3)
   - **Indirect Impact**: Flink engine may also have similar issues (need to verify Flink's serialization mechanism)
   - **Impact Area**: Distributed execution engines
   
   **Severity**: MAJOR
   
   **Improvement Suggestions**:
   ```java
   // Solution 1: Use Accumulator mechanism (recommended)
   // SparkDirtyRecordCollector.java
   public class SparkDirtyRecordCollector implements DirtyRecordCollector {
       private LongAccumulator dirtyRecordAccumulator;
       
       @Override
       public void collect(...) {
           if (dirtyRecordAccumulator != null) {
               dirtyRecordAccumulator.add(1);
           }
           // ... logging logic
       }
       
       @Override
       public void checkThreshold() throws Exception {
           if (dirtyRecordAccumulator != null && threshold > 0) {
               long globalCount = dirtyRecordAccumulator.value();
               if (globalCount >= threshold) {
                   // fail
               }
           }
       }
   }
   
   // Initialize in SparkDataWriterFactory
   dirtyRecordAccumulator = sparkContext.longAccumulator("dirtyRecordCount");
   
   // Solution 2: Remove threshold feature, only provide counting and logging
   // Clearly state in documentation: threshold feature not supported in distributed environments
   ```
   
   ---
   
   ### Issue 4: Dirty Data Collection May Leak Sensitive Information
   
   **Location**: `seatunnel-api/src/main/java/org/apache/seatunnel/api/sink/LogDirtyRecordCollector.java:84-93`
   
   **Related Context**:
   - Log Output: Contains complete `dirtyRecord.toString()`
   - Configuration Item: No desensitization configuration
   
   **Problem Description**:
   ```java
   String logMessage = String.format(
       "Dirty record collected (exception) - SubTask: %d, %s, Count: %d, Record: %s, Error: %s",
       subTaskIndex,
       tableInfo,
       currentCount,
       dirtyRecord != null ? dirtyRecord.toString() : "null",  // Log completely
       errorMessage != null ? errorMessage : "");
   ```
   
   If dirty data contains sensitive fields (such as passwords, ID numbers, credit card numbers), they will be recorded in logs in plaintext.
   
   **Potential Risks**:
   - **Risk 1**: Violates data security compliance requirements (GDPR, Personal Information Protection Law)
   - **Risk 2**: Log files may be accessed by unauthorized personnel
   - **Risk 3**: Log collection systems (ELK, Splunk) will store sensitive data
   
   **Impact Scope**:
   - **Direct Impact**: All users using `LogDirtyRecordCollector`
   - **Indirect Impact**: Data security compliance risks
   - **Impact Area**: Production environment security
   
   **Severity**: MAJOR
   
   **Improvement Suggestions**:
   ```java
   // Solution 1: Add desensitization configuration
   env {
     dirty.collector = {
       type = "log"
       mask_fields = ["password", "ssn", "credit_card"]  // Fields that need desensitization
       mask_pattern = "***"  // Desensitization character
     }
   }
   
   // LogDirtyRecordCollector.java
   @Override
   public void init(Config config) {
       // ...
       if (config.hasPath("mask_fields")) {
           this.maskFields = config.getStringList("mask_fields");
       }
   }
   
   private String maskSensitiveFields(SeaTunnelRow row) {
       if (maskFields == null || maskFields.isEmpty()) {
           return row.toString();
       }
       // Implement field desensitization logic
   }
   
   // Solution 2: Only log row number and error information, not complete data
   String logMessage = String.format(
       "Dirty record collected - SubTask: %d, Table: %s, Count: %d, Error: %s",
       subTaskIndex, tableInfo, currentCount, errorMessage);
   // Does not include dirtyRecord content
   
   // Solution 3: Add security warning in documentation
   ```
   
   ---
   
   ### Issue 5: DirtyRecordCollector's Serializable Semantics Cause State Loss in Distributed Environments
   
   **Location**: 
   - `seatunnel-api/src/main/java/org/apache/seatunnel/api/sink/DirtyRecordCollector.java:31`
   - `seatunnel-api/src/main/java/org/apache/seatunnel/api/sink/LogDirtyRecordCollector.java:38-41`
   
   **Related Context**:
   - Spark Serialization: `SparkSinkInjector.inject()` serializes through `SerializationUtils.objectToString()`
   - Flink Serialization: FlinkKafkaSink, etc., may transmit over the network
   
   **Problem Description**:
   1. `DirtyRecordCollector` inherits `Serializable`
   2. `LogDirtyRecordCollector` uses `AtomicLong dirtyRecordCount`
   3. Java serialization will save the values of `AtomicLong`, but object state may be inconsistent after deserialization
   4. **In Flink's checkpoint/recovery scenarios**:
      - Collector is serialized to checkpoint
      - After task failure, recover from checkpoint
      - The value of `dirtyRecordCount` will be restored from checkpoint
      - But `NoOpDirtyRecordCollector.INSTANCE` is a singleton, and deserialization will break singleton semantics
   
   **Potential Risks**:
   - **Risk 1**: Inaccurate counting after task recovery
   - **Risk 2**: `NoOpDirtyRecordCollector.INSTANCE` is deserialized multiple times, breaking the singleton
   - **Risk 3**: The delegate and validator of `ValidatingDirtyRecordCollector` may lose state
   
   **Impact Scope**:
   - **Direct Impact**: Stateful tasks under Spark/Flink engines
   - **Indirect Impact**: Exactly-once semantics may be affected
   - **Impact Area**: Distributed execution engines
   
   **Severity**: MAJOR
   
   **Improvement Suggestions**:
   ```java
   // Solution 1: Not Serializable, create locally each time
   // DirtyCollectorConfigProcessor.java
   public static DirtyRecordCollector createLocalCollector(Config config) {
       // Create locally on each Executor, do not transmit over network
   }
   
   // Solution 2: Implement CheckpointedData interface (Flink)
   public interface CheckpointedDirtyRecordCollector extends DirtyRecordCollector {
       byte[] snapshotState();
       void restoreState(byte[] state);
   }
   
   // Solution 3: Use a separate state backend
   // Dirty data count is not placed in Collector, but in Metrics system
   ```
   
   ---
   
   ### Issue 6: Missing SPI Registration Files, AutoService Annotation May Not Take Effect
   
   **Location**: 
   - `seatunnel-api/src/main/java/org/apache/seatunnel/api/sink/LogDirtyRecordCollectorProvider.java:25`
   - `seatunnel-api/src/main/java/org/apache/seatunnel/api/sink/AlwaysDirtyDataValidator.java:31`
   
   **Related Context**:
   - Using `@AutoService(Factory.class)` annotation
   - Need to generate `META-INF/services/org.apache.seatunnel.api.table.factory.Factory` file
   
   **Problem Description**:
   1. The code uses the `@AutoService(Factory.class)` annotation
   2. However, the PR's changed file list does not include `META-INF/services/...` files
   3. `@AutoService` requires a compile-time processor to generate SPI files
   4. **If the build configuration is incorrect, SPI files will not be generated**
   5. Result: `LogDirtyRecordCollector` and `AlwaysDirtyDataValidator` cannot be discovered by SPI
   
   **Potential Risks**:
   - **Risk 1**: E2E tests for custom Collector/Validator SPI will fail
   - **Risk 2**: User-extended SPI will also not work
   - **Risk 3**: Can only be instantiated directly through class names, SPI mechanism becomes meaningless
   
   **Impact Scope**:
   - **Direct Impact**: SPI extension mechanism
   - **Indirect Impact**: E2E test `DirtyDataCustomExtensionIT` may fail
   - **Impact Area**: Core functionality
   
   **Severity**: CRITICAL
   
   **Improvement Suggestions**:
   ```bash
   # Check if SPI file exists
   find seatunnel-api -name "META-INF/services/org.apache.seatunnel.api.table.factory.Factory"
   
   # If not exists, need to:
   # 1. Confirm if pom.xml has com.google.auto.service:auto-service configured
   # 2. Manually create SPI file:
   mkdir -p seatunnel-api/src/main/resources/META-INF/services
   cat > seatunnel-api/src/main/resources/META-INF/services/org.apache.seatunnel.api.table.factory.Factory << EOF
   org.apache.seatunnel.api.sink.LogDirtyRecordCollectorProvider
   org.apache.seatunnel.api.sink.CountingDirtyRecordCollectorProvider
   org.apache.seatunnel.api.sink.AlwaysDirtyDataValidator
   EOF
   ```
   
   ---
   
   ### Issue 7: Non-SeaTunnelRow Type Data Cannot Collect Dirty Data in AbstractSinkWriter
   
   **Location**: `seatunnel-connectors-v2/connector-common/src/main/java/org/apache/seatunnel/connectors/seatunnel/common/sink/AbstractSinkWriter.java:104-113`
   
   **Related Context**:
   - `AbstractSinkWriter` is a generic class `<T, StateT>`
   - `tryCollectDirtyRecord()` only handles `SeaTunnelRow` types
   
   **Problem Description**:
   ```java
   protected boolean tryCollectDirtyRecord(T element, Exception e) {
       // ...
       if (element instanceof SeaTunnelRow) {
           collector.collect(...);
           return true;
       }
       return false;  // Return false directly for other types
   }
   ```
   
   Although most Connectors use `SeaTunnelRow`, some Connectors may:
   1. Use custom types (such as Avro `GenericRecord`, Protobuf `Message`)
   2. Use primitive types (such as `String`, `byte[]`)
   
   Dirty data from these Connectors cannot be collected, and exceptions will still be thrown.
   
   **Potential Risks**:
   - **Risk 1**: Dirty data collection feature is incomplete
   - **Risk 2**: Inconsistent behavior across different Connectors
   - **Risk 3**: May encounter this issue when extending Connectors in the future
   
   **Impact Scope**:
   - **Direct Impact**: Connectors using non-`SeaTunnelRow` types
   - **Indirect Impact**: Functional consistency
   - **Impact Area**: Some Connectors (need to confirm if such Connectors exist)
   
   **Severity**: MINOR
   
   **Improvement Suggestions**:
   ```java
   // Solution 1: Support dirty data collection of any type
   protected boolean tryCollectDirtyRecord(T element, Exception e) {
       // ...
       collector.collect(
           context.getIndexOfSubtask(),
           element,  // Pass original types directly
           e,
           "Write failed: " + e.getMessage());
       return true;
   }
   
   // DirtyRecordCollector interface also needs to support generics
   public interface DirtyRecordCollector {
       <T> void collect(int subTaskIndex, T dirtyRecord, Throwable exception, ...);
   }
   ```
   
   Or:
   ```java
   // Solution 2: Only log exception information, not the data itself
   if (!(element instanceof SeaTunnelRow)) {
       log.warn("Cannot collect dirty record of type: {}", element.getClass());
       // Still return true, swallow the exception
       return true;
   }
   ```
   
   ---
   
   ### Issue 8: Missing Documentation and Migration Guide
   
   **Location**: Entire PR
   
   **Problem Description**:
   This PR introduces major functional changes, but lacks the following documentation:
   1. **User Documentation**: How to configure `env.dirty.collector` and `env.dirty.validator`
   2. **Connector Developer Documentation**: How to implement `getPluginConfig()`
   3. **SPI Extension Guide**: How to write custom Collectors and Validators
   4. **Migration Guide**: How existing Connectors can migrate from `write()` to `doWrite()`
   5. **Incompatible Change Notes**: `incompatible-changes.md` not updated
   6. **Performance Impact Description**: Performance overhead after enabling dirty data collection
   
   **Potential Risks**:
   - **Risk 1**: Users don't know how to use the new feature
   - **Risk 2**: Connector developers don't know how to adapt
   - **Risk 3**: Behavior changes after upgrade, confusing users
   
   **Impact Scope**:
   - **Direct Impact**: User and developer experience
   - **Indirect Impact**: Low feature adoption rate
   - **Impact Area**: Entire community
   
   **Severity**: MAJOR
   
   **Improvement Suggestions**:
   ```markdown
   # Documentation that needs to be supplemented
   
   # # 1. User Documentation (docs/en/feature/dirty-data-collection.md)
   - 功能介绍
   - 配置示例(env 和 sink 级别)
   - 内置 Collector 类型(log, noop)
   - 内置 Validator 示例
   - 阈值配置说明
   - 安全注意事项(敏感信息脱敏)
   
   # # 2. Connector Developer Guide (docs/en/contribution/connector-guide.md)
   新增章节:
   - 如何实现 getPluginConfig()
   - 如何使用脏数据收集器
   - AbstractSinkWriter 迁移指南
   
   # # 3. SPI Extension Development
   - 如何实现 DirtyRecordCollectorProvider
   - 如何实现 DirtyDataValidator
   - 注册和打包说明
   - 示例项目
   
   ## 4. incompatible-changes.md
   新增条目:
   - SinkWriter.Context 新增 getDirtyRecordCollector() 方法
   - SeaTunnelPluginLifeCycle 新增 getPluginConfig() 方法
   - AbstractSinkWriter 行为变更(write() -> doWrite())
   
   ## 5. RELEASE NOTES
   说明新功能、配置项、已知限制
   ```
   
   ---
   
   ### Issue 9: Missing Unit Tests for Concurrent Scenarios
   
   **Location**: `seatunnel-api/src/test/java/` 
   
   **Problem Description**:
   Current tests mainly cover:
   - ✅ Configuration parsing
   - ✅ SPI discovery
   - ✅ Basic collection functionality
   
   But missing:
   - ❌ Multi-threaded concurrent counting tests (correctness of `AtomicLong`)
   - ❌ Serialization/deserialization tests
   - ❌ Checkpoint recovery tests
   - ❌ Threshold trigger boundary condition tests
   
   **Potential Risks**:
   - **Risk 1**: Counting errors in concurrent scenarios not discovered
   - **Risk 2**: State inconsistency in distributed environments
   
   **Severity**: MINOR
   
   **Improvement Suggestions**:
   ```java
   // DirtyRecordCollectorConcurrencyTest.java
   @Test
   public void testConcurrentCollect() throws Exception {
       DirtyRecordCollector collector = new LogDirtyRecordCollector();
       collector.init(ConfigFactory.parseString("threshold = 10000"));
       
       int threadCount = 10;
       int recordsPerThread = 1000;
       ExecutorService executor = Executors.newFixedThreadPool(threadCount);
       CountDownLatch latch = new CountDownLatch(threadCount);
       
       for (int i = 0; i < threadCount; i++) {
           executor.submit(() -> {
               for (int j = 0; j < recordsPerThread; j++) {
                   collector.collect(0, testRow, new Exception("test"), "error", null);
               }
               latch.countDown();
           });
       }
       
       latch.await();
       assertEquals(threadCount * recordsPerThread, collector.getDirtyRecordCount());
   }
   
   @Test
   public void testSerialization() throws Exception {
       LogDirtyRecordCollector original = new LogDirtyRecordCollector();
       original.init(config);
       original.collect(0, testRow, new Exception("test"), "error", null);
       
       byte[] serialized = SerializationUtils.serialize(original);
       LogDirtyRecordCollector deserialized = SerializationUtils.deserialize(serialized);
       
       // Verify that state is correctly restored
       assertEquals(original.getDirtyRecordCount(), deserialized.getDirtyRecordCount());
   }
   ```
   
   ---
   
   ### Issue 10: Inconsistent Behavior When ValidatingDirtyRecordCollector's Validator is null
   
   **Location**: `seatunnel-api/src/main/java/org/apache/seatunnel/api/sink/ValidatingDirtyRecordCollector.java:67-69`
   
   **Problem Description**:
   ```java
   public boolean validateAndCollectIfDirty(int subTaskIndex, SeaTunnelRow record, CatalogTable catalogTable) {
       if (validator == null) {
           return false;  // Return false when there is no validator
       }
       // ...
   }
   ```
   
   But the constructor does not validate the `validator` parameter:
   ```java
   public ValidatingDirtyRecordCollector(DirtyRecordCollector delegate, DirtyDataValidator validator) {
       this.delegate = delegate;
       this.validator = validator;  // Allow null
   }
   ```
   
   **Potential Risks**:
   - **Risk 1**: If `validator` is null, `validateAndCollectIfDirty()` always returns false
   - **Risk 2**: `validator.close()` in the `close()` method has NPE risk
   - **Risk 3**: Inconsistent with design intent (creating ValidatingDirtyRecordCollector is for validation)
   
   **Severity**: MINOR
   
   **Improvement Suggestions**:
   ```java
   // Solution 1: Validate in constructor
   public ValidatingDirtyRecordCollector(DirtyRecordCollector delegate, DirtyDataValidator validator) {
       Preconditions.checkNotNull(delegate, "delegate cannot be null");
       Preconditions.checkNotNull(validator, "validator cannot be null");
       this.delegate = delegate;
       this.validator = validator;
   }
   
   // Solution 2: Use Optional
   private final Optional<DirtyDataValidator> validator;
   
   public boolean validateAndCollectIfDirty(...) {
       return validator.map(v -> {
           ValidationResult result = v.validate(record, catalogTable);
           // ...
       }).orElse(false);
   }
   ```


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Core] Add dirty data collection framework for Flink and Spark [seatunnel]

Posted by "TyrantLucifer (via GitHub) via commits" <co...@seatunnel.apache.org>.
TyrantLucifer merged PR #10502:
URL: https://github.com/apache/seatunnel/pull/10502


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Core] Add dirty data collection framework for Flink and Spark [seatunnel]

Posted by "DanielLeens (via GitHub) via commits" <co...@seatunnel.apache.org>.
DanielLeens commented on PR #10502:
URL: https://github.com/apache/seatunnel/pull/10502#issuecomment-7207857303

   The CI fact cited previously has changed: the exact-head fork Build is completed with FAILURE. The failures are not all infrastructure noise. Both all-connectors-it-6 jobs (139803074160/JDK11 and 139803074291/JDK17) report 24 failures in connector-fake-e2e, including NoClassDefFoundError for DirtyDataTestExtensions.
   
   I traced the concrete packaging cause on this unchanged head: DirtyDataTestExtensions.installExtensionJar:63-67 includes the three nested fixture classes but omits DirtyDataTestExtensions.class. In the hosted stack, DirtyCollectorConfigProcessor.initializeCollector calls getSimpleName(), which enters Class.getDeclaringClass0 and needs the omitted enclosing class. Please include the enclosing class in the test-only extension JAR (or use self-contained top-level fixture classes), then rerun the actual Flink/Spark dirty-data E2E scenarios. Keep these fixtures out of production API artifacts. This is a focused source/CI finding from newly completed runtime evidence, not a second full review.
   
   Separately, engine-v2-it/JDK17 has the cancelJobTest timeout; MySQL CDC/JDK17 has the Flink schema-recovery comparison timeout; transform part2/JDK17 has a Python test-container parameter-resolution failure; all-connectors-it-7/JDK11 fails Maven-wrapper download with HTTP429/MavenWrapperMain missing. The wrapper fallback proposal #13466 remains unmerged, so syncing is not a proven cure for that lane and cannot repair this PR-specific extension packaging. Existing source Issues 6/7 remain open as recorded; no green-runtime acceptance is claimed.
   
   [Exact-head Build](https://github.com/CloverDew/seatunnel/actions/runs/45788597648), head `6c7f93ca4c5f4d016d68ac9827a1847a3ca4b8fd`. Compare `diverged`, ahead 1 / behind 13. No local build/test/runtime execution was performed. Daniel has READ permission; effective maintainer approval/dismissal remains separate.
   
   Current snapshot (2026-11-27T03:08:01.066443+00:00): Signal pull request update: SUCCESS; Build: FAILURE; merge state `BLOCKED`; review decision `REVIEW_REQUIRED`.
   


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Core] Add dirty data collection framework for Flink and Spark [seatunnel]

Posted by "SEZ9 (via GitHub) via commits" <co...@seatunnel.apache.org>.
SEZ9 commented on PR #10502:
URL: https://github.com/apache/seatunnel/pull/10502#issuecomment-7295455202

   Thanks for the work on this. The latest follow-up on this thread was made at unchanged head `e1b0b193312646fef1029f38c728e5f3c3edea25`, so the earlier review points still appear to be open. That follow-up independently confirmed three of them, and I'd take those first.
   
   **Confirmed in the follow-up**
   
   - **F6 (Spark task-side cleanup):** `DirtyDataAwareSinkWriter.abortPrepare` only forwards to the delegate, and the collector is closed only through `close`. On Spark 3.3, `SeaTunnelSparkDataWriter.abort` does not close that writer, its `close` is empty, and `commit` is the success-only close. A failed task, including the `fail_on_threshold` failure this feature raises itself, therefore never closes the collector or validator. This matters for any custom collector that owns resources, whether or not the standard `log` collector opens a connection.
   - **F7 (Spark driver-side cleanup):** both Spark starter `SinkExecuteProcessor` paths initialize the driver collector and call `save()`. Cleanup sits only in a `RuntimeException | Error` catch, so the checked exceptions from `save()` are missed and nothing closes the collector on success.
   - **F2 (diagnostics bypass masking):** `LogDirtyRecordCollector` writes `errorMessage` and exception text independently of `summarizeRecord`. Row values can therefore reach the logs even with `log_payload = false` and `mask_fields` set.
   
   Asks for these three:
   
   1. Add one idempotent cleanup path at the wrapper/starter ownership boundary, reached on abort and failure as well as success. A payload-logging tweak will not fix this.
   2. Add regression tests that observe the collector and validator being closed on the failure path and on the success path.
   3. Bring `errorMessage` and the stack trace under the payload/mask controls. Otherwise, gate them explicitly and stop presenting those settings as sanitizing validator diagnostics.
   
   **Still open, not touched by the follow-up**
   
   - **F3:** validate the masking configuration, so a misspelled option key or a mask name that matches no column fails fast instead of being ignored and logging full payloads unmasked.
   - **F4:** the base wrapper overrides the deprecated `SinkWriter.applySchemaChange`. On Flink, a delegate without schema-evolution support must still be seen as having dropped the event, not handled it.
   - **F5:** read the `log` collector options through the declared `Option` constants rather than raw `Config` getters, keep a single source of defaults, and reject invalid values.
   - **F1:** document the `DirtyRecordCollector` SPI contract, and either document or remove the hooks the framework never calls.
   - **F8:** state in the docs what happens when `dirty.collector` / `dirty.validator` are set on Zeta, and update the PR description so it no longer describes Zeta and `counting` behaviour this head does not contain.
   
   The earlier fixture-admission and positional-mask repairs remain valid, so nothing more is needed there.
   
   When you push, could you reply with a short per-item note (F1–F8) saying how each was addressed or why you'd prefer to leave it? That will make the next pass quick.
   
   <!-- streview-comment:2755 -->


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Core] Add Dirty Data Collection Framework [seatunnel]

Posted by "yzeng1618 (via GitHub)" <gi...@apache.org>.
yzeng1618 commented on PR #10502:
URL: https://github.com/apache/seatunnel/pull/10502#issuecomment-4001948899

   The current PR seems quite similar to the proposed direction ([Feature][Core] Error Data Bypass Capability for Transform & Sink (Dead Letter Queue)#10306). Both appear to be aimed at preventing tasks from failing directly due to dirty data.


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Core] Add Dirty Data Collection Framework [seatunnel]

Posted by "davidzollo (via GitHub)" <gi...@apache.org>.
davidzollo commented on PR #10502:
URL: https://github.com/apache/seatunnel/pull/10502#issuecomment-6461030354

   Addressed the review findings in 2a0874c2: all effective planners reject unsupported multi-table dirty handling before save-mode side effects, and default dirty-record logging is bounded and lazily formatted. Regression coverage preserves the raw JDBC behavior and the documented pre-submission rejection contract. Current-head CI remains a separate gate.


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Core] Add Dirty Data Collection Framework [seatunnel]

Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #10502:
URL: https://github.com/apache/seatunnel/pull/10502#issuecomment-5713060506

   Hi @CloverDew, just a heads up: GitHub auto-marked this PR as stale after 120 days of inactivity, and it will close in 7 days without further activity.
   
   Separately, I checked the current state on the latest head (915fe2f) and GitHub now reports a real merge conflict against `dev` (`mergeable: false`, `mergeable_state: dirty`), most likely from drift on `dev` since this branch was last synced. If you want to keep this moving, you will need to sync with the latest `dev` and resolve the conflict before further review makes sense.
   
   To recap where things stand from my side: the remaining blocking item is still the missing `docs/en` / `docs/zh` coverage for the new `dirty.collector` / `dirty.validator` config and SPI extension points (see my May 17-18 comments). The API compatibility, cross-engine fail-fast consistency, and collector lifecycle issues I flagged earlier are already fixed on this head.
   
   No need to rush purely because of the stale bot, but if you do come back to this, syncing with `dev` first will make it much easier to verify the diff is still clean. Happy to help scope the docs down to something minimal to start if that is the main blocker for you.


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Core] Add Dirty Data Collection Framework [seatunnel]

Posted by "davidzollo (via GitHub)" <gi...@apache.org>.
davidzollo commented on PR #10502:
URL: https://github.com/apache/seatunnel/pull/10502#issuecomment-6394375531

   Merged current `dev` and corrected the dirty-handling contracts in `b63f6296fbb94f23d96342f8049b350bc7e4f88a`.
   
   The requested EN/ZH configuration/SPI docs and real Flink starter fail-fast regression are included. The repair preserves default-off writer behavior and existing public context/constructor/extension APIs. Active handling is explicitly limited to synchronous single-table inputs/writers: multi-input/template, asynchronous/deferred and competing Zeta sink error-handler paths fail before rows; planning config is validated before sink preparation/save-mode effects.
   
   Source-backed corrections also preserve schema capability/physical identity, propagate system and validator failures, close owned resources with primary/suppressed failure ordering, discover custom providers through each current plugin classloader, and report collected Zeta rows as DROPPED rather than WRITTEN. Existing API, parser, engine and E2E tests now assert actual delegated rows/outcomes, cleanup and current-execution per-record collection/threshold evidence.
   
   Independent source review, affected-module formatting and staged whitespace checks passed. Local functional tests were not run under the CI-only policy. Fresh current-head CI and the repository's human approval/merge gates remain outstanding; this is not a runtime or production-acceptance claim.


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Core] Add Dirty Data Collection Framework [seatunnel]

Posted by "CloverDew (via GitHub)" <gi...@apache.org>.
CloverDew commented on PR #10502:
URL: https://github.com/apache/seatunnel/pull/10502#issuecomment-4470828399

   Hello, the `testDirtyDataCollectionFailure` method in `DirtyDataCollectionIT` is designed for three engines, including Zeta, Spark, and Flink. Therefore, I don't think it's necessary to write a separate test for Flink, as the existing tests already cover the content you just mentioned. Regarding documentation, I think it's better to wait until the functionality is complete and stable before writing it.


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Core] Add Dirty Data Collection Framework [seatunnel]

Posted by "SEZ9 (via GitHub)" <gi...@apache.org>.
SEZ9 commented on PR #10502:
URL: https://github.com/apache/seatunnel/pull/10502#issuecomment-5724339615

   Hi @CloverDew, thanks for the explanation on the test coverage.
   
   On the Flink test: given that `testDirtyDataCollectionFailure` in `DirtyDataCollectionIT` runs against Zeta, Spark and Flink, I'm fine keeping a dedicated Flink starter-path fail-fast test (explicit invalid dirty config must fail instead of degrading to `NoOp`) as a recommended follow-up rather than a blocker.
   
   On docs, I'd still like to have them in this PR. The change already introduces a user-facing contract: the `dirty.collector` / `dirty.validator` env keys, the sink-level-overrides-env precedence rule, the fail-fast behavior for invalid config, the `counting` collector type with its threshold / `fail_on_threshold` options, and the `DirtyRecordCollector` / `DirtyDataValidator` SPI extension points. Once merged, users will hit those without any reference, so matching `docs/en` and `docs/zh` coverage should land together with the code. A minimal page is fine to start: the two config keys, the precedence rule, the `counting` options, and a short note on how to plug in a custom collector/validator. Happy to help trim the scope if that's the main blocker.
   
   Two concrete asks before the next round:
   1. The latest head `915fe2f` currently has a merge conflict against `dev`, so please sync with `dev` and resolve it first.
   2. Add the `docs/en` / `docs/zh` coverage described above.
   
   Please ping me once those are pushed and I'll re-review the new commit. No rush; I just wanted to make sure the remaining items are clear.
   
   <!-- streview-comment:1134 -->


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Core] Add Dirty Data Collection Framework [seatunnel]

Posted by "CloverDew (via GitHub)" <gi...@apache.org>.
CloverDew commented on PR #10502:
URL: https://github.com/apache/seatunnel/pull/10502#issuecomment-3940008689

   Thank you so much for taking the time to provide such a thorough and detailed review. I really appreciate the clarity you’ve brought—especially breaking down the risks, the solutions, and the impact.
   I will go through all your suggestions point by point. For most of them, I'll adopt the fixes as you recommended. If I have any questions on a couple of the points, I'll reply in the thread.
   Thanks again for your patience and for helping me improve this.


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Core] Add Dirty Data Collection Framework [seatunnel]

Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #10502:
URL: https://github.com/apache/seatunnel/pull/10502#issuecomment-5770816400

   Thanks, SEZ9 — that all still lines up with where I left this on the 18th, so nothing to add on the technical side.
   
   To close the loop on the coverage question specifically: I'm treating it as settled. `testDirtyDataCollectionFailure` already runs the dirty-data path against Zeta, Spark, and Flink, so a separate Flink-only integration test isn't warranted just to prove the feature works end-to-end there. The one gap I still see — that the IT doesn't pin "explicit invalid dirty config fails fast instead of silently degrading to `NoOp`" specifically on the Flink starter path — stays exactly what it's been since 05-18: a recommended follow-up, not a blocker for this PR.
   
   Since there's no new commit on top of `915fe2f`, I don't have a fresh head to review yet, so I'll hold off on another full pass. The two items still standing between this and mergeable, unchanged from the 17th/18th:
   1. Sync with `dev` and resolve the merge conflict (branch was ~790 commits behind as of my last check).
   2. Minimal `docs/en` / `docs/zh` coverage for `dirty.collector` / `dirty.validator`, the sink-overrides-env precedence rule, `counting`'s `threshold` / `fail_on_threshold`, and the collector/validator SPI extension points.
   
   @CloverDew — happy to re-review as soon as those land, and still glad to help scope the docs down further if that's what's blocking you.


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Core] Add Dirty Data Collection Framework [seatunnel]

Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #10502:
URL: https://github.com/apache/seatunnel/pull/10502#issuecomment-4278477026

   Hi @CloverDew, thank you for continuing to work through such a large and useful feature area. I can see the PR has already moved forward after the earlier automated feedback, especially around passing the dirty collector through Zeta/Flink/Spark paths and adding Spark accumulators. I reviewed the latest head locally from branch `seatunnel-review-10502` at commit `bc3b4e86525e80d42c3ce12d313f77d7c7443c9d`, compared with merge base `d66e4f2a2f2d78a239dbc673da3cca98ede11a14` and current `upstream/dev` `b9cdfeb79e2df010718acde1d6e45b956a76f4fa`.
   
   I did a source-level review only; I did not run the PR locally. The visible GitHub checks are green, and my temporary local merge check reached `Automatic merge went well`, so I do not see a current merge conflict. There is still one formatting failure from `git diff --check`, noted below.
   
   # What This PR Solves
   - User pain point: today, if a sink sees a bad row, many jobs fail immediately even when the user would rather collect or log the bad row and continue processing the rest of the data.
   - Fix approach: the PR introduces a dirty-record collector/validator API, passes a collector through Zeta/Flink/Spark sink writer contexts, and wraps writes for connectors based on the common `AbstractSinkWriter`.
   - One-sentence summary: this is a first step toward sink-side dirty data bypass, but the current implementation is not yet safe to merge as a general SeaTunnel dirty data framework.
   
   Simple example: a `FakeSource -> Console` job can mark every row dirty with `AlwaysDirtyDataValidator`. Before this PR, there was no shared sink-side framework to collect those rows before writing. With this PR, Console can collect/log them through `AbstractSinkWriter`. However, a Kafka/JDBC/File style sink still follows its own `write()` implementation, so the same dirty collector config does not consistently apply across real production sinks yet.
   
   # 1. Code Change Review
   
   ## 1.1 Core Logic Analysis
   
   ### Precise Change Description
   - `seatunnel-api/src/main/java/org/apache/seatunnel/api/sink/SinkWriter.java:101-126` extends `SinkWriter.Context` with `getDirtyRecordCollector()`.
   - `seatunnel-api/src/main/java/org/apache/seatunnel/api/sink/*Dirty*` adds the collector, validator, factory, and log/counting implementations.
   - `seatunnel-connectors-v2/connector-common/src/main/java/org/apache/seatunnel/connectors/seatunnel/common/sink/AbstractSinkWriter.java:41-117` changes the common sink writer base class into a write wrapper around `doWrite()`.
   - `seatunnel-engine/seatunnel-engine-core/src/main/java/org/apache/seatunnel/engine/core/parse/MultipleTableJobConfigParser.java:567-603` parses env/sink dirty config and creates a collector for each sink config.
   - `seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/task/flow/SinkFlowLifeCycle.java:353-367` passes the collector into the Zeta `SinkWriterContext`.
   - Flink and Spark translation layers pass the same concept through their sink writer contexts/factories.
   - E2E coverage is added under `seatunnel-e2e/seatunnel-connector-v2-e2e/connector-fake-e2e`.
   
   ### Before / After Snippets
   
   Before, `SinkWriter.Context` did not require dirty collector support:
   
   ```java
   interface Context extends Serializable {
       int getIndexOfSubtask();
   
       default int getNumberOfParallelSubtasks() {
           return 1;
       }
   
       MetricsContext getMetricsContext();
   
       EventListener getEventListener();
   }
   ```
   
   After, every implementation of `SinkWriter.Context` is required to implement a new abstract method:
   
   ```java
   interface Context extends Serializable {
       ...
   
       DirtyRecordCollector getDirtyRecordCollector();
   }
   ```
   
   Before, the common sink base did not intercept writes:
   
   ```java
   public abstract class AbstractSinkWriter<T, StateT> implements SinkWriter<T, Void, StateT> {
       @Override
       public Optional<Void> prepareCommit() {
           return Optional.empty();
       }
   }
   ```
   
   After, the base class intercepts `write()` only when the connector does not override it:
   
   ```java
   @Override
   public void write(T element) throws IOException {
       if (validateDirtyRecord(element)) {
           return;
       }
       try {
           doWrite(element);
       } catch (Exception e) {
           if (!tryCollectDirtyRecord(element, e)) {
               ...
           }
       }
   }
   ```
   
   ### Key Findings
   - The normal Zeta/Flink/Spark sink creation paths now receive a dirty collector object, so the wiring itself is real and reachable.
   - The actual bypass behavior is only automatic for connectors that use the new `AbstractSinkWriter.write()` wrapper and implement `doWrite()`. Many production sinks still implement `SinkWriter.write()` directly or override `write()`, so they bypass the collector.
   - The feature changes public API surface in `seatunnel-api`; one new method is currently abstract, which creates source/binary compatibility risk for external connectors and tests.
   - Explicit dirty collector/validator misconfiguration currently falls back to `NoOp` or no validator, which can make users believe dirty data bypass is enabled when it is not.
   - This is a promising long-term framework direction, but the current PR is still closer to a partial implementation than a complete reusable framework.
   
   ### Deep Correctness Analysis
   
   The Zeta runtime path is:
   
   ```text
   Job config parsing
     -> MultipleTableJobConfigParser.parseSink() [L561-603]
         -> DirtyCollectorConfigProcessor.getMergedSinkConfigForDirty(envConfig, sinkConfig) [L567-570]
         -> DirtyCollectorConfigProcessor.processConfig(envConfig, sinkConfig, catalogTableSample) [L601-603]
         -> createSinkAction(..., dirtyRecordCollector) [L633-644]
         -> sinkAction.setDirtyRecordCollector(dirtyRecordCollector) [L740]
   
   Execution plan recreation
     -> ExecutionPlanGenerator.recreateAction() [L87-108]
         -> copies dirtyRecordCollector from original SinkAction when present
   
   Worker sink lifecycle
     -> SinkFlowLifeCycle.restoreState() [L353-367]
         -> createDirtyRecordCollector() from SinkAction [L192-198]
         -> new SinkWriterContext(..., dirtyCollector) [L356-362]
         -> sink.createWriter(writerContext)
   
   Record write
     -> SinkFlowLifeCycle.received(record) [L276-282]
         -> writer.write(row)
             -- connector uses AbstractSinkWriter.write()
                -> validateDirtyRecord()
                -> doWrite()
                -> tryCollectDirtyRecord() on exception
             -- connector implements/overrides write() directly
                -> dirty collector is not invoked unless the connector manually calls context.getDirtyRecordCollector()
   ```
   
   The Flink path follows `AbstractSinkExecuteProcessor.execute()` at `seatunnel-core/seatunnel-flink-starter/seatunnel-flink-starter-common/src/main/java/org/apache/seatunnel/core/starter/flink/execution/AbstractSinkExecuteProcessor.java:136-179`, then passes the collector into `FlinkSinkWriterContext`, where a dirty-record counter is registered at `seatunnel-translation/seatunnel-translation-flink/seatunnel-translation-flink-common/src/main/java/org/apache/seatunnel/translation/flink/sink/FlinkSinkWriterContext.java:52-78`.
   
   The Spark path follows `seatunnel-core/seatunnel-spark-starter/seatunnel-spark-starter-common/src/main/java/org/apache/seatunnel/core/starter/spark/execution/SinkExecuteProcessor.java:161-179`, serializes the collector through the Spark sink injection path, then installs a Spark `LongAccumulator` in `SeaTunnelSparkDataWriterFactory` at `seatunnel-translation/seatunnel-translation-spark/seatunnel-translation-spark-3.3/src/main/java/org/apache/seatunnel/translation/spark/sink/write/SeaTunnelSparkDataWriterFactory.java:82-118`.
   
   ## 1.2 Compatibility Impact
   Judgement: partially incompatible.
   
   - API: `SinkWriter.Context` gains an abstract method at `SinkWriter.java:126`. Any external or custom implementation compiled against the previous API will need source changes, and already-compiled implementations can hit `AbstractMethodError` when a writer calls `context.getDirtyRecordCollector()`.
   - Config: new user-facing keys are introduced: `dirty.collector`, `dirty.validator`, `type`, `log_level`, `include_stack_trace`, `threshold`, and `fail_on_threshold`.
   - Defaults: no dirty collector remains the implicit default, but explicit invalid config also becomes `NoOp`, which is risky.
   - Protocol: no network protocol change found.
   - Serialization format: Spark serializes the collector through `SerializationUtils.objectToString`; this is new runtime serialization but not a persisted checkpoint format change.
   - Historical behavior: connector write failures can now be swallowed as dirty data for adapted connectors, which is user-visible behavior and must be documented.
   
   Migration suggestion: make the new context method a default method returning `NoOpDirtyRecordCollector.INSTANCE`, document the dirty collector support contract, and clearly state which sinks are supported in the first release.
   
   ## 1.3 Performance / Side Effect Analysis
   - CPU: enabled collectors add per-row validator checks and exception-path logging. For adapted sinks, this is on the sink hot path.
   - Memory/GC: full row formatting in `LogDirtyRecordCollector` can allocate heavily when many records are dirty.
   - Network: no direct network cost, except any downstream logging/metrics system pressure.
   - Lock contention: no explicit new lock in the hot path, but counters and accumulators are updated per dirty record.
   - Concurrency safety: local counting uses `AtomicLong`; Spark/Flink distributed counters are added, but threshold semantics still need clear documentation per engine.
   - Retry/idempotency: swallowing write exceptions changes sink failure semantics. For non-idempotent sinks, a partial write followed by an exception could be collected as dirty even though the external side effect already happened.
   - Resource release: collectors expose `close()`, but the main Zeta `SinkFlowLifeCycle.close()` only closes the writer at `SinkFlowLifeCycle.java:175-178`; I did not find a call that always closes the collector separately.
   
   ## 1.4 Error Handling And Logs
   
   ### Issue 1: `SinkWriter.Context` adds an abstract method and breaks external implementations
   - Location: `seatunnel-api/src/main/java/org/apache/seatunnel/api/sink/SinkWriter.java:101-126`
   - Problem description: this interface is part of the public connector API. The PR adds `DirtyRecordCollector getDirtyRecordCollector();` as an abstract method. Internal contexts were updated, but external/custom contexts and test helpers outside this repository will no longer compile; already-compiled contexts can fail at runtime when the new method is invoked.
   - Potential risk: connector developers upgrading SeaTunnel can get source incompatibility or `AbstractMethodError` in normal sink creation/write paths. This is especially risky because the collector is passed through all engines.
   - Best improvement suggestion: make this a default method:
   
   ```java
   default DirtyRecordCollector getDirtyRecordCollector() {
       return NoOpDirtyRecordCollector.INSTANCE;
   }
   ```
   
   Keep the explicit overrides in engine/translation contexts, but preserve compatibility for older implementations.
   - Severity: high
   
   ### Issue 2: The dirty-data bypass does not cover many normal production sink paths
   - Location: `seatunnel-connectors-v2/connector-common/src/main/java/org/apache/seatunnel/connectors/seatunnel/common/sink/AbstractSinkWriter.java:49-63`; examples: `seatunnel-connectors-v2/connector-kafka/src/main/java/org/apache/seatunnel/connectors/seatunnel/kafka/sink/KafkaSinkWriter.java:72-129`, `seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/sink/AbstractJdbcSinkWriter.java:45-48`, `seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/sink/BaseFileSinkWriter.java:51-53`
   - Problem description: the collector is wired into the writer context, but the actual interception is implemented inside `AbstractSinkWriter.write()`. A large number of sinks either implement `SinkWriter` directly or override `write()` in subclasses, so the PR's dirty collector is never called on their normal write path unless each connector is manually adapted.
   - Potential risk: users can configure `dirty.collector` and see it work with the Console E2E, but the same config will not protect common real sinks such as Kafka, JDBC, File, Doris-style direct writers, etc. This creates a silent feature gap in the main Source -> Transform -> Sink path.
   - Best improvement suggestion: choose one explicit contract before merge:
     - Option A, recommended: add a framework-level wrapper around created `SinkWriter` in Zeta/Flink/Spark so the dirty collector is applied uniformly before delegating to connector `write()`.
     - Option B: keep connector-level integration, but mark the feature as opt-in and adapt the initial supported sinks one by one, with docs/tests listing the supported connector set.
     - Option C: make `AbstractSinkWriter.write()` final and migrate every subclass from `write()` to `doWrite()` in the same PR. This is larger and riskier, so I would prefer Option A or a clearly scoped Option B.
   - Severity: high
   
   ### Issue 3: Explicit dirty collector/validator configuration can silently degrade to no-op behavior
   - Location: `seatunnel-api/src/main/java/org/apache/seatunnel/api/sink/DirtyRecordCollectorFactory.java:92-107`, `seatunnel-api/src/main/java/org/apache/seatunnel/api/sink/DirtyCollectorConfigProcessor.java:76-80`, `seatunnel-api/src/main/java/org/apache/seatunnel/api/sink/DirtyCollectorConfigProcessor.java:128-156`
   - Problem description: if a user explicitly configures a collector type that cannot be found, or initialization fails, the factory logs and returns `NoOpDirtyRecordCollector`. If a validator type is missing or invalid, `createValidator()` returns `null`, and processing continues without validation.
   - Potential risk: this can turn a user-requested dirty-data bypass/collection policy into normal failing writes or no pre-validation, while the job still starts. That is hard to troubleshoot and can cause data loss expectations to be wrong.
   - Best improvement suggestion: fail fast for explicit invalid collector/validator config unless the user selected `noop`/`none`. The exception should include the config key, requested type, available types, and whether the failure happened during discovery or initialization.
   - Severity: high
   
   ### Issue 4: New user-facing dirty-data configuration has no docs
   - Location: `seatunnel-api/src/main/java/org/apache/seatunnel/api/sink/DirtyCollectorConfigProcessor.java:32-34`; docs check found no `dirty.collector` or `dirty.validator` entries under `docs/en` or `docs/zh`
   - Problem description: the PR introduces new env/sink-level behavior and several new config keys, but does not add English or Chinese user documentation. It also does not document the current supported sink scope, threshold semantics, SPI extension packaging, or the fact that full records may be logged.
   - Potential risk: users cannot safely use the feature, and reviewers cannot verify the public contract. This is a user-visible feature, so the docs are part of the merge criteria.
   - Best improvement suggestion: add matching `docs/en` and `docs/zh` pages or connector/core docs that include:
     - env-level and sink-level config examples,
     - built-in collector types and defaults,
     - validator SPI examples and packaging requirements,
     - supported engine/sink scope,
     - threshold/fail behavior,
     - security notes for logging dirty row contents.
   - Severity: high
   
   ### Issue 5: Log collector writes full row contents by default
   - Location: `seatunnel-api/src/main/java/org/apache/seatunnel/api/sink/LogDirtyRecordCollector.java:143-157`, `seatunnel-api/src/main/java/org/apache/seatunnel/api/sink/LogDirtyRecordCollector.java:168-178`
   - Problem description: the log collector formats `SeaTunnelRow.toString()` into logs for both exception-based and user-rule dirty records. The default `log_level` is `ERROR`, and `include_stack_trace` defaults to true.
   - Potential risk: dirty records often contain the exact malformed business data that operators should treat carefully. Logging full rows can leak PII, credentials, or other sensitive fields into job logs and downstream log systems. It can also create severe log volume when many rows are dirty.
   - Best improvement suggestion: either make full row logging opt-in, add masking/truncation controls, and document the risk, or default to logging table/subtask/count/error without the record payload.
   - Severity: medium
   
   ### Issue 6: Failure-threshold regression test does not assert that the job actually fails, and `git diff --check` fails
   - Location: `seatunnel-e2e/seatunnel-connector-v2-e2e/connector-fake-e2e/src/test/java/org/apache/seatunnel/e2e/connector/fake/DirtyDataCollectionIT.java:67-97`, `seatunnel-e2e/seatunnel-connector-v2-e2e/connector-fake-e2e/src/test/resources/fake_to_console_dirty_fail_threshold.conf:30`
   - Problem description: `testDirtyDataCollectionFailure()` runs a config with `threshold = 10` and `fail_on_threshold = true`, but it never asserts `failResult.getExitCode()` is non-zero. A future regression could log the threshold message and still let the job finish successfully. Separately, `git diff --check upstream/dev...HEAD` reports trailing whitespace in `fake_to_console_dirty_fail_threshold.conf:30`.
   - Potential risk: the key fail-on-threshold behavior can regress without failing the E2E, and the whitespace issue should be cleaned before merge.
   - Best improvement suggestion: assert the expected non-zero exit code for the fail-threshold job, keep the log assertions, and remove the trailing whitespace.
   - Severity: medium
   
   # 2. Code Quality Evaluation
   
   ## 2.1 Code Style
   The new files include ASF headers and the general style is close to the project. However, `git diff --check upstream/dev...HEAD` fails due trailing whitespace in `fake_to_console_dirty_fail_threshold.conf:30`, so the branch still needs formatting cleanup.
   
   ## 2.2 Test Coverage
   The E2E tests cover the Console path and SPI markers, which is useful. The main coverage gap is that the tests prove the happy path only for `FakeSource -> Console`, which is the one sink adapted to `doWrite()`. They do not cover a direct `SinkWriter` implementation or a common production sink path where the collector is present in context but not invoked. The failure-threshold test also does not assert job failure.
   
   ## 2.3 Documentation
   Docs are currently missing. Because this is a new user-visible feature and a new extension contract, both `docs/en` and `docs/zh` should be updated before merge, with consistent config names and examples.
   
   # 3. Architecture Reasonableness
   
   ## 3.1 Elegance Of The Solution
   The overall direction is valuable, but the current implementation is partial. Passing the collector through engine contexts is a good foundation; relying on individual connector inheritance/overrides for the actual bypass is not yet a robust framework-level solution.
   
   ## 3.2 Maintainability
   The new classes are readable, but the behavior boundary is not clear enough: users configure one generic dirty collector, while only some writer implementations actually honor it. This will be hard to maintain unless the support contract is made explicit.
   
   ## 3.3 Extensibility
   Collector and validator SPI points can be a good extension model. Before merge, the PR should decide whether dirty handling is engine-wrapped and universal, or connector-opt-in and documented. That decision will make future connector adoption much cleaner.
   
   ## 3.4 Historical Version Compatibility
   Partially incompatible due to the new abstract method on `SinkWriter.Context`. With a default NoOp implementation, this can become backward compatible for existing context implementations.
   
   # 4. Issue Summary
   
   | No. | Issue | Location | Severity |
   |---|---|---|---|
   | 1 | `SinkWriter.Context` adds an abstract method and breaks external implementations | `SinkWriter.java:101-126` | High |
   | 2 | Dirty-data bypass does not cover many normal production sink paths | `AbstractSinkWriter.java:49-63`; `KafkaSinkWriter.java:72-129`; `AbstractJdbcSinkWriter.java:45-48`; `BaseFileSinkWriter.java:51-53` | High |
   | 3 | Explicit dirty collector/validator config can silently degrade to no-op behavior | `DirtyRecordCollectorFactory.java:92-107`; `DirtyCollectorConfigProcessor.java:76-80,128-156` | High |
   | 4 | New user-facing dirty-data configuration has no docs | `DirtyCollectorConfigProcessor.java:32-34`; missing `docs/en` and `docs/zh` coverage | High |
   | 5 | Log collector writes full row contents by default | `LogDirtyRecordCollector.java:143-157,168-178` | Medium |
   | 6 | Failure-threshold E2E does not assert job failure and diff-check reports whitespace | `DirtyDataCollectionIT.java:67-97`; `fake_to_console_dirty_fail_threshold.conf:30` | Medium |
   
   # 5. Merge Conclusion
   
   ### Conclusion: can merge after fixes
   
   1. Blocking items that must be fixed:
   - Issue 1: preserve API compatibility by making `SinkWriter.Context#getDirtyRecordCollector()` default to `NoOpDirtyRecordCollector.INSTANCE`.
   - Issue 2: define and implement a reliable support contract so users do not get dirty-data bypass only for Console and a subset of adapted `AbstractSinkWriter` connectors.
   - Issue 3: fail fast for explicit invalid collector/validator config instead of silently falling back to `NoOp` or no validator.
   - Issue 4: add matching English and Chinese documentation for the new user-facing config and extension points.
   - Issue 6: at least remove the `git diff --check` whitespace failure before merge; please also strengthen the failure-threshold assertion.
   
   2. Recommended fixes, non-blocking:
   - Issue 5: add payload masking/truncation or make full record logging opt-in. I would strongly prefer fixing this before release because dirty-data logs are very likely to contain sensitive business values.
   
   Overall, I like the direction and appreciate the amount of plumbing already done here. The safest path is to narrow the initial scope or move the interception to a framework-level writer wrapper, then document the exact supported behavior. Once the compatibility and support-scope issues are fixed, this can become a strong foundation for SeaTunnel's dirty data handling.
   
   


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Core] Add Dirty Data Collection Framework [seatunnel]

Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #10502:
URL: https://github.com/apache/seatunnel/pull/10502#issuecomment-4477673560

   Thanks for explaining your reasoning.
   
   I agree the existing integration coverage is valuable, but my point about the Flink test is narrower than the end-to-end dirty-data flow. The latest fix in this PR lives in the Flink starter branch itself, while the current IT mainly proves that the three engines can execute the dirty-data path. It does not specifically pin the "explicit invalid dirty config must fail fast instead of degrading to `NoOp` on the Flink starter path" contract. That is why I kept it as a recommended follow-up, not a new blocker.
   
   The blocking item from Daniel's side is still the missing user-facing docs. This PR now introduces real config keys, precedence rules, fail-fast behavior, and SPI extension points. Once those are part of the feature contract, they need matching `docs/en` and `docs/zh` coverage in the same PR rather than only after some later stabilization cycle.
   
   There is still no new code after the last rereview, so I am not doing a fresh full review on the same head. If you push the docs update or another functional change, please ping me and I will re-review the new commit.


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Core] Add dirty data collection framework for Flink and Spark [seatunnel]

Posted by "DanielLeens (via GitHub) via commits" <co...@seatunnel.apache.org>.
DanielLeens commented on PR #10502:
URL: https://github.com/apache/seatunnel/pull/10502#issuecomment-7238227006

   Sorry for missing this in my previous review. My earlier no-source-blocker conclusion was too broad; this is a correction of that same-head conclusion, not a newly introduced regression. Thanks, @SEZ9, for tracing the remaining ownership paths.
   
   I independently checked the concrete Spark cleanup points. +1 to your existing worker/driver ownership findings: DirtyDataAwareSinkWriter.abortPrepare:195-197 only forwards to the delegate, whereas collector.close is reached through close:200-217. Spark 3.3 SeaTunnelSparkDataWriter.abort:108-118 does not close that writer and close:125 is empty; commit:95 is the success-only close. Both Spark starter SinkExecuteProcessor paths initialize the driver collector and call save(), with cleanup only in a RuntimeException|Error catch and no success finally. That is an incomplete lifetime for a valid custom collector owning resources, independent of whether the standard log collector opens a connection. The dedicated wrapper/starter ownership boundary needs an idempotent cleanup path and failure/success regression observations; a payload-logging tweak would not repair it.
   
   I also confirmed LogDirtyRecordCollector:181-183 includes errorMessage/exception text independently of summarizeRecord. The payload/mask setting must not be presented as sanitizing arbitrary validator diagnostics. I am not duplicating your finding numbers or claiming every other proposed point is independently closed here. The earlier fixture-admission and positional-mask repairs remain valid, but this PR must not be treated as source-cleared while these existing peer ownership/privacy concerns await resolution.
   
   CI is independently failed: I read wrapper429/bootstrap failures, the Windows MongoDB 49ms-vs-50ms assertion, and a Kubernetes quota-cleanup timeout. These are distinct signals, not a single generic Build failure. No local runtime was executed. Please repair the existing source concerns coherently and obtain checks on the resulting head; no unrelated dependency workaround is requested.
   
   Discussion/gate follow-up at unchanged head `e1b0b193312646fef1029f38c728e5f3c3edea25`; base `dev`, compare `diverged`, ahead 2 / behind 21. No local build, tests, Docker or SeaTunnel job was run.


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Core] Add Dirty Data Collection Framework [seatunnel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #10502:
URL: https://github.com/apache/seatunnel/pull/10502#issuecomment-5690361709

   This pull request has been automatically marked as stale because it has not had recent activity for 120 days. It will be closed in 7 days if no further activity occurs.


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Core] Add Dirty Data Collection Framework [seatunnel]

Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #10502:
URL: https://github.com/apache/seatunnel/pull/10502#issuecomment-5728606429

   Thanks for the recap, and good summary of where this stands.
   
   To confirm from my side: that's an accurate restatement of the two asks I left on 09-17/05-18 — (1) sync `915fe2f` with the latest `dev` and resolve the merge conflict, and (2) add matching `docs/en` / `docs/zh` coverage for the `dirty.collector` / `dirty.validator` env keys, the sink-overrides-env precedence rule, the `counting` type's `threshold` / `fail_on_threshold` options, and the collector/validator SPI extension points. The Flink starter-path fail-fast test stays a non-blocking follow-up, not a blocker, as noted before.
   
   I just re-checked the PR directly: `mergeStateStatus` is `DIRTY` / `mergeable=CONFLICTING`, and the branch is 790 commits behind `dev` — that conflict is real and current, not stale data, so it does need to be resolved before I can do another full pass on new code.
   
   @CloverDew, no rush given the stale-bot timing, but once you've synced with `dev`, resolved the conflict, and pushed the docs, ping me here and I'll re-review the new head from scratch.
   


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Core] Add Dirty Data Collection Framework [seatunnel]

Posted by "SEZ9 (via GitHub)" <gi...@apache.org>.
SEZ9 commented on PR #10502:
URL: https://github.com/apache/seatunnel/pull/10502#issuecomment-5738728615

   @CloverDew thanks for the explanation.
   
   On the Flink test: agreed that `testDirtyDataCollectionFailure` in `DirtyDataCollectionIT` already exercises the dirty-data path on Zeta, Spark and Flink. The narrower gap is that it does not pin the "explicit invalid dirty config must fail fast instead of degrading to `NoOp`" contract on the Flink starter path specifically. I'm fine keeping that as a non-blocking follow-up rather than a blocker for this PR.
   
   On docs: I understand the wish to wait for the feature to stabilize, but this PR already introduces user-facing contract — the `dirty.collector` / `dirty.validator` env keys, the sink-overrides-env precedence rule, the `counting` type's `threshold` / `fail_on_threshold` options, and the collector/validator SPI extension points. Once that lands in `seatunnel-api`, users will start relying on it, so matching `docs/en` and `docs/zh` coverage needs to ship in the same PR. It does not have to be exhaustive; a minimal page covering the keys, precedence, the `counting` options and how to plug in a custom collector/validator is enough to start, and we can iterate from there.
   
   Also, the current head `915fe2f` is reported as conflicting with `dev`, so a sync and conflict resolution is needed before another full pass makes sense.
   
   Remaining asks to unblock:
   1. Sync with the latest `dev` and resolve the merge conflict.
   2. Add `docs/en` / `docs/zh` coverage for the items listed above.
   
   Ping me here once both are pushed and I'll re-review the new head. The Flink starter-path fail-fast test can follow separately.
   
   <!-- streview-comment:1158 -->


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Core] Add Dirty Data Collection Framework [seatunnel]

Posted by "davidzollo (via GitHub)" <gi...@apache.org>.
davidzollo commented on PR #10502:
URL: https://github.com/apache/seatunnel/pull/10502#issuecomment-6418101027

   Good job.
   
   Thanks a lot for your valuable contribution to Apache SeaTunnel!
   
   To pass the automated CI checks for this PR, could you please enable CI workflows in your forked repository first? You can refer to the check run link below as a reference for the required CI configuration https://github.com/apache/seatunnel/actions/runs/40314998482
   
   If you run into any trouble enabling CI or encounter related errors during the process, feel free to leave a comment here. Contributors are always ready to offer help~
   
   <img width="2412" height="1472" alt="image" src="https://github.com/user-attachments/assets/6abd2ea1-da45-4d78-a81c-0158f2d7a851" />


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org