Skip to content

feat(sink): cherry-pick limit StarRocks stream load batch size (#25750)#26307

Queued
risingwave-ci with Copilot wants to merge 2 commits into
release-3.0from
copilot/fix-77175557-453068084-a6672e0f-c2be-491d-9232-6bc61549f867
Queued

feat(sink): cherry-pick limit StarRocks stream load batch size (#25750)#26307
risingwave-ci with Copilot wants to merge 2 commits into
release-3.0from
copilot/fix-77175557-453068084-a6672e0f-c2be-491d-9232-6bc61549f867

Conversation

Copilot AI commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

Backport #25750 to release-3.0 by cherry-picking commit e29a68a17bebaffa0ee60ccea9159acdeb03c7a0.

This change adds the optional starrocks.max_batch_size_bytes setting for StarRocks sinks. The setting:

  • Limits the encoded JSON payload size of each StarRocks stream load request.
  • Must be a positive byte value when configured.
  • Defaults to unlimited when omitted, preserving existing behavior.
  • Can be altered on the fly.

The sink writer tracks the current request size and finishes the current load request before adding a row that would exceed the configured limit. It then opens another load request within the same StarRocks transaction. A single row whose encoded payload exceeds the limit fails with a clear error instead of sending an oversized request.

The shared write path applies the limit to append-only and upsert sinks. This backport also exposes the option in generated sink metadata and corrects the StarRocks JSON error wording from “derialize” to “serialize”.

Testing

Added seven unit tests covering:

  • Default and explicit configuration parsing.
  • Rejection of zero.
  • Exact-limit batches.
  • Request rollover before exceeding the limit.
  • Oversized single rows.
  • Size-counter overflow.

The cherry-pick agent reports all seven tests passing.

Checklist

  • I have written necessary rustdoc comments.
  • I have added necessary unit tests and integration tests.
  • I have added test labels as necessary.
  • I have added fuzzing tests or opened an issue to track them.
  • My PR contains breaking changes.
  • My PR changes performance-critical code, so I will run (micro) benchmarks and present the results.
  • I have checked the Release Timeline and Currently Supported Versions to determine which release branches I need to cherry-pick this PR into.

Documentation

  • My PR needs documentation updates.
Release note

StarRocks sinks in release 3.0 support the optional starrocks.max_batch_size_bytes setting. When configured, RisingWave splits stream load requests before their encoded JSON payload exceeds the specified positive byte limit. The setting defaults to unlimited when omitted and can be altered on the fly.

@cyliu0

cyliu0 commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

@copilot Would you please finish this work?

Co-authored-by: cyliu0 <35356271+cyliu0@users.noreply.github.com>

Copilot AI commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Would you please finish this work?

Done. Applied the cherry-pick of PR #25750 onto release-3.0. Changes committed in feat(sink): limit StarRocks stream load batch size (cherry-pick #25750):

  • Added starrocks.max_batch_size_bytes config option (defaults to unlimited, allow_alter_on_fly)
  • Added decide_load_request_size to split load requests when the byte limit is reached
  • Refactored StarrocksSinkWriter with write_row_json, finish_load_request, ensure_load_request helpers
  • Fixed typo "Json derialize error""Json serialize error"
  • Updated allow_alter_on_fly_fields.rs and with_options_sink.yaml
  • Added 7 unit tests (all passing)

Copilot AI requested a review from cyliu0 July 17, 2026 01:16
@cyliu0

cyliu0 commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

@copilot fix the PR title

Copilot AI commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

@copilot fix the PR title

I don't have direct access to update the PR title. The recommended title is:

feat(sink): limit StarRocks stream load batch size (cherry-pick #25750 to release-3.0)

Could you please update it manually?

@cyliu0 cyliu0 changed the title [WIP] Copilot Request feat(sink): cherry-pick limit StarRocks stream load batch size (#25750) Jul 17, 2026
@cyliu0
cyliu0 requested a review from xxhZs July 17, 2026 01:54
@cyliu0 cyliu0 added A-connector Area: Connector. user-facing-changes Contains changes that are visible to users labels Jul 17, 2026 — with ChatGPT Codex Connector
@zwang28
zwang28 marked this pull request as ready for review July 17, 2026 02:17
@zwang28
zwang28 enabled auto-merge July 17, 2026 02:18
@zwang28
zwang28 added this pull request to the merge queue Jul 17, 2026
Any commits made after this event will not be merged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-connector Area: Connector. ci/run-e2e-starrocks-sink-tests type/feature Type: New feature. user-facing-changes Contains changes that are visible to users

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cherry-pick feat(sink): limit StarRocks stream load batch size (#25750) to branch release-3.0

4 participants