Single-table real-time synchronization: O&M and tuning

更新时间:
复制 MD 格式

After you develop a task in Data Studio and deploy it to the production environment, you can go to Operation Center to run the real-time synchronization task, monitor the task status, and view runtime metrics.

Prerequisite

A real-time synchronization task has been created and deployed. For more information, see Configure a real-time synchronization task for a single table.

In DataWorks Data Integration, a single-table real-time synchronization task is a pipeline that synchronizes data from a single source table, topic, Logstore, or a similarly granular data object to a destination. In daily operations, you must be able to quickly identify task anomalies, adjust performance parameters, and ensure data consistency.

Prerequisite

Ensure that the following prerequisites are met before you run a single-table real-time synchronization task.

Category

Requirement

Verification method

Source permissions

Ensure you have permission to read metadata from the source and can retrieve complete column information for the source table.

Use the configured account to access the source and confirm that you can read the table structure and column information.

Destination permissions

Ensure you have permission to create tables or write data to the destination.

Use the configured account to run a test by creating a table or writing data to the destination.

Resource group

The resource group specifications meet the computing and network demands of the full initialization phase.

Confirm that the resource group is available and its specifications meet the synchronization task's requirements.

Network connectivity

Confirm that network connectivity is established from the source through the channel to the destination.

Use network testing tools to confirm that all nodes are reachable.

Single-table real-time synchronization O&M and tuning

Use the following guidance for daily O&M, troubleshooting, and performance tuning of single-table real-time synchronization tasks. A single-table real-time synchronization task refers to a pipeline that synchronizes data from a single source table, topic, Logstore, or a similarly granular data object to a destination in real time.

Single-table real-time synchronization is covered separately because some sources, destinations, or channel capabilities are not suitable for database-level real-time synchronization, or you only need to synchronize a single, specific data object. When the source and channel capabilities allow, we recommend that you use a database-level real-time synchronization task and select only one table to handle single-table real-time synchronization. This approach leverages the database-level capabilities for schema migration, full initialization, incremental ingestion, and subsequent table expansion. Regardless of the entry point, the following content covers only O&M for single-table real-time pipelines and does not cover database-level multi-table batch management, database-level batch synchronization, or database-level full and incremental real-time synchronization.

Applicable channels and boundaries

Start by evaluating the task type, channel capabilities, and troubleshooting focus.

Evaluation item

Applicable scope

Not applicable / Key focus

Task type

A single table, topic, Logstore, or a similarly granular data stream

Does not cover database-level table discovery, batch table addition, or table removal and undeployment

Typical channels

Kafka / DataHub / SLS / LogHub → Hologres / MaxCompute / Kafka / Doris / StarRocks / Lindorm / DLF / OSS

When a database source supports selecting a single table for database-level real-time synchronization, use database-level real-time synchronization first

Troubleshooting focus

Offsets, log retention, primary keys, DDL, consumer lag, message format, column parsing, dirty data, and destination throttling

Do not apply database-level table addition or removal experience

Hologres can also serve as a source for single-table real-time synchronization. For table-level real-time pipelines such as Hologres → Hologres, Hologres → MaxCompute, and Hologres → Doris, follow the single-table real-time troubleshooting approach and focus on source table permissions, Binlog/change data capture (CDC), primary keys, column mapping, and destination write semantics.

Key boundary: Single-table real-time synchronization is not a simplified version of database-level real-time synchronization. It is better suited for scenarios where source permissions, message models, data formats, or destination write semantics are not compatible with database-level real-time synchronization. When Hologres is used as a source, follow the table-level real-time pipeline troubleshooting approach.

Task stages

Stage

Description

O&M focus

Schema preparation

Reads source columns, primary keys, partitions, or message formats, and creates or verifies the destination schema.

Source metadata permissions, destination table creation or write permissions, column types, primary keys, partitions, and mapping rules

Full initialization

Writes historical data that existed before the task was started to the destination. Whether this stage is included depends on the task configuration and channel capabilities.

Split key, full synchronization concurrency, source connection count, resource group specifications, and destination write capacity

Real-time incremental synchronization

Continuously consumes Binlog, WAL, logs, messages, or change events and writes them to the destination.

Offsets, business latency, throughput, Checkpoint, Failover, DDL, dirty data, and destination write capacity

Risks in single-table real-time tasks typically fall into two categories: one is offset and log retention — if the task is stopped for too long, it may not be able to resume from the original offset; the other is destination write semantics — when primary keys, write modes, partitions, or column mappings are inconsistent, Update, Delete, or idempotent writes may not produce the expected results.

Common O&M operations

Start and stop

  • After you start a task, first verify that schema preparation is complete, then observe whether full initialization has started and is progressing, and finally confirm that real-time incremental synchronization is continuously reading and writing data. For message source tasks, also monitor the consumer offset and message backlog. For database log-based tasks, monitor Binlog, WAL, or log retention time.

  • Before you stop a task, confirm whether the source log or message retention period can cover the downtime window. If the downtime exceeds the retention period, the task may not be able to resume from the original offset. In such cases, you typically need to reset the offset, skip the historical backlog, or reinitialize. Before performing these operations, evaluate the risks of duplicate writes and data loss.

Modify configurations

Common modifications for single-table real-time tasks include adjusting column mappings, primary keys, write modes, partition rules, concurrency, resources, offsets, and dirty data handling policies.

Change type

Risk

Recommendation

Modify column mappings

May cause missing columns, type conversion failures, or destination write errors

Before you submit changes, verify the source columns, destination columns, column types, and default values

Modify primary keys or write modes

May affect Update, Delete, idempotent write, and deduplication results

First confirm whether the destination supports the corresponding write semantics, then evaluate whether historical data needs to be rewritten

Modify partition rules

May cause data to be written to new partitions, incorrect partitions, or generate excessive small partitions

Before you submit changes, verify the partition column granularity, partition expression, and destination partition limits

Adjust concurrency and resources

May increase pressure on the source, destination, or resource group

Adjust incrementally, and after each adjustment, monitor latency, throughput, Checkpoint, and Failover

Reset offsets

May cause duplicate consumption or skipped data

First confirm the acceptable recovery point for the business, then record the time and offset before and after the reset

Adjust dirty data handling policies

May allow the task to continue running but discard abnormal records

We do not recommend simply increasing the threshold to bypass the issue. First determine whether the dirty data affects business results.

Alert configuration

For single-table real-time tasks, monitor at least task status, business latency, and Failover. Depending on the channel capabilities and task configuration, also add alerts for resource utilization, write errors, DDL notifications, and message backlog.

For message source tasks, also monitor the backlog of the source topic, shard, Logstore, or consumer group. For database log-based tasks, monitor Binlog, WAL, archive log, or replication slot retention. Configuring only task failure alerts cannot detect issues where the task is still running but latency is continuously increasing, writes are slowing down, or offsets have not advanced for a long time.

Troubleshooting

Task produces no data output

When the task shows as running but no new data appears at the destination, confirm whether the source actually has new data, then determine whether the reader is not consuming data, the pipeline is experiencing processing errors, or the writer is not committing data.

Troubleshooting sequence:

  1. Check whether the source table, topic, Logstore, or log offset has new data.

  2. Check whether the task is in the full initialization, real-time incremental synchronization, or Failover state.

  3. Check whether read metrics, write metrics, business latency, and Checkpoint are progressing normally.

  4. Check whether the destination table, destination partition, primary key, and write mode match the configuration.

  5. Check whether dirty data, column mapping failures, or destination permission issues exist.

If the DML/DDL statistics in the runtime details show no data for a short period but the logs and destination writes are normal, also check for metric collection latency or collection anomalies to avoid misinterpreting a monitoring display issue as a synchronization interruption.

Slow or failed full initialization

When full initialization is slow, first identify whether the bottleneck is in source reads, network, resource group, destination writes, or uneven data splitting.

Symptom

Possible cause

Recommendation

Full initialization has not started for a long time

Resource queuing, source or destination connectivity issues, or destination table creation failure

Check the resource group status, data source connectivity, and destination permissions

Slow full read

Inappropriate split key, source SQL not using indexes, high source load, or insufficient connections

Select a split key with more even distribution and indexes, adjust concurrency moderately, and throttle or stagger the load when the source is under pressure

Slow full write

Destination throttling, too many partitions, or high batch commit overhead

Check the destination write capacity, partition count, batch write parameters, and resource group specifications

Full initialization failure

Incompatible column types, primary key conflicts, destination constraints, or dirty data exceeding the threshold

First identify the failing column and destination error, then adjust the mapping, cleanse the data, or modify the destination schema

During the full initialization phase, do not rely solely on average throughput. A few large shards, wide tables, large columns, or hot partitions may determine the overall completion time.

Increasing real-time latency

When real-time latency increases, check whether the latency is continuously decreasing. If the task has just completed full initialization, the real-time pipeline may be replaying incremental data accumulated during the full synchronization phase. If the latency continues to grow, identify whether the bottleneck is in the reader, writer, resources, network, or an external system.

We recommend that you troubleshoot in the following order:

  1. Check the window wait time in the task runtime details to determine whether the bottleneck is primarily in the reader or writer.

  2. Check the task logs during the high-latency period and search for keywords such as Error, Exception, and OutOfMemory.

  3. Check the Failover records to determine whether frequent Failovers, OOM errors, or external service exceptions have occurred.

  4. Check the runtime metrics and events, focusing on throughput, backpressure, Checkpoint, JVM memory, GC, DDL events, and dirty data.

  5. Then continue to identify the cause by examining the source, destination, resources, concurrency, and network. We do not recommend increasing concurrency or resources before identifying the bottleneck.

The window wait time can be used as the first-level indicator:

Indicator

Possible cause

Next step

High reader wait time

Slow source reads, partition or shard skew, source throttling, sudden increase in change volume, or log backlog

Prioritize checking source monitoring, partition or shard distribution, Binlog/WAL/message backlog, and Reader data volume

High writer wait time

Slow destination writes, destination throttling, too many dynamic partitions, slow batch commits, or insufficient network bandwidth

Prioritize checking destination resources, write QPS, Sink logs, batch commit overhead, and dynamic partitions

Both reader and writer wait times are high

Insufficient task resources, backpressure, slow Checkpoint, frequent Failovers, or external system instability

Prioritize checking Failover, JVM/GC, Checkpoint, resource group specifications, and task concurrency

After you identify the bottleneck location, you can further troubleshoot based on the specific symptom:

Symptom

Possible cause

Recommendation

Latency continuously increasing

Source write speed exceeds consumption speed, insufficient network bandwidth, or slow destination writes

Check the source production rate, read rate, write rate, and destination throttling separately

Noticeable reader wait or backpressure

Large transactions, log backlog, message partition hotspots, or source throttling

Check source write peaks, log growth, and partition or shard distribution

High writer wait time

Slow destination writes, batch commits too small, insufficient connections, or too many partitions

Prioritize checking destination resources and write limits, then adjust batch, flush, commit, or connection pool parameters

Checkpoint slowing down or failing

Slow writer commits, excessive state size, external service instability, or insufficient resources

Use Checkpoint duration, failedCount, State size, and logs to identify the issue

Frequent Failovers

Insufficient memory, external service exceptions, column mapping failures, or DDL processing errors

Check the exception stack traces, dirty data, and DDL events before and after Failovers

OutOfMemory in logs

Insufficient task memory or excessive processing pressure on a single concurrent thread

Increase CU or memory incrementally and monitor whether JVM, GC, Checkpoint, and Failover metrics improve

  • For message sources such as Kafka, DataHub, and LogHub, pay close attention to the number of partitions or shards. A single partition or shard can typically be consumed by only one concurrent thread. When data is concentrated in a few partitions, simply increasing total concurrency may not help. You can check the cumulative bytes of different Reader threads combined with source monitoring to determine whether partition or shard hotspots exist.

  • For database log-based sources such as MySQL, pay close attention to large transactions, high-volume DML, frequent DDL, and Binlog growth rate. If synchronization speed is not high but latency continues to increase, check the source database audit logs, CPU, I/O, connections, and Binlog growth to determine whether the source is under pressure or whether unsynchronized databases and tables are generating a large volume of Binlog entries.

  • When writing to MaxCompute, if the log shows uploader map size has reached uploaderMapMaximumSize, this typically indicates that the number of dynamic partition values within a single Flush interval is too large. Prioritize adjusting the partition granularity or dynamic partition columns to avoid using high-cardinality columns such as second-level timestamps, order IDs, or user IDs as partition values. Then evaluate whether you need to increase concurrency or resources.

DDL event processing errors

When a task fails, latency increases, or destination schema becomes inconsistent after a DDL event, first check whether the current channel supports the DDL type and what the task's DDL handling policy is.

Troubleshooting focus:

  • Identify which DDL operations occurred at the source, such as adding columns, dropping columns, changing types, renaming, creating tables, dropping tables, or modifying indexes.

  • Check whether the destination supports the same DDL or an equivalent schema change.

  • Check whether the task policy is set to process normally, ignore, alert, or stop.

  • Check whether the destination account has ALTER TABLE permissions.

  • Check whether column mappings, primary keys, and partitions remain consistent before and after the DDL.

We do not recommend directly ignoring unsupported DDL operations. Ignoring a DDL may allow the task to continue running, but subsequent DML writes may continue to fail due to column mismatches, primary key changes, or destination schema inconsistencies.

Update or Delete not producing expected results

When destination data does not match expectations after Update or Delete operations, first check whether the destination has a primary key or unique key that can locate records, and whether the source and destination primary key mappings are consistent.

Common causes include:

  • The destination does not have a primary key or unique key, making it impossible to update or delete by record.

  • The source primary key and destination primary key are inconsistent.

  • Primary key columns have been transformed, renamed, or written as null.

  • The destination write mode does not support updates or deletes.

  • The task is configured to ignore Delete operations or uses a special write policy.

  • Write failures are recorded as dirty data, but the task continues running.

To troubleshoot, first use a small set of sample records to verify the source events, task mappings, and destination results, then decide whether to adjust primary keys, write modes, or reinitialize the destination table.

Increasing dirty data

When dirty data increases, do not directly increase the dirty data threshold. First determine whether the dirty data causes missing data, null columns, column truncation, primary key conflicts, or partition anomalies at the destination.

Troubleshooting focus:

  • Check whether column types, lengths, precisions, and NOT NULL constraints match.

  • Check whether destination primary keys, unique keys, or partition columns meet the requirements.

  • Check whether the source has introduced excessively long strings, invalid encodings, special JSON, unparsable timestamps, or unsupported data types.

  • Check whether the destination has throttling, write failures, or server-side filtering.

Only consider temporarily increasing the dirty data threshold when you have confirmed that the business can accept discarding these abnormal records. Follow up by fixing the source data or destination schema.

Tuning recommendations

Tuning item

Applicable scenario

Recommendation

Resource specifications / CU

High CPU, memory, network, or resource group utilization

Increase resources incrementally and monitor whether latency, Failover, and Checkpoint improve

Real-time concurrency

Both source and destination have sufficient parallelism

First confirm that no single-partition, single-shard, or single-table hotspot exists before increasing concurrency

Full synchronization concurrency and split key

Slow full initialization

Select a split key column with even distribution, indexes, and a supported type

Checkpoint / Flush interval

Frequent writer commits or high commit overhead

Make small adjustments and monitor throughput, data visibility latency, and failure rate. We do not recommend making large adjustments at once.

Batch write parameters

High writer wait time

Adjust batch, flush, commit, and connection pool parameters based on destination limits

Partition granularity

Too many destination partitions or high commit overhead

Avoid using high-cardinality columns such as second-level timestamps, order IDs, or user IDs as dynamic partition values

Message source partitions

High latency for Kafka, DataHub, LogHub, or similar sources

Monitor partition hotspots and consumer concurrency limits. Adjust the source partition design if necessary.

Transformer logic

Complex JSON parsing, column processing, or numerous filter rules

Reduce unnecessary complex transformations, or increase resources and monitor CPU and latency changes

When adjusting the Checkpoint or Flush interval, we recommend that you first make small increases, for example, from 5 seconds to 10 seconds or 30 seconds, and then monitor write throughput, Checkpoint duration, end-to-end latency, and destination load for 10 to 30 minutes. If latency decreases but data visibility does not meet business requirements, reduce the interval back to a smaller value.

Note

After tuning, observe for at least one stable window. Short-term throughput immediately after a task restart may not represent long-term performance, especially when there is backlogged data, destination throttling, or Checkpoint fluctuations.

FAQ

Issue

Troubleshooting focus

Recommendation

Task is running but no data at the destination

Whether the source has new data, whether offsets are advancing, whether data is being written to the destination, and whether metric collection is normal

Check source data, task logs, DML metrics, and destination results simultaneously. Do not rely on a single page for diagnosis.

Cannot resume from the original offset after stopping

Whether Binlog, WAL, logs, or messages have exceeded the retention period

Before resetting offsets or reinitializing, evaluate the risks of duplicate consumption, skipped data, and downstream impact

Kafka or other message source shows very high latency

Whether the message timestamps are historical, whether the consumer offset is lagging, and whether partition hotspots exist

Distinguish between "high latency display caused by historical message timestamps" and actual insufficient consumption capacity

High DataHub write or consumption latency

Whether throttling is triggered, whether batchSize is too small, and whether backpressure exists

Adjust parameters or quotas based on source throttling, task backpressure, and writer throughput

Writes to MaxCompute or other destinations slowing down

Partition count, Tunnel Session, and Checkpoint commit overhead

Prioritize reducing the number of partitions involved in a single Checkpoint, then adjust batch commit and resource parameters

High Hologres write latency

Destination table primary key, Segment Key, table type, write mode, and Hologres load

First confirm whether the destination table design is suitable for real-time writes, then adjust task resources and batch write parameters

Destination Update or Delete not taking effect

Destination primary key, write mode, column mapping, and dirty data logs

Prioritize using sample records to verify source events, destination primary keys, and actual write results

Task failure after DDL

DDL type, destination support, DDL policy, and destination permissions

Check DDL events and failure logs to determine whether the destination table schema needs to be manually adjusted before resuming

High-risk operation checklist

Before resetting offsets, restarting a task, modifying primary keys, modifying write modes, making significant parameter changes, rerunning full initialization, or clearing destination tables, confirm the following:

  • Whether the source log or message retention period is sufficient.

  • Whether the current offset, business time, and latest destination data have been recorded.

  • Whether the operation may cause duplicate writes, skipped data, or destination overwrites.

  • Whether downstream systems have already consumed the destination data.

  • Whether there are unprocessed DDL events, dirty data, or frequent Failovers.

  • Whether alerts cover task status, business latency, Failover, write errors, and dirty data.