diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/sync/ReplicationActivityImpl.java b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/sync/ReplicationActivityImpl.java index 1109fe2487c7..945e4a63cd69 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/sync/ReplicationActivityImpl.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/sync/ReplicationActivityImpl.java @@ -61,6 +61,7 @@ public class ReplicationActivityImpl implements ReplicationActivity { private static final Logger LOGGER = LoggerFactory.getLogger(ReplicationActivityImpl.class); + private static final int MAX_TEMPORAL_MESSAGE_SIZE = 2 * 1024 * 1024; private final Optional containerOrchestratorConfig; private final WorkerConfigs workerConfigs; @@ -156,7 +157,14 @@ public StandardSyncOutput replicate(final JobRunConfig jobRunConfig, final ReplicationOutput attemptOutput = temporalAttempt.get(); final StandardSyncOutput standardSyncOutput = reduceReplicationOutput(attemptOutput); - LOGGER.info("sync summary: {}", standardSyncOutput); + final String standardSyncOutputString = standardSyncOutput.toString(); + LOGGER.info("sync summary: {}", standardSyncOutputString); + if (standardSyncOutputString.length() > MAX_TEMPORAL_MESSAGE_SIZE) { + LOGGER.error("Sync ouput exceeds the max temporal message size of {}, actual is {}.", MAX_TEMPORAL_MESSAGE_SIZE, + standardSyncOutputString.length()); + } else { + LOGGER.info("Sync summary length: {}", standardSyncOutputString.length()); + } return standardSyncOutput; },