Skip to content

[FLINK-38455] Fix ES8 pipeline connector failure when batch contains only SchemaChangeEvents#4270

Merged
lvyanquan merged 1 commit intoapache:masterfrom
Hisoka-X:FLINK-38455-es-empty-request
Feb 25, 2026
Merged

[FLINK-38455] Fix ES8 pipeline connector failure when batch contains only SchemaChangeEvents#4270
lvyanquan merged 1 commit intoapache:masterfrom
Hisoka-X:FLINK-38455-es-empty-request

Conversation

@Hisoka-X
Copy link
Copy Markdown
Member

This close https://issues.apache.org/jira/browse/FLINK-38455

When the pipeline starts, Flink CDC sends CreateTableEvent (a SchemaChangeEvent) before any DataChangeEvent. The ElasticsearchEventSerializer returns null for SchemaChangeEvent since it only updates the internal schema cache and does not produce an actual ES operation.

In Elasticsearch8AsyncWriter.submitRequestEntries(), operations with null BulkOperationVariant are skipped via continue. However, when all operations in a batch are SchemaChangeEvent (which is common at pipeline startup), no operation is added to the BulkRequest.Builder. Calling br.build() on an empty builder throws:

Missing required property 'BulkRequest.operations'

because operations is a required field in the ES8 Java Client's BulkRequest.

The fix checks whether any valid operation was added before calling br.build(). If the batch is effectively empty, it returns success immediately without sending a request to Elasticsearch.

Copy link
Copy Markdown
Contributor

@lvyanquan lvyanquan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@lvyanquan lvyanquan merged commit d993c6a into apache:master Feb 25, 2026
25 of 28 checks passed
@Hisoka-X Hisoka-X deleted the FLINK-38455-es-empty-request branch February 25, 2026 02:29
suhwan-cheon pushed a commit to suhwan-cheon/flink-cdc that referenced this pull request Mar 9, 2026
ThorneANN pushed a commit to ThorneANN/flink-cdc that referenced this pull request Mar 19, 2026
Mrart pushed a commit to Mrart/flink-cdc that referenced this pull request Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants