apache/seatunnel · error · TablestoreConnectorException

FLUSH_DATA_FAILED

FLUSH_DATA_FAILED

Error message

Writing items to Tablestore failed.

What it means

Re-thrown wrapper for a previously captured asynchronous flush failure in TableStoreSinkClient. The writer defers the original failure (flushException) and raises it via checkFlushException() on subsequent write/flush calls so the pipeline fails deterministically after a background write error.

Solutions

  1. Read the cause (flushException) attached to this exception to find the original write failure.
  2. Verify Tablestore endpoint/credentials (AccessKeyId/Secret) and network connectivity from the worker nodes.
  3. Add retry/batch tuning to reduce throttling; check Tablestore monitoring for 5xx/throttle errors during the job window.
  4. Restart the job after fixing the root cause; this error always accompanies an earlier failure.

Example fix

// before
TablestoreConnectorException e = ...; // only sees generic message
// after
Throwable root = e.getCause(); // inspect original flush failure
log.error("Original flush failure", root);
Defensive patterns

Strategy: try-catch

Validate before calling

// Check reachability before job start
try (Socket s = new Socket(host, 443)) { /* endpoint reachable */ }

Try / catch

try {
    sinkWriter.flush();
} catch (TablestoreConnectorException e) {
    Throwable root = e.getCause(); // original flush failure
    log.error("Flush failed, root cause: {}", root == null ? "none" : root.toString(), e);
    throw e;
}

Prevention

When it happens

Trigger: A prior write/flush attempt recorded flushException (e.g. from an async callback failure), and a later call to write() or flush() invokes checkFlushException() which sees it is non-null.

Common situations: Network partitions to Tablestore endpoint; credential expiry mid-job; throttling during bursts; the original root cause is in the wrapped flushException cause, not this message.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/fbf3ddd8d30839f3. Report an issue: GitHub.

Appendix: source

Thrown at seatunnel-connectors-v2/connector-tablestore/src/main/java/org/apache/seatunnel/connectors/seatunnel/tablestore/sink/TableStoreSinkClient.java:101

            return;
        }
        BatchWriteRowRequest batchWriteRowRequest = new BatchWriteRowRequest();
        batchList.forEach(batchWriteRowRequest::addRowChange);
        BatchWriteRowResponse response = syncClient.batchWriteRow(batchWriteRowRequest);

        if (!response.isAllSucceed()) {
            throw new TablestoreConnectorException(
                    TablestoreConnectorErrorCode.WRITE_ROW_FAILED,
                    String.format(
                            "Failed to send these rows of data: '%s'.", response.getFailedRows()));
        }

        batchList.clear();
    }

    private void checkFlushException() {
        if (flushException != null) {
            throw new TablestoreConnectorException(
                    CommonErrorCodeDeprecated.FLUSH_DATA_FAILED,
                    "Writing items to Tablestore failed.",
                    flushException);
        }
    }
}

View on GitHub (pinned to cf67b549a7)