You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "TyrantLucifer (via GitHub)" <gi...@apache.org> on 2025/02/26 09:23:02 UTC

[I] [Feature][Core] Design of Dirty Data Collection [seatunnel]

TyrantLucifer opened a new issue, #4587:
URL: https://github.com/apache/seatunnel/issues/4587

   ### Search before asking
   
   - [X] I had searched in the [feature](https://github.com/apache/incubator-seatunnel/issues?q=is%3Aissue+label%3A%22Feature%22) and found no similar feature requirement.
   
   
   ### Description
   
   # Design of Dirty Data Collection Functionality for Apache SeaTunnel
   
   ## Introduction
   
   The dirty data collection function can effectively guide users to discover data quality problems in a timely manner in the data integration framework, ensuring the accuracy and stability of data synchronization.
   
   ## Functional Requirements
   
   The dirty data collection function needs to support the following features:
   
   1. Collect and record all dirty data content and exception information.
   2. Support plug-in extension.
   
   ## Technical Solution
   
   ### Interface Design
   
   Add interface `DirtyRecordCollector`:
   
   ```java
   /** Base interface for dirty records collector */
   public interface DirtyRecordCollector extends Serializable {
   
       /** Collect dirty record with exception and error message */
       void collect(
               final int subTaskIndex,
               final SeaTunnelRow dirtyRecord,
               final Throwable exception,
               final String errorMessage);
   
       /** Collect dirty record with exception */
       default void collect(
               final int subTaskIndex, final SeaTunnelRow dirtyRecord, final Throwable exception) {
           collect(subTaskIndex, dirtyRecord, exception, "");
       }
   }
   ```
   
   Add method `getDirtyRecordCollector` to `SinkWriter.Context`:
   
   ```java
   
   interface Context extends Serializable {
   
       /** @return The index of this subtask. */
       int getIndexOfSubtask();
   
       /** @return metricsContext of this reader. */
       MetricsContext getMetricsContext();
   
       /**
        * Get dirty record collector
        */
       DirtyRecordCollector getDirtyRecordCollector();
   }
   
   ```
   
   Add method `getPluginConfig` to `SeaTunnelPluginLifeCycle`:
   
   ```java
   
   /**
    * Get the config of plugin
    */
   Config getPluginConfig();
   
   ```
   
   ### Configuration File Example
   
   ```hocon
   env {
     job.mode = BATCH
     dirty.collector = {
       type = log
     }
   }
   
   source {
     FakeSource {
       row.num = 100
       schema {
         fields {
           name = string
           age = int
         }
       }
     }
   }
   
   sink {
     Console {}
   }
   
   ```
   
   ### Technical Implementation
   
   1. Modify `seatunnel-config-shade`. During the transmission process, `SeaTunnelSink` will undergo serialization operations, but the underlying interface of `typesafe-config` does not support serialization, so it is necessary to make `Config` support serialization to ensure that it is not lost during transmission. See #4586 for specific implementation details.
   2. Modify all `SeaTunnelSink` to implement the `getPluginConfig` interface and inject the pluginConfig during the prepare phase.
   Before instantiating the Sink, merge the plugin configuration for all Sinks, and merge the dirty data collector configuration information from the env section into the plugin configuration.
   3. Modify `DefaultSinkWriterContext` and `SinkWriterContext` to instantiate the `DirtyRecordCollector` using the configuration and implement the `getDirtyRecordCollector` method.
   4. Modify all `SeaTunnelSink` to report and update metrics using the dirty data collector when data writing or conversion fails.
   
   ### Process Design
   
   ![drawio](https://user-images.githubusercontent.com/51053924/232326690-42a0680a-e002-4c0b-8dd0-6e056efe8484.png)
   
   
   ### Usage Scenario
   
   _No response_
   
   ### Related issues
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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.apache.org

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


[GitHub] [incubator-seatunnel] EricJoy2048 commented on issue #4587: [Feature][Core] Design of Dirty Data Collection

Posted by "EricJoy2048 (via GitHub)" <gi...@apache.org>.
EricJoy2048 commented on issue #4587:
URL: https://github.com/apache/incubator-seatunnel/issues/4587#issuecomment-1510942192

   > Source maybe need collect dirty data
   
   +1


-- 
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


[GitHub] [seatunnel] github-actions[bot] closed issue #4587: [Feature][Core] Design of Dirty Data Collection

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #4587: [Feature][Core] Design of Dirty Data Collection
URL: https://github.com/apache/seatunnel/issues/4587


-- 
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


[GitHub] [seatunnel] github-actions[bot] commented on issue #4587: [Feature][Core] Design of Dirty Data Collection

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #4587:
URL: https://github.com/apache/seatunnel/issues/4587#issuecomment-1648794339

   This issue has been automatically marked as stale because it has not had recent activity for 30 days. It will be closed in next 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


[GitHub] [seatunnel] github-actions[bot] commented on issue #4587: [Feature][Core] Design of Dirty Data Collection

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #4587:
URL: https://github.com/apache/seatunnel/issues/4587#issuecomment-1659386209

   This issue has been closed because it has not received response for too long time. You could reopen it if you encountered similar problems in the future.


-- 
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


[GitHub] [incubator-seatunnel] hailin0 commented on issue #4587: [Feature][Core] Design of Dirty Data Collection

Posted by "hailin0 (via GitHub)" <gi...@apache.org>.
hailin0 commented on issue #4587:
URL: https://github.com/apache/incubator-seatunnel/issues/4587#issuecomment-1510739480

   Source maybe need collect 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


[GitHub] [incubator-seatunnel] liugddx commented on issue #4587: [Feature][Core] Design of Dirty Data Collection

Posted by "liugddx (via GitHub)" <gi...@apache.org>.
liugddx commented on issue #4587:
URL: https://github.com/apache/incubator-seatunnel/issues/4587#issuecomment-1511156576

   Can we add a threshold? Maybe the dirty data has reached the threshold, so the task must be dropped abnormally and an alarm will be issued.


-- 
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


[GitHub] [incubator-seatunnel] TyrantLucifer commented on issue #4587: [Feature][Core] Design of Dirty Data Collection

Posted by "TyrantLucifer (via GitHub)" <gi...@apache.org>.
TyrantLucifer commented on issue #4587:
URL: https://github.com/apache/incubator-seatunnel/issues/4587#issuecomment-1510652650

   > 
   
   1. Does `ReadonlyConfig` has the merge  ability?
   2. The initialize process of `SinkWriter.Context` happened after sink create, so env config it can not take and we should merge the env config into sink config before sink create.


-- 
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


[GitHub] [incubator-seatunnel] EricJoy2048 commented on issue #4587: [Feature][Core] Design of Dirty Data Collection

Posted by "EricJoy2048 (via GitHub)" <gi...@apache.org>.
EricJoy2048 commented on issue #4587:
URL: https://github.com/apache/incubator-seatunnel/issues/4587#issuecomment-1510941731

   > 
   
   +1


-- 
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: [I] [Feature][Core] Design of Dirty Data Collection [seatunnel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #4587: [Feature][Core] Design of Dirty Data Collection
URL: https://github.com/apache/seatunnel/issues/4587


-- 
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


[GitHub] [incubator-seatunnel] github-actions[bot] commented on issue #4587: [Feature][Core] Design of Dirty Data Collection

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #4587:
URL: https://github.com/apache/incubator-seatunnel/issues/4587#issuecomment-1552244647

   This issue has been automatically marked as stale because it has not had recent activity for 30 days. It will be closed in next 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: [I] [Feature][Core] Design of Dirty Data Collection [seatunnel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #4587:
URL: https://github.com/apache/seatunnel/issues/4587#issuecomment-3067449898

   This issue has been automatically marked as stale because it has not had recent activity for 30 days. It will be closed in next 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: [I] [Feature][Core] Design of Dirty Data Collection [seatunnel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #4587:
URL: https://github.com/apache/seatunnel/issues/4587#issuecomment-3100149834

   This issue has been closed because it has not received response for too long time. You could reopen it if you encountered similar problems in the future.


-- 
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: [I] [STIP-15] [Feature][Core] Design of Dirty Data Collection [seatunnel]

Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on issue #4587:
URL: https://github.com/apache/seatunnel/issues/4587#issuecomment-4219672310

   Thanks for reopening and retitling this as a STIP tracker.
   
   I checked the current API surface again. In the current `dev` code, `SinkWriter.Context` still only exposes subtask / parallelism / metrics / event-listener access, and the old `SeaTunnelPluginLifeCycle` still does not provide the dirty-collector-style accessor proposed in the original description. So the issue is still valid as a framework change rather than something already absorbed into the existing sink API.
   
   I also checked the current PR state: PR #10502 is already open against `dev` and is explicitly implementing the dirty data collection framework for this issue.
   
   So from my side, the best next step is to keep this issue as the design tracker and continue the concrete technical discussion in #10502, especially around the points raised earlier in this thread:
   1. context injection vs. merging collector config into sink plugin config
   2. whether source-side dirty handling should be in scope
   3. whether `CatalogTable` / threshold / fail policy should be part of the first slice
   
   That will keep the design discussion attached to real code and make it much easier to converge. Thanks to everyone who kept the original design notes alive.
   


-- 
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


[GitHub] [incubator-seatunnel] Hisoka-X commented on issue #4587: [Feature][Core] Design of Dirty Data Collection

Posted by "Hisoka-X (via GitHub)" <gi...@apache.org>.
Hisoka-X commented on issue #4587:
URL: https://github.com/apache/incubator-seatunnel/issues/4587#issuecomment-1510607666

   > so it is necessary to make Config support serialization to ensure that it is not lost during transmission.
   
   Why not use `ReadonlyConfig`? I think we would remove use config in connector layer in the future.
   
   > Before instantiating the Sink, merge the plugin configuration for all Sinks, and merge the dirty data collector configuration information from the env section into the plugin configuration.
   
    I think sink should not care about dirty data collector config. Why not just use env config to create `DirtyRecordCollector ` then put it into `context`? And Any dirty data collector config should be handle in `DirtyRecordCollector `.


-- 
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


[GitHub] [incubator-seatunnel] EricJoy2048 commented on issue #4587: [Feature][Core] Design of Dirty Data Collection

Posted by "EricJoy2048 (via GitHub)" <gi...@apache.org>.
EricJoy2048 commented on issue #4587:
URL: https://github.com/apache/incubator-seatunnel/issues/4587#issuecomment-1510970998

   <img width="821" alt="image" src="https://user-images.githubusercontent.com/32193458/232437490-47a0c841-6a05-4a59-ad67-33ad58961dcd.png">
   
   `default void collect(
               final int subTaskIndex, final SeaTunnelRow dirtyRecord, final Throwable exception)`
   
   Can we add a `CatalogTable` type parameter in this method? CatalogTable information can help user Identify which table has the problem.


-- 
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